Changeset 50031f0


Ignore:
Timestamp:
Jun 1, 2010, 12:25:27 AM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
402ed3d3
Parents:
933aa7d
git-author:
David Benjamin <davidben@mit.edu> (06/01/10 00:13:40)
git-committer:
David Benjamin <davidben@mit.edu> (06/01/10 00:25:27)
Message:
Rename map/unmap to hide/show to match GTK+

Also, the names make much more sense.
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • popwin.c

    rd106110 r50031f0  
    1414  owl_window_set_size_cb(pw->border, owl_popwin_size_border, 0, 0);
    1515  owl_window_set_size_cb(pw->content, owl_popwin_size_content, 0, 0);
    16   owl_window_map(pw->border, 1);
     16  owl_window_show(pw->border, 1);
    1717
    1818  pw->active=1;
  • window.c

    r933aa7d r50031f0  
    1111  int dirty : 1;
    1212  int dirty_subtree : 1;
    13   int mapped : 1;
     13  int shown : 1;
    1414  int is_screen : 1;
    1515  /* window information */
     
    6868  static owl_window *screen = NULL;
    6969  if (!screen) {
    70     /* The screen is magical. It's 'mapped', but the only mean of it going
     70    /* The screen is magical. It's 'shown', but the only mean of it going
    7171     * invisible is if we're tore down curses (i.e. screen resize) */
    7272    screen = _owl_window_new(NULL, g.lines, g.cols, 0, 0);
    7373    screen->is_screen = 1;
    7474    owl_window_set_size_cb(screen, _screen_calculate_size, &g, 0);
    75     owl_window_map(screen, 0);
     75    owl_window_show(screen, 0);
    7676  }
    7777  return screen;
     
    273273static void _map_recurse_curry(owl_window *w)
    274274{
    275   owl_window_map(w, 1);
    276 }
    277 
    278 void owl_window_map(owl_window *w, int recurse)
    279 {
    280   w->mapped = 1;
     275  owl_window_show(w, 1);
     276}
     277
     278void owl_window_show(owl_window *w, int recurse)
     279{
     280  w->shown = 1;
    281281  _owl_window_realize(w);
    282282  if (w->pan)
     
    286286}
    287287
    288 void owl_window_unmap(owl_window *w)
     288void owl_window_hide(owl_window *w)
    289289{
    290290  /* you can't unmap the screen */
    291291  if (w->is_screen)
    292292    return;
    293   w->mapped = 0;
     293  w->shown = 0;
    294294  if (w->pan)
    295295    hide_panel(w->pan);
     
    297297}
    298298
    299 int owl_window_is_mapped(owl_window *w)
    300 {
    301   return w->mapped;
     299int owl_window_is_shown(owl_window *w)
     300{
     301  return w->shown;
    302302}
    303303
     
    316316  /* check if we can create a window */
    317317  if ((w->parent && w->parent->win == NULL)
    318       || !w->mapped
     318      || !w->shown
    319319      || w->win != NULL)
    320320    return;
     
    414414  w->begin_y = begin_y;
    415415  w->begin_x = begin_x;
    416   if (w->mapped) {
    417     /* Window is mapped, we must try to have a window at the end */
     416  if (w->shown) {
     417    /* Window is shown, we must try to have a window at the end */
    418418    if (w->win) {
    419419      /* We actually do have a window; let's move it */
     
    453453  w->nlines = nlines;
    454454  w->ncols = ncols;
    455   /* window is mapped, we must try to have a window at the end */
    456   if (w->mapped) {
     455  /* window is shown, we must try to have a window at the end */
     456  if (w->shown) {
    457457    /* resizing in ncurses is hard: give up do a unrealize/realize */
    458458    _owl_window_unrealize(w);
     
    460460  /* recalculate children sizes BEFORE remapping, so that everything can resize */
    461461  owl_window_children_foreach_onearg(w, owl_window_recompute_position);
    462   if (w->mapped) {
     462  if (w->shown) {
    463463    _owl_window_realize(w);
    464464  }
  • window.h

    rce7c6c3 r50031f0  
    1919owl_window *owl_window_get_parent(owl_window *w);
    2020
    21 void owl_window_map(owl_window *w, int recurse);
    22 void owl_window_unmap(owl_window *w);
    23 int owl_window_is_mapped(owl_window *w);
     21void owl_window_show(owl_window *w, int recurse);
     22void owl_window_hide(owl_window *w);
     23int owl_window_is_shown(owl_window *w);
    2424int owl_window_is_realized(owl_window *w);
    2525int owl_window_is_toplevel(owl_window *w);
Note: See TracChangeset for help on using the changeset viewer.