Changeset 40d1eef


Ignore:
Timestamp:
Jun 2, 2010, 8:53:27 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
fa65671
Parents:
a5a9572
git-author:
David Benjamin <davidben@mit.edu> (06/02/10 20:41:52)
git-committer:
David Benjamin <davidben@mit.edu> (06/02/10 20:53:27)
Message:
And a hacky port of the mainwin too

Some of the old relayout code should still be reorganized, but it's a
start.
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r385fda9 r40d1eef  
    12501250void owl_function_full_redisplay(void)
    12511251{
    1252   touchwin(owl_global_get_curs_recwin(&g));
    1253 
    1254   sepbar_dirty();
    1255 
    1256   owl_global_set_needrefresh(&g);
     1252  /* FIXME: this maybe should do something; dirty every window? */
    12571253}
    12581254
  • global.c

    r385fda9 r40d1eef  
    8282
    8383  owl_mainpanel_init(&(g->mainpanel));
    84   _owl_global_setup_windows(g);
    8584
    8685  /* Fill in some variables which don't have constant defaults */
     
    9594
    9695  owl_messagelist_create(&(g->msglist));
    97   owl_mainwin_init(&(g->mw));
     96  owl_mainwin_init(&(g->mw), g->mainpanel.recwin);
    9897  owl_popwin_init(&(g->pw));
    9998  owl_msgwin_init(&(g->msgwin), g->mainpanel.msgwin);
     
    159158    *pan = new_panel(win);
    160159  }
    161 }
    162 
    163 void _owl_global_setup_windows(owl_global *g) {
    164   int cols, recwinlines;
    165 
    166   cols=g->cols;
    167 
    168   recwinlines = owl_global_get_recwin_lines(g);
    169 
    170   /* create the new windows */
    171   _owl_panel_set_window(&g->recpan, newwin(recwinlines, cols, 0, 0));
    172   _owl_panel_set_window(&g->seppan, newwin(1, cols, recwinlines, 0));
    173160}
    174161
     
    289276
    290277/* curses windows */
    291 
    292 WINDOW *owl_global_get_curs_recwin(const owl_global *g) {
    293   return panel_window(g->recpan);
    294 }
    295278
    296279owl_window *owl_global_get_curs_sepwin(const owl_global *g) {
     
    508491  owl_function_debugmsg("Relayouting...");
    509492
    510   /* re-initialize the windows */
    511   _owl_global_setup_windows(g);
    512 
    513493  /* in case any styles rely on the current width */
    514494  owl_messagelist_invalidate_formats(owl_global_get_msglist(g));
  • mainwin.c

    rf449096 r40d1eef  
    11#include "owl.h"
    22
    3 void owl_mainwin_init(owl_mainwin *mw)
     3static void owl_mainwin_redraw(owl_window *w, WINDOW *recwin, void *user_data);
     4
     5void owl_mainwin_init(owl_mainwin *mw, owl_window *window)
    46{
    57  mw->curtruncated=0;
    68  mw->lastdisplayed=-1;
     9  mw->window = g_object_ref(window);
     10  g_signal_connect(window, "redraw", G_CALLBACK(owl_mainwin_redraw), mw);
    711}
    812
    913void owl_mainwin_redisplay(owl_mainwin *mw)
     14{
     15  owl_window_dirty(mw->window);
     16}
     17
     18static void owl_mainwin_redraw(owl_window *w, WINDOW *recwin, void *user_data)
    1019{
    1120  owl_message *m;
     
    1322  int x, y, savey, recwinlines, start;
    1423  int topmsg, curmsg, markedmsgid, fgcolor, bgcolor;
    15   WINDOW *recwin;
    1624  const owl_view *v;
    1725  GList *fl;
    1826  const owl_filter *f;
     27  owl_mainwin *mw = user_data;
    1928
    20   recwin = owl_global_get_curs_recwin(&g);
    2129  topmsg = owl_global_get_topmsg(&g);
    2230  curmsg = owl_global_get_curmsg(&g);
     
    8896    if (y+lines > recwinlines-1) {
    8997      isfull=1;
    90       owl_message_curs_waddstr(m, owl_global_get_curs_recwin(&g),
     98      owl_message_curs_waddstr(m, recwin,
    9199                               start,
    92100                               start+recwinlines-y,
     
    96104    } else {
    97105      /* otherwise print the whole thing */
    98       owl_message_curs_waddstr(m, owl_global_get_curs_recwin(&g),
     106      owl_message_curs_waddstr(m, recwin,
    99107                               start,
    100108                               start+lines,
     
    139147  }
    140148  mw->lastdisplayed=i-1;
    141 
    142   owl_global_set_needrefresh(&g);
    143149}
    144150
  • owl.h

    rf3a9d4d r40d1eef  
    396396  int lasttruncated;
    397397  int lastdisplayed;
     398  owl_window *window;
    398399} owl_mainwin;
    399400
     
    587588  owl_mainpanel mainpanel;
    588589  gulong typwin_erase_id;
    589   PANEL *recpan, *seppan;
    590590  int needrefresh;
    591591  int rightshift;
Note: See TracChangeset for help on using the changeset viewer.