Changeset b3adfb5


Ignore:
Timestamp:
Mar 2, 2010, 9:14:44 PM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.6, release-1.7, release-1.8, release-1.9
Children:
dffb8b8
Parents:
8099357
git-author:
David Benjamin <davidben@mit.edu> (02/27/10 17:08:00)
git-committer:
David Benjamin <davidben@mit.edu> (03/02/10 21:14:44)
Message:
Remove {rec,sep,msg,typ}win from owl_global

With libpanel, the WINDOWs are actually owned by the corresponding PANEL
object. To avoid confusion, we remove the pointers to them in the
owl_window altogether.

Signed-off-by: David Benjamin <davidben@mit.edu>
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • global.c

    rb928b3a rb3adfb5  
    134134{
    135135  WINDOW *oldwin;
     136
     137  if (win == NULL) {
     138    owl_function_debugmsg("_owl_panel_set_window: passed NULL win (failed to allocate?)\n");
     139    endwin();
     140    exit(50);
     141  }
     142
    136143  if (*pan) {
    137144    oldwin = panel_window(*pan);
     
    159166
    160167  /* create the new windows */
    161   g->recwin = newwin(g->recwinlines, cols, 0, 0);
    162   if (g->recwin==NULL) {
    163     owl_function_debugmsg("_owl_global_setup_windows: newwin returned NULL\n");
    164     endwin();
    165     exit(50);
    166   }
    167   _owl_panel_set_window(&g->recpan, g->recwin);
    168      
    169   g->sepwin = newwin(1, cols, g->recwinlines, 0);
    170   _owl_panel_set_window(&g->seppan, g->sepwin);
    171   g->msgwin = newwin(1, cols, g->recwinlines+1, 0);
    172   _owl_panel_set_window(&g->msgpan, g->msgwin);
    173   g->typwin = newwin(typwin_lines, cols, g->recwinlines+2, 0);
    174   _owl_panel_set_window(&g->typpan, g->typwin);
    175 
    176   owl_editwin_set_curswin(g->tw, g->typwin, typwin_lines, g->cols);
    177 
    178   idlok(g->typwin, FALSE);
    179   idlok(g->recwin, FALSE);
    180   idlok(g->sepwin, FALSE);
    181   idlok(g->msgwin, FALSE);
    182 
    183   nodelay(g->typwin, 1);
    184   keypad(g->typwin, TRUE);
    185   wmove(g->typwin, 0, 0);
    186 
    187   meta(g->typwin, TRUE);
     168  _owl_panel_set_window(&g->recpan, newwin(g->recwinlines, cols, 0, 0));
     169  _owl_panel_set_window(&g->seppan, newwin(1, cols, g->recwinlines, 0));
     170  _owl_panel_set_window(&g->msgpan, newwin(1, cols, g->recwinlines+1, 0));
     171  _owl_panel_set_window(&g->typpan, newwin(typwin_lines, cols, g->recwinlines+2, 0));
     172
     173  owl_editwin_set_curswin(g->tw, owl_global_get_curs_typwin(g), typwin_lines, g->cols);
     174
     175  idlok(owl_global_get_curs_typwin(g), FALSE);
     176  idlok(owl_global_get_curs_recwin(g), FALSE);
     177  idlok(owl_global_get_curs_sepwin(g), FALSE);
     178  idlok(owl_global_get_curs_msgwin(g), FALSE);
     179
     180  nodelay(owl_global_get_curs_typwin(g), 1);
     181  keypad(owl_global_get_curs_typwin(g), TRUE);
     182  wmove(owl_global_get_curs_typwin(g), 0, 0);
     183
     184  meta(owl_global_get_curs_typwin(g), TRUE);
    188185}
    189186
     
    306303
    307304WINDOW *owl_global_get_curs_recwin(const owl_global *g) {
    308   return(g->recwin);
     305  return panel_window(g->recpan);
    309306}
    310307
    311308WINDOW *owl_global_get_curs_sepwin(const owl_global *g) {
    312   return(g->sepwin);
     309  return panel_window(g->seppan);
    313310}
    314311
    315312WINDOW *owl_global_get_curs_msgwin(const owl_global *g) {
    316   return(g->msgwin);
     313  return panel_window(g->msgpan);
    317314}
    318315
    319316WINDOW *owl_global_get_curs_typwin(const owl_global *g) {
    320   return(g->typwin);
     317  return panel_window(g->typpan);
    321318}
    322319
  • owl.h

    r8ae2de9 rb3adfb5  
    557557  owl_view current_view;
    558558  owl_messagelist msglist;
    559   WINDOW *recwin, *sepwin, *msgwin, *typwin;
    560559  PANEL *recpan, *seppan, *msgpan, *typpan;
    561560  int needrefresh;
Note: See TracChangeset for help on using the changeset viewer.