Changeset 385fda9


Ignore:
Timestamp:
Jun 1, 2010, 9:54:19 PM (14 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.7, release-1.8, release-1.9
Children:
a5a9572
Parents:
f06baef
git-author:
David Benjamin <davidben@mit.edu> (06/01/10 21:48:25)
git-committer:
David Benjamin <davidben@mit.edu> (06/01/10 21:54:19)
Message:
A fairly hacky job of porting sepbar to owl_window

We now use the new framework, but the sepbar isn't being marked dirty at
the appropriate times. It'll want to be redone later to take advantage
of the new signals.

The 'in' parameter was also dropped. It was being unused. At best it
provided a strange bug when resizing with appendtosepbar set.

Also revert the attempt at cleaning up the cursor. We still have a hack,
but using owl_window. The cursor probably needs integration with the
context stack or some such.
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cmd.c

    r8d4b521 r385fda9  
    8989  if (argc < 0) {
    9090    owl_free(tmpbuff);
    91     sepbar(NULL);
     91    sepbar_dirty();
    9292    owl_function_makemsg("Unbalanced quotes");
    9393    return NULL;
     
    104104  owl_parse_delete(argv, argc);
    105105  owl_free(tmpbuff);
    106   sepbar(NULL);
     106  sepbar_dirty();
    107107  return retval;
    108108}
  • functions.c

    rd70f45f r385fda9  
    12481248}
    12491249
    1250 void owl_function_set_cursor(WINDOW *win)
    1251 {
    1252   /* Be careful that this window is actually empty, otherwise panels get confused */
    1253   if (is_wintouched(win)) {
    1254     owl_function_debugmsg("Warning: owl_function_set_cursor called on dirty window");
    1255     update_panels();
    1256   }
    1257   wnoutrefresh(win);
    1258 }
    1259 
    12601250void owl_function_full_redisplay(void)
    12611251{
    12621252  touchwin(owl_global_get_curs_recwin(&g));
    1263   touchwin(owl_global_get_curs_sepwin(&g));
    1264 
    1265   sepbar("");
     1253
     1254  sepbar_dirty();
    12661255
    12671256  owl_global_set_needrefresh(&g);
  • global.c

    r5b80b87 r385fda9  
    9898  owl_popwin_init(&(g->pw));
    9999  owl_msgwin_init(&(g->msgwin), g->mainpanel.msgwin);
     100  g_signal_connect(g->mainpanel.sepwin, "redraw", G_CALLBACK(sepbar_redraw), NULL);
    100101
    101102  g->aim_screenname=NULL;
     
    293294}
    294295
    295 WINDOW *owl_global_get_curs_sepwin(const owl_global *g) {
    296   return panel_window(g->seppan);
     296owl_window *owl_global_get_curs_sepwin(const owl_global *g) {
     297  return g->mainpanel.sepwin;
    297298}
    298299
     
    367368                          style,
    368369                          hist);
    369   owl_window_set_cursor(owl_global_get_curs_typwin(g));
    370370  return g->tw;
    371371}
     
    381381  }
    382382  owl_window_dirty(owl_global_get_curs_typwin(g));
    383   /* owl_window_set_cursor(owl_global_get_curs_sepwin(g)); */
    384383
    385384  g->tw = NULL;
     
    521520  /* refresh stuff */
    522521  owl_mainwin_redisplay(&(g->mw));
    523   sepbar(NULL);
     522  sepbar_dirty();
    524523
    525524  owl_function_full_redisplay();
  • owl.c

    rf6fae8d r385fda9  
    302302    /* this should be optimized to not run if the new messages won't be displayed */
    303303    owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    304     sepbar(NULL);
     304    sepbar_dirty();
    305305  }
    306306  return newmsgs;
     
    464464  if (owl_global_is_needrefresh(&g)) {
    465465    /* Redraw the screen */
    466     owl_window_redraw_scheduled();
    467 
    468     /* these are here in case a relayout changes the windows */
    469     WINDOW *sepwin = owl_global_get_curs_sepwin(&g);
    470 
    471     /* move the cursor to unmanaged window if necessary */
     466
     467    /* HACK: move the cursor to unmanaged window if necessary; these should be
     468     * associated with the context or something. */
    472469    if (!owl_popwin_is_active(owl_global_get_popwin(&g))
    473470        && owl_global_get_typwin(&g)) {
    474       /* owl_function_set_cursor(typwin); */
     471      owl_window_set_cursor(owl_global_get_curs_typwin(&g));
    475472    } else {
    476       owl_function_set_cursor(sepwin);
    477     }
     473      owl_window_set_cursor(owl_global_get_curs_sepwin(&g));
     474    }
     475
     476    owl_window_redraw_scheduled();
    478477    doupdate();
    479478    owl_global_set_noneedrefresh(&g);
     
    594593    "-----------------------------------------------------------------m-m---\n"
    595594  );
    596   sepbar(NULL);
    597595
    598596  /* process the startup file */
  • util.c

    r05ca0d8 r385fda9  
    1010#include <glib-object.h>
    1111
    12 void sepbar(const char *in)
    13 {
    14   WINDOW *sepwin;
     12void sepbar_dirty(void)
     13{
     14  owl_window_dirty(owl_global_get_curs_sepwin(&g));
     15}
     16
     17void sepbar_redraw(owl_window *w, WINDOW *sepwin, void *user_data)
     18{
    1519  const owl_messagelist *ml;
    1620  const owl_view *v;
     
    1822  const char *foo, *appendtosepbar;
    1923
    20   sepwin=owl_global_get_curs_sepwin(&g);
    2124  ml=owl_global_get_msglist(&g);
    2225  v=owl_global_get_current_view(&g);
     
    101104    wattroff(sepwin, A_BOLD);
    102105  }
    103  
    104   if (in) {
    105     getyx(sepwin, y, x);
    106     wmove(sepwin, y, x+2);
    107     waddstr(sepwin, in);
    108   }
    109106
    110107  appendtosepbar = owl_global_get_appendtosepbar(&g);
     
    122119  wattroff(sepwin, A_BOLD);
    123120  wattroff(sepwin, A_REVERSE);
    124   owl_global_set_needrefresh(&g);
    125121}
    126122
Note: See TracChangeset for help on using the changeset viewer.