Changeset 3dcccba


Ignore:
Timestamp:
Jul 7, 2008, 6:23:18 AM (9 years ago)
Author:
Geoffrey Thomas <geofft@mit.edu>
Branches:
barnowl_perlaim
Children:
61abb18
Parents:
7d63a6c
Message:
This would probably work, except it doesn't compile.
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r403198c r3dcccba  
    24702470void owl_command_editresponse_done(owl_editwin *e)
    24712471{
     2472  char *text = owl_strdup(owl_editwin_get_text(e));
     2473  void (*callback)(void *, char *) = owl_editwin_get_callback(e);
     2474  void *cbdata = owl_editwin_get_cbdata(e);
     2475
    24722476  owl_global_set_typwin_inactive(&g);
    24732477  owl_editwin_fullclear(e);
     
    24752479  owl_global_set_needrefresh(&g);
    24762480
    2477   owl_function_run_buffercommand();
     2481  callback(cbdata, text);
     2482  owl_free(text);
    24782483}
    24792484
     
    24862491  owl_history_reset(hist);
    24872492
    2488   owl_function_run_buffercommand();
     2493  owl_editwin_do_callback(e);
    24892494  owl_editwin_new_style(e, OWL_EDITWIN_STYLE_ONELINE, NULL);
    24902495  owl_editwin_fullclear(e);
  • editwin.c

    r2d4ff14 r3dcccba  
    9494}
    9595
    96 void owl_editwin_set_callback(owl_editwin *e, void (*cb)(owl_editwin*)) {
     96void owl_editwin_set_callback(owl_editwin *e, void (*cb)(void*, char*)) {
    9797  e->callback = cb;
    9898}
    9999
    100 void (*owl_editwin_get_callback(owl_editwin *e))(owl_editwin*) {
     100void (*owl_editwin_get_callback(owl_editwin*))(void *cbdata, char *text) {
    101101  return e->callback;
    102102}
     
    111111
    112112void owl_editwin_do_callback(owl_editwin *e) {
    113   void (*cb)(owl_editwin*);
     113  /* XXX get rid of me */
     114  void (*cb)(void*, char*);
    114115  cb=owl_editwin_get_callback(e);
    115116  if(!cb) {
     
    117118  } else {
    118119    /* owl_function_error("text: |%s|", owl_editwin_get_text(e)); */
    119     cb(e);
     120    cb(e->cbdata, e->text);
    120121  }
    121122}
  • functions.c

    rc453ada r3dcccba  
    11291129{
    11301130  owl_global_set_resize_pending(&g);
    1131 }
    1132 
    1133 void owl_function_run_buffercommand()
    1134 {
    1135   owl_editwin_do_callback(owl_global_get_typwin(&g));
    11361131}
    11371132
  • owl.h

    rc453ada r3dcccba  
    453453
    454454  char *command;
    455   void (*callback)(struct _owl_editwin*);
     455  void (*callback)(void *, char *);
    456456  void *cbdata;
    457457} owl_editwin;
  • perl/modules/AIM/lib/BarnOwl/Module/AIM.pm

    r7d63a6c r3dcccba  
    3737
    3838sub cmd_aimlogin {
    39 =comment
    4039    my ($cmd, $user, $pass) = @_;
    4140    if (!defined $user) {
     
    4847                });
    4948    } else {
    50 =cut
    51     {
    5249        my $oscar = Net::OSCAR->new();
    53         my ($user, $pass) = ('...', '...');
    5450        $oscar->set_callback_im_in(\&on_im_in);
    5551        $oscar->set_callback_signon_done(sub ($) {
  • perlconfig.c

    rdb0ac7e r3dcccba  
    472472}
    473473
    474 void owl_perlconfig_edit_callback(owl_editwin *e)
    475 {
    476   SV *cb = (SV*)(e->cbdata);
     474void owl_perlconfig_edit_callback(void *cbdata, char *c_text);
     475{
     476  SV *cb = (SV*)cbdata;
    477477  SV *text;
    478478  unsigned int n_a;
    479479  dSP;
    480480
     481  e->cbdata = NULL;
    481482  if(cb == NULL) {
    482483    owl_function_error("Perl callback is NULL!");
    483484  }
    484   text = newSVpv(owl_editwin_get_text(e), 0);
     485  text = newSVpv(c_text, 0);
    485486  SvUTF8_on(text);
    486487
     
    502503
    503504  SvREFCNT_dec(cb);
    504   e->cbdata = NULL;
    505505}
    506506
Note: See TracChangeset for help on using the changeset viewer.