Changes in mainwin.c [5cc7e5e:f449096]
Legend:
- Unmodified
- Added
- Removed
-
mainwin.c
r5cc7e5e rf449096 1 1 #include "owl.h" 2 2 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) 3 void owl_mainwin_init(owl_mainwin *mw) 7 4 { 8 5 mw->curtruncated=0; 9 6 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 a17 * 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 on28 * screen */29 owl_function_calculate_topmsg(OWL_DIRECTION_NONE);30 31 /* Schedule a redraw */32 owl_window_dirty(mw->window);33 7 } 34 8 35 9 void 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)41 10 { 42 11 owl_message *m; … … 44 13 int x, y, savey, recwinlines, start; 45 14 int topmsg, curmsg, markedmsgid, fgcolor, bgcolor; 15 WINDOW *recwin; 46 16 const owl_view *v; 47 17 GList *fl; 48 18 const owl_filter *f; 49 owl_mainwin *mw = user_data;50 19 20 recwin = owl_global_get_curs_recwin(&g); 51 21 topmsg = owl_global_get_topmsg(&g); 52 22 curmsg = owl_global_get_curmsg(&g); … … 73 43 mw->curtruncated=0; 74 44 mw->lastdisplayed=-1; 45 owl_global_set_needrefresh(&g); 75 46 return; 76 47 } … … 117 88 if (y+lines > recwinlines-1) { 118 89 isfull=1; 119 owl_message_curs_waddstr(m, recwin,90 owl_message_curs_waddstr(m, owl_global_get_curs_recwin(&g), 120 91 start, 121 92 start+recwinlines-y, … … 125 96 } else { 126 97 /* otherwise print the whole thing */ 127 owl_message_curs_waddstr(m, recwin,98 owl_message_curs_waddstr(m, owl_global_get_curs_recwin(&g), 128 99 start, 129 100 start+lines, … … 168 139 } 169 140 mw->lastdisplayed=i-1; 141 142 owl_global_set_needrefresh(&g); 170 143 } 171 144
Note: See TracChangeset
for help on using the changeset viewer.