Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • mainwin.c

    r5cc7e5e rf449096  
    11#include "owl.h"
    22
    3 static void owl_mainwin_redraw(owl_window *w, WINDOW *recwin, void *user_data);
    4 static void owl_mainwin_resized(owl_window *w, void *user_data);
    5 
    6 void owl_mainwin_init(owl_mainwin *mw, owl_window *window)
     3void owl_mainwin_init(owl_mainwin *mw)
    74{
    85  mw->curtruncated=0;
    96  mw->lastdisplayed=-1;
    10   mw->window = g_object_ref(window);
    11   /* for now, just assume this object lasts forever */
    12   g_signal_connect(window, "redraw", G_CALLBACK(owl_mainwin_redraw), mw);
    13   g_signal_connect(window, "resized", G_CALLBACK(owl_mainwin_resized), mw);
    14   owl_window_dirty(window);
    15 
    16   /* For now, we do not bother with connecting up dependencies; that'll be a
    17    * future refactor of the mainwin */
    18 }
    19 
    20 static void owl_mainwin_resized(owl_window *w, void *user_data)
    21 {
    22   owl_mainwin *mw = user_data;
    23 
    24   /* in case any styles rely on the current width */
    25   owl_messagelist_invalidate_formats(owl_global_get_msglist(&g));
    26 
    27   /* recalculate the topmsg to make sure the current message is on
    28    * screen */
    29   owl_function_calculate_topmsg(OWL_DIRECTION_NONE);
    30 
    31   /* Schedule a redraw */
    32   owl_window_dirty(mw->window);
    337}
    348
    359void owl_mainwin_redisplay(owl_mainwin *mw)
    36 {
    37   owl_window_dirty(mw->window);
    38 }
    39 
    40 static void owl_mainwin_redraw(owl_window *w, WINDOW *recwin, void *user_data)
    4110{
    4211  owl_message *m;
     
    4413  int x, y, savey, recwinlines, start;
    4514  int topmsg, curmsg, markedmsgid, fgcolor, bgcolor;
     15  WINDOW *recwin;
    4616  const owl_view *v;
    4717  GList *fl;
    4818  const owl_filter *f;
    49   owl_mainwin *mw = user_data;
    5019
     20  recwin = owl_global_get_curs_recwin(&g);
    5121  topmsg = owl_global_get_topmsg(&g);
    5222  curmsg = owl_global_get_curmsg(&g);
     
    7343    mw->curtruncated=0;
    7444    mw->lastdisplayed=-1;
     45    owl_global_set_needrefresh(&g);
    7546    return;
    7647  }
     
    11788    if (y+lines > recwinlines-1) {
    11889      isfull=1;
    119       owl_message_curs_waddstr(m, recwin,
     90      owl_message_curs_waddstr(m, owl_global_get_curs_recwin(&g),
    12091                               start,
    12192                               start+recwinlines-y,
     
    12596    } else {
    12697      /* otherwise print the whole thing */
    127       owl_message_curs_waddstr(m, recwin,
     98      owl_message_curs_waddstr(m, owl_global_get_curs_recwin(&g),
    12899                               start,
    129100                               start+lines,
     
    168139  }
    169140  mw->lastdisplayed=i-1;
     141
     142  owl_global_set_needrefresh(&g);
    170143}
    171144
Note: See TracChangeset for help on using the changeset viewer.