aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/api_gen/wx_extra/wxEvtHandler.c_src
blob: 4e492db045de7f0efa426dec099dc7a9e5afe890 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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;
}