Changeset 08263a8


Ignore:
Timestamp:
Sep 18, 2010, 5:07:39 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:
9190285
Parents:
cb81570
git-author:
David Benjamin <davidben@mit.edu> (08/07/10 16:31:45)
git-committer:
David Benjamin <davidben@mit.edu> (09/18/10 17:07:39)
Message:
Add owl_editwin_get_window

This removes the need for owl_global_get_typwin_window. The remaining
references within global.c may be accessed directly as its an internal
field anyway.
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • editwin.c

    ra8186dc r08263a8  
    177177    owl_window_dirty(e->win);
    178178  }
     179}
     180
     181owl_window *owl_editwin_get_window(owl_editwin *e)
     182{
     183  return e->win;
    179184}
    180185
  • functions.c

    r9eb38bb r08263a8  
    286286  owl_editwin_set_cbdata(e, data, cleanup);
    287287  owl_editwin_set_callback(e, callback);
    288   owl_global_push_context(&g, OWL_CTX_EDITMULTI, e, "editmulti", owl_global_get_typwin_window(&g));
     288  owl_global_push_context(&g, OWL_CTX_EDITMULTI, e, "editmulti", owl_editwin_get_window(e));
    289289}
    290290
     
    18881888  owl_editwin_insert_string(tw, line);
    18891889
    1890   owl_global_push_context(&g, OWL_CTX_EDITLINE, tw, "editline", owl_global_get_typwin_window(&g));
     1890  owl_global_push_context(&g, OWL_CTX_EDITLINE, tw, "editline", owl_editwin_get_window(tw));
    18911891  owl_editwin_set_callback(tw, owl_callback_command);
    18921892}
     
    19001900  owl_editwin_set_locktext(tw, line);
    19011901
    1902   owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse", owl_global_get_typwin_window(&g));
     1902  owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse", owl_editwin_get_window(tw));
    19031903  return tw;
    19041904}
     
    19141914  owl_editwin_set_locktext(tw, line);
    19151915
    1916   owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse", owl_global_get_typwin_window(&g));
     1916  owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse", owl_editwin_get_window(tw));
    19171917  return tw;
    19181918}
  • global.c

    rcb81570 r08263a8  
    282282}
    283283
    284 /* underlying owl_windows */
    285 
    286 owl_window *owl_global_get_typwin_window(const owl_global *g) {
    287   return g->mainpanel.typwin;
    288 }
    289 
    290 /* typwin */
    291 
    292284/* Gets the currently active typwin out of the current context. */
    293285owl_editwin *owl_global_current_typwin(const owl_global *g) {
     
    332324
    333325  if (g->typwin_erase_id) {
    334     g_signal_handler_disconnect(owl_global_get_typwin_window(g), g->typwin_erase_id);
     326    g_signal_handler_disconnect(g->mainpanel.typwin, g->typwin_erase_id);
    335327    g->typwin_erase_id = 0;
    336328  }
    337329
    338   g->tw = owl_editwin_new(owl_global_get_typwin_window(g),
     330  g->tw = owl_editwin_new(g->mainpanel.typwin,
    339331                          owl_global_get_typwin_lines(g),
    340332                          g->cols,
     
    351343  if (!g->typwin_erase_id) {
    352344    g->typwin_erase_id =
    353       g_signal_connect(owl_global_get_typwin_window(g), "redraw", G_CALLBACK(owl_window_erase_cb), NULL);
    354   }
    355   owl_window_dirty(owl_global_get_typwin_window(g));
     345      g_signal_connect(g->mainpanel.typwin, "redraw", G_CALLBACK(owl_window_erase_cb), NULL);
     346  }
     347  owl_window_dirty(g->mainpanel.typwin);
    356348
    357349  g->tw = NULL;
Note: See TracChangeset for help on using the changeset viewer.