Changeset 40d1eef for mainwin.c


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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.