Changes in functions.c [8bba1ae:d12a8c7]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r8bba1ae rd12a8c7 216 216 /* redisplay etc. */ 217 217 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 218 owl_global_set_needrefresh(&g); 218 219 } 219 220 … … 292 293 owl_editwin_set_cbdata(e, data, cleanup); 293 294 owl_editwin_set_callback(e, callback); 294 owl_global_push_context(&g, OWL_CTX_EDITMULTI, e, "editmulti" , owl_global_get_typwin_window(&g));295 owl_global_push_context(&g, OWL_CTX_EDITMULTI, e, "editmulti"); 295 296 } 296 297 … … 807 808 { 808 809 owl_global_set_rightshift(&g, owl_global_get_rightshift(&g)+10); 810 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 811 owl_global_set_needrefresh(&g); 809 812 } 810 813 … … 816 819 if (shift > 0) { 817 820 owl_global_set_rightshift(&g, MAX(shift - 10, 0)); 821 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 822 owl_global_set_needrefresh(&g); 818 823 } else { 819 824 owl_function_beep(); … … 1199 1204 return; 1200 1205 1201 file = fopen(owl_global_get_debug_file(&g), "a");1206 file = owl_global_get_debug_file_handle(&g); 1202 1207 if (!file) /* XXX should report this */ 1203 1208 return; … … 1209 1214 vfprintf(file, fmt, ap); 1210 1215 putc('\n', file); 1211 f close(file);1216 fflush(file); 1212 1217 1213 1218 va_end(ap); … … 1218 1223 if (owl_global_is_bell(&g)) { 1219 1224 beep(); 1225 owl_global_set_needrefresh(&g); /* do we really need this? */ 1220 1226 } 1221 1227 } … … 1246 1252 } 1247 1253 1248 static void _dirty_everything(owl_window *w) { 1249 if (!owl_window_is_realized(w)) 1250 return; 1251 owl_window_dirty(w); 1252 owl_window_children_foreach(w, (GFunc)_dirty_everything, NULL); 1254 void owl_function_set_cursor(WINDOW *win) 1255 { 1256 /* Be careful that this window is actually empty, otherwise panels get confused */ 1257 if (is_wintouched(win)) { 1258 owl_function_debugmsg("Warning: owl_function_set_cursor called on dirty window"); 1259 update_panels(); 1260 } 1261 wnoutrefresh(win); 1253 1262 } 1254 1263 1255 1264 void owl_function_full_redisplay(void) 1256 1265 { 1257 _dirty_everything(owl_window_get_screen()); 1266 touchwin(owl_global_get_curs_recwin(&g)); 1267 touchwin(owl_global_get_curs_sepwin(&g)); 1268 touchwin(owl_global_get_curs_typwin(&g)); 1269 touchwin(owl_global_get_curs_msgwin(&g)); 1270 1271 sepbar(""); 1272 owl_function_makemsg(""); 1273 1274 owl_global_set_needrefresh(&g); 1258 1275 } 1259 1276 … … 1267 1284 1268 1285 owl_popwin_up(pw); 1269 owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless", NULL); 1270 owl_viewwin_init_text(v, owl_popwin_get_content(pw), text); 1286 owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless"); 1287 owl_viewwin_init_text(v, owl_popwin_get_curswin(pw), 1288 owl_popwin_get_lines(pw), owl_popwin_get_cols(pw), 1289 text); 1290 owl_viewwin_redisplay(v); 1291 owl_global_set_needrefresh(&g); 1271 1292 } 1272 1293 … … 1280 1301 1281 1302 owl_popwin_up(pw); 1282 owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless", NULL); 1283 owl_viewwin_init_fmtext(v, owl_popwin_get_content(pw), fm); 1303 owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless"); 1304 owl_viewwin_init_fmtext(v, owl_popwin_get_curswin(pw), 1305 owl_popwin_get_lines(pw), owl_popwin_get_cols(pw), 1306 fm); 1307 owl_viewwin_redisplay(v); 1308 owl_global_set_needrefresh(&g); 1284 1309 } 1285 1310 … … 1541 1566 /* redisplay */ 1542 1567 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 1568 owl_global_set_needrefresh(&g); 1543 1569 } 1544 1570 … … 1546 1572 { 1547 1573 owl_global_set_typwin_lines(&g, newsize); 1548 owl_ mainpanel_layout_contents(&g.mainpanel);1574 owl_global_set_relayout_pending(&g); 1549 1575 } 1550 1576 … … 1660 1686 } 1661 1687 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 1688 owl_global_set_needrefresh(&g); 1662 1689 } else { 1663 1690 owl_function_error("No message with id %d: unable to mark for (un)delete",id); … … 1695 1722 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 1696 1723 owl_function_makemsg("%i messages marked for deletion", count); 1724 owl_global_set_needrefresh(&g); 1697 1725 } 1698 1726 … … 1899 1927 1900 1928 owl_editwin_set_locktext(tw, "command: "); 1929 owl_global_set_needrefresh(&g); 1901 1930 1902 1931 owl_editwin_insert_string(tw, line); 1903 1904 owl_global_push_context(&g, OWL_CTX_EDITLINE, tw, "editline", owl_global_get_typwin_window(&g)); 1932 owl_editwin_redisplay(tw); 1933 1934 owl_global_push_context(&g, OWL_CTX_EDITLINE, tw, "editline"); 1905 1935 owl_editwin_set_callback(tw, owl_callback_command); 1906 1936 } … … 1913 1943 1914 1944 owl_editwin_set_locktext(tw, line); 1915 1916 owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse", owl_global_get_typwin_window(&g)); 1945 owl_global_set_needrefresh(&g); 1946 1947 owl_editwin_redisplay(tw); 1948 1949 owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse"); 1917 1950 return tw; 1918 1951 } … … 1927 1960 1928 1961 owl_editwin_set_locktext(tw, line); 1929 1930 owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse", owl_global_get_typwin_window(&g)); 1962 owl_global_set_needrefresh(&g); 1963 1964 owl_editwin_redisplay(tw); 1965 1966 owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse"); 1931 1967 return tw; 1932 1968 } … … 1963 1999 pclose(p); 1964 2000 1965 if (type == OWL_OUTPUT_RETURN) { 2001 if (type == OWL_OUTPUT_POPUP) { 2002 owl_function_popless_text(out); 2003 } else if (type == OWL_OUTPUT_RETURN) { 1966 2004 owl_free(newbuff); 1967 2005 return out; 1968 2006 } else if (type == OWL_OUTPUT_ADMINMSG) { 1969 2007 owl_function_adminmsg(buff, out); 2008 } else { 2009 owl_function_popless_text(out); 1970 2010 } 1971 2011 owl_free(out); … … 2000 2040 } else if (type == OWL_OUTPUT_RETURN) { 2001 2041 return perlout; 2042 } else { 2043 owl_function_popless_text(perlout); 2002 2044 } 2003 2045 owl_free(perlout); … … 2091 2133 } 2092 2134 owl_filter_set_fgcolor(f, owl_util_string_to_color(argv[3])); 2135 owl_global_set_needrefresh(&g); 2093 2136 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2094 2137 return; … … 2105 2148 } 2106 2149 owl_filter_set_bgcolor(f, owl_util_string_to_color(argv[3])); 2150 owl_global_set_needrefresh(&g); 2107 2151 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2108 2152 return; … … 2133 2177 owl_function_change_currentview_filter(argv[1]); 2134 2178 } 2179 owl_global_set_needrefresh(&g); 2135 2180 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2136 2181 } … … 2460 2505 2461 2506 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2462 }2463 2464 static char *owl_function_smartfilter_cc(const owl_message *m) {2465 const char *ccs;2466 char *filtname;2467 char *text;2468 owl_filter *f;2469 2470 ccs = owl_message_get_attribute_value(m, "zephyr_ccs");2471 2472 filtname = owl_sprintf("conversation-%s", ccs);2473 owl_text_tr(filtname, ' ', '-');2474 2475 if (owl_global_get_filter(&g, filtname)) {2476 return filtname;2477 }2478 2479 text = owl_sprintf("type ^zephyr$ and filter personal and "2480 "zephyr_ccs ^%s%s%s$",2481 owl_getquoting(ccs), ccs, owl_getquoting(ccs));2482 2483 f = owl_filter_new_fromstring(filtname, text);2484 2485 owl_global_add_filter(&g, f);2486 2487 owl_free(text);2488 2489 return filtname;2490 2507 } 2491 2508 … … 2543 2560 if (owl_message_is_type_zephyr(m)) { 2544 2561 if (owl_message_is_personal(m) || owl_message_is_loginout(m)) { 2545 if (owl_message_get_attribute_value(m, "zephyr_ccs") != NULL) {2546 return owl_function_smartfilter_cc(m);2547 }2548 2549 2562 if (owl_message_is_direction_in(m)) { 2550 2563 zperson=short_zuser(owl_message_get_sender(m)); … … 2676 2689 owl_filter_set_fgcolor(f, owl_util_string_to_color(fgcolor)); 2677 2690 2691 owl_global_set_needrefresh(&g); 2678 2692 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2679 2693 return(0); … … 2839 2853 km = owl_keyhandler_get_keymap(kh, kmname); 2840 2854 owl_fmtext_append_bold(&fm, "\n\n----------------------------------------------------------------------------------------------------\n\n"); 2841 owl_keymap_get_details(km, &fm , 0);2855 owl_keymap_get_details(km, &fm); 2842 2856 } 2843 2857 owl_fmtext_append_normal(&fm, "\n"); … … 2865 2879 km = owl_keyhandler_get_keymap(owl_global_get_keyhandler(&g), name); 2866 2880 if (km) { 2867 owl_keymap_get_details(km, &fm , 1);2881 owl_keymap_get_details(km, &fm); 2868 2882 } else { 2869 2883 owl_fmtext_append_normal(&fm, "No such keymap...\n"); … … 3389 3403 { 3390 3404 va_list ap; 3391 char *str; 3405 char buff[2048]; 3406 3407 if (!owl_global_get_curs_msgwin(&g)) return; 3392 3408 3393 3409 va_start(ap, fmt); 3394 str = g_strdup_vprintf(fmt, ap); 3410 werase(owl_global_get_curs_msgwin(&g)); 3411 3412 vsnprintf(buff, 2048, fmt, ap); 3413 owl_function_debugmsg("makemsg: %s", buff); 3414 waddstr(owl_global_get_curs_msgwin(&g), buff); 3415 owl_global_set_needrefresh(&g); 3395 3416 va_end(ap); 3396 3397 owl_function_debugmsg("makemsg: %s", str);3398 owl_msgwin_set_text(&g.msgwin, str);3399 3417 } 3400 3418
Note: See TracChangeset
for help on using the changeset viewer.