Changeset 5b68c05 for viewwin.c


Ignore:
Timestamp:
Sep 18, 2010, 3:17:27 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
f7456bc
Parents:
449c682
git-author:
David Benjamin <davidben@mit.edu> (07/31/10 18:22:23)
git-committer:
David Benjamin <davidben@mit.edu> (09/18/10 15:17:27)
Message:
Update the viewwin when the global search string changes

This will want to be made less hacky when we have some notification
mechanism for all of owl_global's properties. Also, use the new
owl_viewwin_dirty in internal functions to avoid dirtying a NULL window.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • viewwin.c

    r449c682 r5b68c05  
    2828void owl_viewwin_append_text(owl_viewwin *v, const char *text) {
    2929    owl_fmtext_append_normal(&(v->fmtext), text);
    30     v->textlines=owl_fmtext_num_lines(&(v->fmtext)); 
     30    v->textlines=owl_fmtext_num_lines(&(v->fmtext));
     31    owl_viewwin_dirty(v);
     32}
     33
     34/* Schedule a redraw of 'v'. Exported for hooking into the search
     35   string; when we have some way of listening for changes, this can be
     36   removed. */
     37void owl_viewwin_dirty(owl_viewwin *v)
     38{
     39  if (v->window)
    3140    owl_window_dirty(v->window);
    3241}
     
    112121    v->topline = v->textlines - winlines + BOTTOM_OFFSET;
    113122  }
    114   owl_window_dirty(v->window);
     123  owl_viewwin_dirty(v);
    115124}
    116125
     
    123132    v->topline = v->textlines - winlines + BOTTOM_OFFSET;
    124133  }
    125   owl_window_dirty(v->window);
     134  owl_viewwin_dirty(v);
    126135}
    127136
     
    132141  v->topline-=winlines;
    133142  if (v->topline<0) v->topline=0;
    134   owl_window_dirty(v->window);
     143  owl_viewwin_dirty(v);
     144
    135145}
    136146
     
    139149  v->topline--;
    140150  if (v->topline<0) v->topline=0;
    141   owl_window_dirty(v->window);
     151  owl_viewwin_dirty(v);
    142152}
    143153
     
    145155{
    146156  v->rightshift+=n;
    147   owl_window_dirty(v->window);
     157  owl_viewwin_dirty(v);
    148158}
    149159
     
    152162  v->rightshift-=n;
    153163  if (v->rightshift<0) v->rightshift=0;
    154   owl_window_dirty(v->window);
     164  owl_viewwin_dirty(v);
    155165}
    156166
     
    159169  v->topline=0;
    160170  v->rightshift=0;
    161   owl_window_dirty(v->window);
     171  owl_viewwin_dirty(v);
    162172}
    163173
     
    167177  owl_window_get_position(v->window, &winlines, 0, 0, 0);
    168178  v->topline = v->textlines - winlines + BOTTOM_OFFSET;
    169   owl_window_dirty(v->window);
     179  owl_viewwin_dirty(v);
    170180}
    171181
Note: See TracChangeset for help on using the changeset viewer.