Changeset 2a17b63 for functions.c


Ignore:
Timestamp:
Jan 7, 2010, 6:54:15 PM (14 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.10, release-1.6, release-1.7, release-1.8, release-1.9
Children:
10557e6
Parents:
a999d9e
git-author:
Nelson Elhage <nelhage@mit.edu> (12/30/09 17:52:20)
git-committer:
Nelson Elhage <nelhage@mit.edu> (01/07/10 18:54:15)
Message:
Push and pop contexts whenever we change context.

This allows us to get rid of the awful hack in owl_process_input_char,
and opens the path to being able to invoke popup windows from the
editwin and vice versa (In fact, you can now do so without
segfaulting, although the display layer does not yet quite do the
right thing).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r8a2815b r2a17b63  
    301301  owl_editwin_set_cbdata(owl_global_get_typwin(&g), data);
    302302  owl_global_set_buffercallback(&g, callback);
     303  owl_global_push_context(&g, OWL_CTX_EDITMULTI, e, "editmulti");
    303304}
    304305
     
    13011302
    13021303  owl_popwin_up(pw);
     1304  owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless");
    13031305  owl_viewwin_init_text(v, owl_popwin_get_curswin(pw),
    13041306                        owl_popwin_get_lines(pw), owl_popwin_get_cols(pw),
     
    13181320
    13191321  owl_popwin_up(pw);
     1322  owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless");
    13201323  owl_viewwin_init_fmtext(v, owl_popwin_get_curswin(pw),
    13211324                   owl_popwin_get_lines(pw), owl_popwin_get_cols(pw),
     
    19401943  owl_editwin_redisplay(tw, 0);
    19411944
    1942   owl_context_set_editline(owl_global_get_context(&g), tw);
    1943   owl_function_activate_keymap("editline");
     1945  owl_global_push_context(&g, OWL_CTX_EDITLINE, tw, "editline");
    19441946}
    19451947
     
    19571959  owl_editwin_redisplay(tw, 0);
    19581960
    1959   owl_context_set_editresponse(owl_global_get_context(&g), tw);
    1960   owl_function_activate_keymap("editresponse");
     1961  owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editline");
    19611962}
    19621963
     
    19751976  owl_editwin_redisplay(tw, 0);
    19761977
    1977   owl_context_set_editresponse(owl_global_get_context(&g), tw);
    1978   owl_function_activate_keymap("editresponse");
     1978  owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse");
    19791979}
    19801980
     
    28302830  if (direction==0) {
    28312831    owl_list_append_element(fl, f);
    2832   }
    2833 }
    2834 
    2835 void owl_function_activate_keymap(const char *keymap)
    2836 {
    2837   if (!owl_keyhandler_activate(owl_global_get_keyhandler(&g), keymap)) {
    2838     owl_function_error("Unable to activate keymap '%s'", keymap);
    28392832  }
    28402833}
Note: See TracChangeset for help on using the changeset viewer.