Changeset 7803326 for editwin.c


Ignore:
Timestamp:
Sep 30, 2011, 8:07:53 AM (10 years ago)
Author:
Jason Gross <jgross@mit.edu>
Branches:
master, release-1.9
Children:
0c71c58, 5f784ec, 923c3f6, a962f5c, d953ede
Parents:
e89ec48
git-author:
Jason Gross <jgross@mit.edu> (06/23/11 23:58:21)
git-committer:
Jason Gross <jgross@mit.edu> (09/30/11 08:07:53)
Message:
editwin callback for canceling the editwin

The code for editwin callbacks (called when the editwin is created) has
been extended so that callbacks are called when the editwin is canceled.
The old (perl) editwin callbacks still exist and have the same
functionality that they always have.  They are now deprecated.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • editwin.c

    rf271129 r7803326  
    3333  oe_excursion *excursions;
    3434
    35   void (*callback)(struct _owl_editwin*);
     35  void (*callback)(struct _owl_editwin *e, bool success);
    3636  void (*destroy_cbdata)(void *);
    3737  void *cbdata;
     
    220220}
    221221
    222 void owl_editwin_set_callback(owl_editwin *e, void (*cb)(owl_editwin*))
     222void owl_editwin_set_callback(owl_editwin *e, void (*cb)(owl_editwin *, bool))
    223223{
    224224  e->callback = cb;
    225225}
    226226
    227 void (*owl_editwin_get_callback(owl_editwin *e))(owl_editwin*)
     227void (*owl_editwin_get_callback(owl_editwin *e))(owl_editwin *, bool)
    228228{
    229229  return e->callback;
     
    248248}
    249249
    250 void owl_editwin_do_callback(owl_editwin *e) {
    251   void (*cb)(owl_editwin*);
    252   cb=owl_editwin_get_callback(e);
    253   if(!cb) {
     250void owl_editwin_do_callback(owl_editwin *e, bool success)
     251{
     252  void (*cb)(owl_editwin *, bool);
     253  cb = owl_editwin_get_callback(e);
     254  if (!cb) {
    254255    owl_function_error("Internal error: No editwin callback!");
    255256  } else {
    256     /* owl_function_error("text: |%s|", owl_editwin_get_text(e)); */
    257     cb(e);
     257    cb(e, success);
    258258  }
    259259}
Note: See TracChangeset for help on using the changeset viewer.