Changes in functions.c [d12a8c7:8bba1ae]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
rd12a8c7 r8bba1ae 216 216 /* redisplay etc. */ 217 217 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 218 owl_global_set_needrefresh(&g);219 218 } 220 219 … … 293 292 owl_editwin_set_cbdata(e, data, cleanup); 294 293 owl_editwin_set_callback(e, callback); 295 owl_global_push_context(&g, OWL_CTX_EDITMULTI, e, "editmulti" );294 owl_global_push_context(&g, OWL_CTX_EDITMULTI, e, "editmulti", owl_global_get_typwin_window(&g)); 296 295 } 297 296 … … 808 807 { 809 808 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);812 809 } 813 810 … … 819 816 if (shift > 0) { 820 817 owl_global_set_rightshift(&g, MAX(shift - 10, 0)); 821 owl_mainwin_redisplay(owl_global_get_mainwin(&g));822 owl_global_set_needrefresh(&g);823 818 } else { 824 819 owl_function_beep(); … … 1204 1199 return; 1205 1200 1206 file = owl_global_get_debug_file_handle(&g);1201 file = fopen(owl_global_get_debug_file(&g), "a"); 1207 1202 if (!file) /* XXX should report this */ 1208 1203 return; … … 1214 1209 vfprintf(file, fmt, ap); 1215 1210 putc('\n', file); 1216 f flush(file);1211 fclose(file); 1217 1212 1218 1213 va_end(ap); … … 1223 1218 if (owl_global_is_bell(&g)) { 1224 1219 beep(); 1225 owl_global_set_needrefresh(&g); /* do we really need this? */1226 1220 } 1227 1221 } … … 1252 1246 } 1253 1247 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); 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); 1262 1253 } 1263 1254 1264 1255 void owl_function_full_redisplay(void) 1265 1256 { 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); 1257 _dirty_everything(owl_window_get_screen()); 1275 1258 } 1276 1259 … … 1284 1267 1285 1268 owl_popwin_up(pw); 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); 1269 owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless", NULL); 1270 owl_viewwin_init_text(v, owl_popwin_get_content(pw), text); 1292 1271 } 1293 1272 … … 1301 1280 1302 1281 owl_popwin_up(pw); 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); 1282 owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless", NULL); 1283 owl_viewwin_init_fmtext(v, owl_popwin_get_content(pw), fm); 1309 1284 } 1310 1285 … … 1566 1541 /* redisplay */ 1567 1542 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 1568 owl_global_set_needrefresh(&g);1569 1543 } 1570 1544 … … 1572 1546 { 1573 1547 owl_global_set_typwin_lines(&g, newsize); 1574 owl_ global_set_relayout_pending(&g);1548 owl_mainpanel_layout_contents(&g.mainpanel); 1575 1549 } 1576 1550 … … 1686 1660 } 1687 1661 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 1688 owl_global_set_needrefresh(&g);1689 1662 } else { 1690 1663 owl_function_error("No message with id %d: unable to mark for (un)delete",id); … … 1722 1695 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 1723 1696 owl_function_makemsg("%i messages marked for deletion", count); 1724 owl_global_set_needrefresh(&g);1725 1697 } 1726 1698 … … 1927 1899 1928 1900 owl_editwin_set_locktext(tw, "command: "); 1929 owl_global_set_needrefresh(&g);1930 1901 1931 1902 owl_editwin_insert_string(tw, line); 1932 owl_editwin_redisplay(tw); 1933 1934 owl_global_push_context(&g, OWL_CTX_EDITLINE, tw, "editline"); 1903 1904 owl_global_push_context(&g, OWL_CTX_EDITLINE, tw, "editline", owl_global_get_typwin_window(&g)); 1935 1905 owl_editwin_set_callback(tw, owl_callback_command); 1936 1906 } … … 1943 1913 1944 1914 owl_editwin_set_locktext(tw, line); 1945 owl_global_set_needrefresh(&g); 1946 1947 owl_editwin_redisplay(tw); 1948 1949 owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse"); 1915 1916 owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse", owl_global_get_typwin_window(&g)); 1950 1917 return tw; 1951 1918 } … … 1960 1927 1961 1928 owl_editwin_set_locktext(tw, line); 1962 owl_global_set_needrefresh(&g); 1963 1964 owl_editwin_redisplay(tw); 1965 1966 owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse"); 1929 1930 owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse", owl_global_get_typwin_window(&g)); 1967 1931 return tw; 1968 1932 } … … 1999 1963 pclose(p); 2000 1964 2001 if (type == OWL_OUTPUT_POPUP) { 2002 owl_function_popless_text(out); 2003 } else if (type == OWL_OUTPUT_RETURN) { 1965 if (type == OWL_OUTPUT_RETURN) { 2004 1966 owl_free(newbuff); 2005 1967 return out; 2006 1968 } else if (type == OWL_OUTPUT_ADMINMSG) { 2007 1969 owl_function_adminmsg(buff, out); 2008 } else {2009 owl_function_popless_text(out);2010 1970 } 2011 1971 owl_free(out); … … 2040 2000 } else if (type == OWL_OUTPUT_RETURN) { 2041 2001 return perlout; 2042 } else {2043 owl_function_popless_text(perlout);2044 2002 } 2045 2003 owl_free(perlout); … … 2133 2091 } 2134 2092 owl_filter_set_fgcolor(f, owl_util_string_to_color(argv[3])); 2135 owl_global_set_needrefresh(&g);2136 2093 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2137 2094 return; … … 2148 2105 } 2149 2106 owl_filter_set_bgcolor(f, owl_util_string_to_color(argv[3])); 2150 owl_global_set_needrefresh(&g);2151 2107 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2152 2108 return; … … 2177 2133 owl_function_change_currentview_filter(argv[1]); 2178 2134 } 2179 owl_global_set_needrefresh(&g);2180 2135 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2181 2136 } … … 2505 2460 2506 2461 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; 2507 2490 } 2508 2491 … … 2560 2543 if (owl_message_is_type_zephyr(m)) { 2561 2544 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 2562 2549 if (owl_message_is_direction_in(m)) { 2563 2550 zperson=short_zuser(owl_message_get_sender(m)); … … 2689 2676 owl_filter_set_fgcolor(f, owl_util_string_to_color(fgcolor)); 2690 2677 2691 owl_global_set_needrefresh(&g);2692 2678 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2693 2679 return(0); … … 2853 2839 km = owl_keyhandler_get_keymap(kh, kmname); 2854 2840 owl_fmtext_append_bold(&fm, "\n\n----------------------------------------------------------------------------------------------------\n\n"); 2855 owl_keymap_get_details(km, &fm );2841 owl_keymap_get_details(km, &fm, 0); 2856 2842 } 2857 2843 owl_fmtext_append_normal(&fm, "\n"); … … 2879 2865 km = owl_keyhandler_get_keymap(owl_global_get_keyhandler(&g), name); 2880 2866 if (km) { 2881 owl_keymap_get_details(km, &fm );2867 owl_keymap_get_details(km, &fm, 1); 2882 2868 } else { 2883 2869 owl_fmtext_append_normal(&fm, "No such keymap...\n"); … … 3403 3389 { 3404 3390 va_list ap; 3405 char buff[2048]; 3406 3407 if (!owl_global_get_curs_msgwin(&g)) return; 3391 char *str; 3408 3392 3409 3393 va_start(ap, fmt); 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); 3394 str = g_strdup_vprintf(fmt, ap); 3416 3395 va_end(ap); 3396 3397 owl_function_debugmsg("makemsg: %s", str); 3398 owl_msgwin_set_text(&g.msgwin, str); 3417 3399 } 3418 3400
Note: See TracChangeset
for help on using the changeset viewer.