Changeset 4a41f16


Ignore:
Timestamp:
Sep 18, 2010, 5:07:40 PM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
118c919
Parents:
1b8c3f8
git-author:
David Benjamin <davidben@mit.edu> (09/18/10 16:57:13)
git-committer:
David Benjamin <davidben@mit.edu> (09/18/10 17:07:40)
Message:
Pass deactivate_cb as argument to owl_editcontext_new
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • editcontext.c

    rc394de8 r4a41f16  
    88}
    99
    10 owl_context *owl_editcontext_new(int mode, owl_editwin *e, const char *keymap)
     10owl_context *owl_editcontext_new(int mode, owl_editwin *e, const char *keymap, void (*deactivate_cb)(owl_context*), void *cbdata)
    1111{
    1212  owl_context *ctx = owl_context_new(mode, owl_editwin_ref(e), keymap,
    1313                                     owl_editwin_get_window(e));
     14  ctx->deactivate_cb = deactivate_cb;
    1415  ctx->delete_cb = owl_editcontext_delete_cb;
     16  ctx->cbdata = cbdata;
    1517  /* TODO: the flags are really screwy. */
    1618  assert(owl_is_editcontext(ctx));
  • functions.c

    r9c1e61d r4a41f16  
    287287  owl_editwin_set_cbdata(e, data, cleanup);
    288288  owl_editwin_set_callback(e, callback);
    289   ctx = owl_editcontext_new(OWL_CTX_EDITMULTI, e, "editmulti");
    290   ctx->deactivate_cb = owl_global_deactivate_editcontext;
    291   ctx->cbdata = &g;
     289  ctx = owl_editcontext_new(OWL_CTX_EDITMULTI, e, "editmulti",
     290                            owl_global_deactivate_editcontext, &g);
    292291  owl_global_push_context_obj(&g, ctx);
    293292
     
    18941893  owl_editwin_insert_string(tw, line);
    18951894
    1896   ctx = owl_editcontext_new(OWL_CTX_EDITLINE, tw, "editline");
    1897   ctx->deactivate_cb = owl_global_deactivate_editcontext;
    1898   ctx->cbdata = &g;
     1895  ctx = owl_editcontext_new(OWL_CTX_EDITLINE, tw, "editline",
     1896                            owl_global_deactivate_editcontext, &g);
    18991897  owl_global_push_context_obj(&g, ctx);
    19001898  owl_editwin_set_callback(tw, owl_callback_command);
     
    19101908  owl_editwin_set_locktext(tw, line);
    19111909
    1912   ctx = owl_editcontext_new(OWL_CTX_EDITRESPONSE, tw, "editresponse");
    1913   ctx->deactivate_cb = owl_global_deactivate_editcontext;
    1914   ctx->cbdata = &g;
     1910  ctx = owl_editcontext_new(OWL_CTX_EDITRESPONSE, tw, "editresponse",
     1911                            owl_global_deactivate_editcontext, &g);
    19151912  owl_global_push_context_obj(&g, ctx);
    19161913  return tw;
     
    19281925  owl_editwin_set_locktext(tw, line);
    19291926
    1930   ctx = owl_editcontext_new(OWL_CTX_EDITRESPONSE, tw, "editresponse");
    1931   ctx->deactivate_cb = owl_global_deactivate_editcontext;
    1932   ctx->cbdata = &g;
     1927  ctx = owl_editcontext_new(OWL_CTX_EDITRESPONSE, tw, "editresponse",
     1928                            owl_global_deactivate_editcontext, &g);
    19331929  owl_global_push_context_obj(&g, ctx);
    19341930  return tw;
  • viewwin.c

    r1b8c3f8 r4a41f16  
    205205  data->direction = direction;
    206206
    207   ctx = owl_editcontext_new(OWL_CTX_EDITLINE, tw, "editline");
    208   ctx->deactivate_cb = owl_viewwin_deactivate_editcontext;
     207  ctx = owl_editcontext_new(OWL_CTX_EDITLINE, tw, "editline",
     208                            owl_viewwin_deactivate_editcontext, v);
    209209  ctx->cbdata = v;
    210210  owl_global_push_context_obj(&g, ctx);
     
    226226  owl_editwin_insert_string(tw, buff);
    227227
    228   ctx = owl_editcontext_new(OWL_CTX_EDITLINE, tw, "editline");
    229   ctx->deactivate_cb = owl_viewwin_deactivate_editcontext;
    230   ctx->cbdata = v;
     228  ctx = owl_editcontext_new(OWL_CTX_EDITLINE, tw, "editline",
     229                            owl_viewwin_deactivate_editcontext, v);
    231230  owl_global_push_context_obj(&g, ctx);
    232231  owl_editwin_set_callback(tw, owl_callback_command);
Note: See TracChangeset for help on using the changeset viewer.