aboutsummaryrefslogblamecommitdiffstats
path: root/lib/wx/api_gen/wx_extra/wxEvtHandler.c_src
blob: 4e492db045de7f0efa426dec099dc7a9e5afe890 (plain) (tree)

































































                                                                                      
case 98:  { // wxeEvtListener::wxeEvtListener
  wxeEvtListener *Result = new wxeEvtListener(Ecmd.port);
  rt.addRef(getRef((void *)Result,memenv), "wxeEvtListener");
  break;
}
case 99:  { // wxeEvtListener::destroy
  wxObject *This = (wxObject *) getPtr(bp,memenv); 
  rt.addAtom("ok");
  delete This; 
  break;
} 

case 100: { // wxEvtHandler::Connect 
  wxeEvtListener *Listener = (wxeEvtListener *) getPtr(bp,memenv); bp += 4;
  wxEvtHandler *This = (wxEvtHandler *) getPtr(bp, memenv); bp += 4;
  int * winid  = (int *) bp; bp += 4;
  int * lastId = (int *) bp; bp += 4;
  int * skip   = (int *) bp; bp += 4;
  int * haveUserData = (int *) bp; bp += 4;
  wxeErlTerm * userData = NULL;
  int * fun_cb = (int *) bp; bp += 4;
  int * eventTypeLen = (int *) bp; bp += 4;
  int * class_nameLen = (int *) bp; bp += 4;

  if(*haveUserData) {    
      userData = new wxeErlTerm(Ecmd.bin[0]);
  }

  int eventType = wxeEventTypeFromAtom(bp); bp += *eventTypeLen;
  char *class_name = bp; bp+= *class_nameLen;
  if(eventType > 0 ) {
     wxeCallbackData * Evt_cb = new wxeCallbackData(Ecmd.caller,(void *) This,
     		       	      	    		    class_name,*fun_cb, 
		                                    *skip, userData);
     This->Connect((int) *winid,(int) *lastId,eventType, 
	           (wxObjectEventFunction)(wxEventFunction) &wxeEvtListener::forward, 
	           Evt_cb, Listener);
     rt.addAtom("ok");
  } else {
    rt.addAtom("badarg");
    rt.addAtom("event_type");
    rt.addTupleCount(2);
  }
  break;
}
case 101: { // wxEvtHandler::Disconnect 
  wxeEvtListener *Listener = (wxeEvtListener *) getPtr(bp,memenv); bp += 4;
  wxEvtHandler *This = (wxEvtHandler *) getPtr(bp, memenv); bp += 4;
  int * winid  = (int *) bp; bp += 4;
  int * lastId = (int *) bp; bp += 4;
  int * eventTypeLen = (int *) bp; bp += 4;

  int eventType = wxeEventTypeFromAtom(bp); bp += *eventTypeLen;
  if(eventType > 0) {
     bool Result = This->Disconnect((int) *winid,(int) *lastId,eventType,
  				    (wxObjectEventFunction)(wxEventFunction) 
				    &wxeEvtListener::forward, 
				    NULL, Listener);
     rt.addBool(Result);
  } else {
    rt.addAtom("badarg");
    rt.addAtom("event_type");
    rt.addTupleCount(2);    
  }
  break;
}