Changeset f6fae8d for global.c


Ignore:
Timestamp:
Jun 1, 2010, 12:14:11 PM (14 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.7, release-1.8, release-1.9
Children:
e294783
Parents:
84a4aca
Message:
Port the editwin to owl_window

The others are still unmanaged for now. Fortunately, they were set up as
as panels, so we can see through them to the windows we want in the
meantime. :-)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • global.c

    rd2a4534 rf6fae8d  
    158158
    159159void _owl_global_setup_windows(owl_global *g) {
    160   int cols, typwin_lines, recwinlines;
     160  int cols, recwinlines;
    161161
    162162  cols=g->cols;
    163   typwin_lines=owl_global_get_typwin_lines(g);
    164163
    165164  recwinlines = owl_global_get_recwin_lines(g);
     
    169168  _owl_panel_set_window(&g->seppan, newwin(1, cols, recwinlines, 0));
    170169  _owl_panel_set_window(&g->msgpan, newwin(1, cols, recwinlines+1, 0));
    171   _owl_panel_set_window(&g->typpan, newwin(typwin_lines, cols, recwinlines+2, 0));
    172 
    173   if (g->tw)
    174       owl_editwin_set_curswin(g->tw, owl_global_get_curs_typwin(g), typwin_lines, g->cols);
    175 
    176   wmove(owl_global_get_curs_typwin(g), 0, 0);
    177170}
    178171
     
    306299}
    307300
    308 WINDOW *owl_global_get_curs_typwin(const owl_global *g) {
    309   return panel_window(g->typpan);
     301owl_window *owl_global_get_curs_typwin(const owl_global *g) {
     302  return g->mainpanel.typwin;
    310303}
    311304
     
    361354      owl_function_resize_typwin(owl_global_get_typwin_lines(g) + d);
    362355
     356  if (g->typwin_erase_id) {
     357    g_signal_handler_disconnect(owl_global_get_curs_typwin(g), g->typwin_erase_id);
     358    g->typwin_erase_id = 0;
     359  }
     360
    363361  g->tw = owl_editwin_new(owl_global_get_curs_typwin(g),
    364362                          owl_global_get_typwin_lines(g),
     
    366364                          style,
    367365                          hist);
     366  owl_window_set_cursor(owl_global_get_curs_typwin(g));
    368367  return g->tw;
    369368}
     
    374373      owl_function_resize_typwin(owl_global_get_typwin_lines(g) - d);
    375374
    376   werase(owl_global_get_curs_typwin(g));
     375  if (!g->typwin_erase_id) {
     376    g->typwin_erase_id =
     377      g_signal_connect(owl_global_get_curs_typwin(g), "redraw", G_CALLBACK(owl_window_erase_cb), NULL);
     378  }
     379  owl_window_dirty(owl_global_get_curs_typwin(g));
     380  /* owl_window_set_cursor(owl_global_get_curs_sepwin(g)); */
     381
    377382  g->tw = NULL;
    378   owl_global_set_needrefresh(g);
    379383}
    380384
     
    494498
    495499  owl_function_debugmsg("New size is %i lines, %i cols.", g->lines, g->cols);
    496   owl_global_set_relayout_pending(g);
    497500}
    498501
     
    517520  owl_mainwin_redisplay(&(g->mw));
    518521  sepbar(NULL);
    519   if (g->tw)
    520       owl_editwin_redisplay(g->tw);
    521   else
    522     werase(owl_global_get_curs_typwin(g));
    523522
    524523  owl_function_full_redisplay();
Note: See TracChangeset for help on using the changeset viewer.