Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    rd12a8c7 r8bba1ae  
    216216  /* redisplay etc. */
    217217  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    218   owl_global_set_needrefresh(&g);
    219218}
    220219
     
    293292  owl_editwin_set_cbdata(e, data, cleanup);
    294293  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));
    296295}
    297296
     
    808807{
    809808  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);
    812809}
    813810
     
    819816  if (shift > 0) {
    820817    owl_global_set_rightshift(&g, MAX(shift - 10, 0));
    821     owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    822     owl_global_set_needrefresh(&g);
    823818  } else {
    824819    owl_function_beep();
     
    12041199    return;
    12051200
    1206   file = owl_global_get_debug_file_handle(&g);
     1201  file = fopen(owl_global_get_debug_file(&g), "a");
    12071202  if (!file) /* XXX should report this */
    12081203    return;
     
    12141209  vfprintf(file, fmt, ap);
    12151210  putc('\n', file);
    1216   fflush(file);
     1211  fclose(file);
    12171212
    12181213  va_end(ap);
     
    12231218  if (owl_global_is_bell(&g)) {
    12241219    beep();
    1225     owl_global_set_needrefresh(&g); /* do we really need this? */
    12261220  }
    12271221}
     
    12521246}
    12531247
    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);
     1248static 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);
    12621253}
    12631254
    12641255void owl_function_full_redisplay(void)
    12651256{
    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());
    12751258}
    12761259
     
    12841267
    12851268  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);
    12921271}
    12931272
     
    13011280
    13021281  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);
    13091284}
    13101285
     
    15661541  /* redisplay */
    15671542  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    1568   owl_global_set_needrefresh(&g);
    15691543}
    15701544
     
    15721546{
    15731547  owl_global_set_typwin_lines(&g, newsize);
    1574   owl_global_set_relayout_pending(&g);
     1548  owl_mainpanel_layout_contents(&g.mainpanel);
    15751549}
    15761550
     
    16861660    }
    16871661    owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    1688     owl_global_set_needrefresh(&g);
    16891662  } else {
    16901663    owl_function_error("No message with id %d: unable to mark for (un)delete",id);
     
    17221695  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    17231696  owl_function_makemsg("%i messages marked for deletion", count);
    1724   owl_global_set_needrefresh(&g);
    17251697}
    17261698
     
    19271899
    19281900  owl_editwin_set_locktext(tw, "command: ");
    1929   owl_global_set_needrefresh(&g);
    19301901
    19311902  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));
    19351905  owl_editwin_set_callback(tw, owl_callback_command);
    19361906}
     
    19431913
    19441914  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));
    19501917  return tw;
    19511918}
     
    19601927
    19611928  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));
    19671931  return tw;
    19681932}
     
    19991963    pclose(p);
    20001964   
    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) {
    20041966      owl_free(newbuff);
    20051967      return out;
    20061968    } else if (type == OWL_OUTPUT_ADMINMSG) {
    20071969      owl_function_adminmsg(buff, out);
    2008     } else {
    2009       owl_function_popless_text(out);
    20101970    }
    20111971    owl_free(out);
     
    20402000    } else if (type == OWL_OUTPUT_RETURN) {
    20412001      return perlout;
    2042     } else {
    2043       owl_function_popless_text(perlout);
    20442002    }
    20452003    owl_free(perlout);
     
    21332091    }
    21342092    owl_filter_set_fgcolor(f, owl_util_string_to_color(argv[3]));
    2135     owl_global_set_needrefresh(&g);
    21362093    owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    21372094    return;
     
    21482105    }
    21492106    owl_filter_set_bgcolor(f, owl_util_string_to_color(argv[3]));
    2150     owl_global_set_needrefresh(&g);
    21512107    owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    21522108    return;
     
    21772133    owl_function_change_currentview_filter(argv[1]);
    21782134  }
    2179   owl_global_set_needrefresh(&g);
    21802135  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    21812136}
     
    25052460
    25062461  owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 
     2462}
     2463
     2464static 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;
    25072490}
    25082491
     
    25602543  if (owl_message_is_type_zephyr(m)) {
    25612544    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
    25622549      if (owl_message_is_direction_in(m)) {
    25632550        zperson=short_zuser(owl_message_get_sender(m));
     
    26892676  owl_filter_set_fgcolor(f, owl_util_string_to_color(fgcolor));
    26902677 
    2691   owl_global_set_needrefresh(&g);
    26922678  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    26932679  return(0);
     
    28532839    km = owl_keyhandler_get_keymap(kh, kmname);
    28542840    owl_fmtext_append_bold(&fm, "\n\n----------------------------------------------------------------------------------------------------\n\n");
    2855     owl_keymap_get_details(km, &fm);   
     2841    owl_keymap_get_details(km, &fm, 0);
    28562842  }
    28572843  owl_fmtext_append_normal(&fm, "\n");
     
    28792865  km = owl_keyhandler_get_keymap(owl_global_get_keyhandler(&g), name);
    28802866  if (km) {
    2881     owl_keymap_get_details(km, &fm);
     2867    owl_keymap_get_details(km, &fm, 1);
    28822868  } else {
    28832869    owl_fmtext_append_normal(&fm, "No such keymap...\n");
     
    34033389{
    34043390  va_list ap;
    3405   char buff[2048];
    3406 
    3407   if (!owl_global_get_curs_msgwin(&g)) return;
     3391  char *str;
    34083392
    34093393  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);
    34163395  va_end(ap);
     3396
     3397  owl_function_debugmsg("makemsg: %s", str);
     3398  owl_msgwin_set_text(&g.msgwin, str);
    34173399}
    34183400
Note: See TracChangeset for help on using the changeset viewer.