Exemple #1
0
void send_msg(const char * type, wxString * msg) {
  wxeReturn rt = wxeReturn(WXE_DRV_PORT, init_caller);
  rt.addAtom((char *) "wxe_driver");
  rt.addAtom((char *) type);
  rt.add(msg);  
  rt.addTupleCount(3);
  rt.send();
}
Exemple #2
0
void WxeApp::clearPtr(void * ptr) {
  ptrMap::iterator it;
  it = ptr2ref.find(ptr);

  if(it != ptr2ref.end()) {
    wxeRefData *refd = it->second;
    intList free = refd->memenv->free;
    int ref = refd->ref;    
    refd->memenv->ref2ptr[ref] = NULL;
    free.Append(ref);

    if(wxe_debug) {
      wxString msg;
      msg.Printf(wxT("Deleting {wx_ref, %d, unknown} at %p "), ref, ptr);
      send_msg("debug", &msg);
    }
    
    if(((int) refd->pid) != -1) {
      // Send terminate pid to owner
      wxeReturn rt = wxeReturn(WXE_DRV_PORT,refd->memenv->owner, false);
      rt.addAtom("_wxe_destroy_");
      rt.add(ERL_DRV_PID, refd->pid);
      rt.addTupleCount(2);
      rt.send();
      refd->pid = -1;
    };
    if(refd->type == 1 && ((wxObject*)ptr)->IsKindOf(CLASSINFO(wxSizer))) {
      wxSizerItemList list = ((wxSizer*)ptr)->GetChildren();
      for(wxSizerItemList::compatibility_iterator node = list.GetFirst();
	  node; node = node->GetNext()) { 
	wxSizerItem *item = node->GetData();
	wxObject *content=NULL;
	if((content = item->GetWindow())) 
	  if(ptr2ref.end() == ptr2ref.find(content)) {
	    wxString msg;
	    wxClassInfo *cinfo = ((wxObject *)ptr)->GetClassInfo();
	    msg.Printf(wxT("Double usage detected of window at %p in sizer {wx_ref, %d, %s}"),
		       content, ref, cinfo->GetClassName());
	    send_msg("error", &msg);
	    ((wxSizer*)ptr)->Detach((wxWindow*)content);	    
	  }
	if((content = item->GetSizer())) 
	  if(ptr2ref.end() == ptr2ref.find(content)) {
	    wxString msg;
	    wxClassInfo *cinfo = ((wxObject *)ptr)->GetClassInfo();
	    msg.Printf(wxT("Double usage detected of sizer at %p in sizer {wx_ref, %d, %s}"),
		       content, ref, cinfo->GetClassName());
	    send_msg("error", &msg);
	    ((wxSizer*)ptr)->Detach((wxSizer*)content);	
	  }
      }
    }
    
    delete refd;
    ptr2ref.erase(it);
  }
}
Exemple #3
0
int wxCALLBACK wxEListCtrlCompare(long item1, long item2, long callbackInfoPtr)
{
  callbackInfo * cb = (callbackInfo *)callbackInfoPtr;
  wxeMemEnv * memenv =  ((WxeApp *) wxTheApp)->getMemEnv(cb->port);
  char * bp = ((WxeApp *) wxTheApp)->cb_buff;
  
  wxeReturn rt = wxeReturn(WXE_DRV_PORT, memenv->owner, false);
  rt.addInt(cb->callbackID);
  rt.addInt(item1);
  rt.addInt(item2);
  rt.endList(2);
  rt.addAtom("_wx_invoke_cb_");
  rt.addTupleCount(3);
  rt.send();
  handle_callback_batch(cb->port);
  return *(int*) bp;
}
Exemple #4
0
wxeCallbackData::~wxeCallbackData() {
  // fprintf(stderr, "CBD Deleteing %p %s\r\n", this, class_name); fflush(stderr);
  if(user_data) {
    delete user_data;
  }
  ptrMap::iterator it;
  it = ((WxeApp *)wxTheApp)->ptr2ref.find(handler);
  if(it != ((WxeApp *)wxTheApp)->ptr2ref.end()) {
    wxeRefData *refd = it->second;
    wxeReturn rt = wxeReturn(WXE_DRV_PORT, refd->memenv->owner, false);
    rt.addAtom("wx_delete_cb");
    rt.addInt(fun_id);
    rt.addRef(refd->ref, "wxeEvtListener");
    rt.addRef(obj, class_name);
    rt.addTupleCount(4);
    rt.send();
  }
}
Exemple #5
0
int wxCALLBACK wxEListCtrlCompare(long item1, long item2, long callbackInfoPtr)
{
  callbackInfo * cb = (callbackInfo *)callbackInfoPtr;
  wxeMemEnv * memenv =  ((WxeApp *) wxTheApp)->getMemEnv(cb->port);
  wxeReturn rt = wxeReturn(WXE_DRV_PORT, memenv->owner, false);
  rt.addInt(cb->callbackID);
  rt.addInt(item1);
  rt.addInt(item2);
  rt.endList(2);
  rt.addAtom("_wx_invoke_cb_");
  rt.addTupleCount(3);
  rt.send();
  handle_event_callback(WXE_DRV_PORT_HANDLE, memenv->owner);

  if(((WxeApp *) wxTheApp)->cb_buff) {
    int res = * (int*) ((WxeApp *) wxTheApp)->cb_buff;
    driver_free(((WxeApp *) wxTheApp)->cb_buff);
    ((WxeApp *) wxTheApp)->cb_buff = NULL;
    return res;
  }
  return 0;
}
Exemple #6
0
void WxeApp::init_nonconsts(wxeMemEnv *memenv, ErlDrvTermData caller) {
  wxeReturn rt = wxeReturn(WXE_DRV_PORT, caller);
 rt.addAtom((char*)"wx_consts");
 rt.addAtom("wxALWAYS_NATIVE_DOUBLE_BUFFER"); rt.addInt(wxALWAYS_NATIVE_DOUBLE_BUFFER);
 rt.addTupleCount(2);
 rt.addAtom("wxBYTE_ORDER"); rt.addInt(wxBYTE_ORDER);
 rt.addTupleCount(2);
 rt.addAtom("wxDEFAULT_CONTROL_BORDER"); rt.addInt(wxDEFAULT_CONTROL_BORDER);
 rt.addTupleCount(2);
 rt.addAtom("wxHAS_INT64"); rt.addInt(wxHAS_INT64);
 rt.addTupleCount(2);
 rt.addAtom("wxRETAINED"); rt.addInt(wxRETAINED);
 rt.addTupleCount(2);
 rt.addAtom("wxGAUGE_EMULATE_INDETERMINATE_MODE"); rt.addInt(wxGAUGE_EMULATE_INDETERMINATE_MODE);
 rt.addTupleCount(2);
 rt.addAtom("wxSL_LABELS"); rt.addInt(wxSL_LABELS);
 rt.addTupleCount(2);
 rt.addAtom("wxTR_DEFAULT_STYLE"); rt.addInt(wxTR_DEFAULT_STYLE);
 rt.addTupleCount(2);
 rt.addAtom("wxBETA_NUMBER"); rt.addInt(wxBETA_NUMBER);
 rt.addTupleCount(2);
 rt.addAtom("wxMAJOR_VERSION"); rt.addInt(wxMAJOR_VERSION);
 rt.addTupleCount(2);
 rt.addAtom("wxMINOR_VERSION"); rt.addInt(wxMINOR_VERSION);
 rt.addTupleCount(2);
 rt.addAtom("wxRELEASE_NUMBER"); rt.addInt(wxRELEASE_NUMBER);
 rt.addTupleCount(2);
 rt.addAtom("wxSUBRELEASE_NUMBER"); rt.addInt(wxSUBRELEASE_NUMBER);
 rt.addTupleCount(2);
 rt.addAtom("wxFONTENCODING_UTF16"); rt.addInt(wxFONTENCODING_UTF16);
 rt.addTupleCount(2);
 rt.addAtom("wxFONTENCODING_UTF32"); rt.addInt(wxFONTENCODING_UTF32);
 rt.addTupleCount(2);
 rt.addAtom("wxMOD_CMD"); rt.addInt(wxMOD_CMD);
 rt.addTupleCount(2);
   rt.addAtom("wxBLACK"); rt.add(*(wxBLACK));
   rt.addTupleCount(2);
   rt.addAtom("wxBLACK_BRUSH"); rt.addRef(getRef((void *)wxBLACK_BRUSH,memenv),"wxBrush");
   rt.addTupleCount(2);
   rt.addAtom("wxBLACK_DASHED_PEN"); rt.addRef(getRef((void *)wxBLACK_DASHED_PEN,memenv),"wxPen");
   rt.addTupleCount(2);
   rt.addAtom("wxBLACK_PEN"); rt.addRef(getRef((void *)wxBLACK_PEN,memenv),"wxPen");
   rt.addTupleCount(2);
   rt.addAtom("wxBLUE"); rt.add(*(wxBLUE));
   rt.addTupleCount(2);
   rt.addAtom("wxBLUE_BRUSH"); rt.addRef(getRef((void *)wxBLUE_BRUSH,memenv),"wxBrush");
   rt.addTupleCount(2);
   rt.addAtom("wxCROSS_CURSOR"); rt.addRef(getRef((void *)wxCROSS_CURSOR,memenv),"wxCursor");
   rt.addTupleCount(2);
   rt.addAtom("wxCYAN"); rt.add(*(wxCYAN));
   rt.addTupleCount(2);
   rt.addAtom("wxCYAN_BRUSH"); rt.addRef(getRef((void *)wxCYAN_BRUSH,memenv),"wxBrush");
   rt.addTupleCount(2);
   rt.addAtom("wxCYAN_PEN"); rt.addRef(getRef((void *)wxCYAN_PEN,memenv),"wxPen");
   rt.addTupleCount(2);
   rt.addAtom("wxGREEN"); rt.add(*(wxGREEN));
   rt.addTupleCount(2);
   rt.addAtom("wxGREEN_BRUSH"); rt.addRef(getRef((void *)wxGREEN_BRUSH,memenv),"wxBrush");
   rt.addTupleCount(2);
   rt.addAtom("wxGREEN_PEN"); rt.addRef(getRef((void *)wxGREEN_PEN,memenv),"wxPen");
   rt.addTupleCount(2);
   rt.addAtom("wxGREY_BRUSH"); rt.addRef(getRef((void *)wxGREY_BRUSH,memenv),"wxBrush");
   rt.addTupleCount(2);
   rt.addAtom("wxGREY_PEN"); rt.addRef(getRef((void *)wxGREY_PEN,memenv),"wxPen");
   rt.addTupleCount(2);
   rt.addAtom("wxHOURGLASS_CURSOR"); rt.addRef(getRef((void *)wxHOURGLASS_CURSOR,memenv),"wxCursor");
   rt.addTupleCount(2);
   rt.addAtom("wxITALIC_FONT"); rt.addRef(getRef((void *)wxITALIC_FONT,memenv),"wxFont");
   rt.addTupleCount(2);
   rt.addAtom("wxLIGHT_GREY"); rt.add(*(wxLIGHT_GREY));
   rt.addTupleCount(2);
   rt.addAtom("wxLIGHT_GREY_BRUSH"); rt.addRef(getRef((void *)wxLIGHT_GREY_BRUSH,memenv),"wxBrush");
   rt.addTupleCount(2);
   rt.addAtom("wxLIGHT_GREY_PEN"); rt.addRef(getRef((void *)wxLIGHT_GREY_PEN,memenv),"wxPen");
   rt.addTupleCount(2);
   rt.addAtom("wxMEDIUM_GREY_BRUSH"); rt.addRef(getRef((void *)wxMEDIUM_GREY_BRUSH,memenv),"wxBrush");
   rt.addTupleCount(2);
   rt.addAtom("wxMEDIUM_GREY_PEN"); rt.addRef(getRef((void *)wxMEDIUM_GREY_PEN,memenv),"wxPen");
   rt.addTupleCount(2);
   rt.addAtom("wxNORMAL_FONT"); rt.addRef(getRef((void *)wxNORMAL_FONT,memenv),"wxFont");
   rt.addTupleCount(2);
   rt.addAtom("wxNullBitmap"); rt.addRef(getRef((void *)&wxNullBitmap,memenv), "wxBitmap");
   rt.addTupleCount(2);
   rt.addAtom("wxNullBrush"); rt.addRef(getRef((void *)&wxNullBrush,memenv), "wxBrush");
   rt.addTupleCount(2);
   rt.addAtom("wxNullCursor"); rt.addRef(getRef((void *)&wxNullCursor,memenv), "wxCursor");
   rt.addTupleCount(2);
   rt.addAtom("wxNullFont"); rt.addRef(getRef((void *)&wxNullFont,memenv), "wxFont");
   rt.addTupleCount(2);
   rt.addAtom("wxNullIcon"); rt.addRef(getRef((void *)&wxNullIcon,memenv), "wxIcon");
   rt.addTupleCount(2);
   rt.addAtom("wxNullPalette"); rt.addRef(getRef((void *)&wxNullPalette,memenv), "wxPalette");
   rt.addTupleCount(2);
   rt.addAtom("wxNullPen"); rt.addRef(getRef((void *)&wxNullPen,memenv), "wxPen");
   rt.addTupleCount(2);
   rt.addAtom("wxRED"); rt.add(*(wxRED));
   rt.addTupleCount(2);
   rt.addAtom("wxRED_BRUSH"); rt.addRef(getRef((void *)wxRED_BRUSH,memenv),"wxBrush");
   rt.addTupleCount(2);
   rt.addAtom("wxRED_PEN"); rt.addRef(getRef((void *)wxRED_PEN,memenv),"wxPen");
   rt.addTupleCount(2);
   rt.addAtom("wxSMALL_FONT"); rt.addRef(getRef((void *)wxSMALL_FONT,memenv),"wxFont");
   rt.addTupleCount(2);
   rt.addAtom("wxSTANDARD_CURSOR"); rt.addRef(getRef((void *)wxSTANDARD_CURSOR,memenv),"wxCursor");
   rt.addTupleCount(2);
   rt.addAtom("wxSWISS_FONT"); rt.addRef(getRef((void *)wxSWISS_FONT,memenv),"wxFont");
   rt.addTupleCount(2);
   rt.addAtom("wxTRANSPARENT_BRUSH"); rt.addRef(getRef((void *)wxTRANSPARENT_BRUSH,memenv),"wxBrush");
   rt.addTupleCount(2);
   rt.addAtom("wxTRANSPARENT_PEN"); rt.addRef(getRef((void *)wxTRANSPARENT_PEN,memenv),"wxPen");
   rt.addTupleCount(2);
   rt.addAtom("wxWHITE"); rt.add(*(wxWHITE));
   rt.addTupleCount(2);
   rt.addAtom("wxWHITE_BRUSH"); rt.addRef(getRef((void *)wxWHITE_BRUSH,memenv),"wxBrush");
   rt.addTupleCount(2);
   rt.addAtom("wxWHITE_PEN"); rt.addRef(getRef((void *)wxWHITE_PEN,memenv),"wxPen");
   rt.addTupleCount(2);
 rt.endList(57);
 rt.addTupleCount(2);
  rt.send();
}
Exemple #7
0
bool sendevent(wxEvent *event, ErlDrvPort port)
{
 int send_res ;
 char * evClass = NULL;
 wxMBConvUTF32 UTFconverter;
 wxeEtype *Etype = etmap[event->GetEventType()];
 wxeCallbackData *cb = (wxeCallbackData *)event->m_callbackUserData;
 WxeApp * app = (WxeApp *) wxTheApp;
 wxeMemEnv *memenv = app->getMemEnv(port);
 if(!memenv) return 0;

 wxeReturn rt = wxeReturn(port, cb->listener);

 rt.addAtom((char*)"wx");
 rt.addInt((int) event->GetId());
 rt.addRef(getRef((void *)(cb->obj), memenv), cb->class_name);
 rt.addExt2Term(cb->user_data);
 switch(Etype->cID) {
case 163: {// wxCommandEvent
 wxCommandEvent * ev = (wxCommandEvent *) event;
    evClass = (char*)"wxCommandEvent";
    rt.addAtom((char*)"wxCommand");
    rt.addAtom(Etype->eName);
 rt.add(ev->GetString());
 rt.addInt(ev->GetInt());
 rt.addInt(ev->GetExtraLong());
    rt.addTupleCount(5);
  break;
}
case 164: {// wxScrollEvent or wxSpinEvent
  if(event->IsKindOf(CLASSINFO(wxScrollEvent))) {
 wxScrollEvent * ev = (wxScrollEvent *) event;
    evClass = (char*)"wxScrollEvent";
    rt.addAtom((char*)"wxScroll");
    rt.addAtom(Etype->eName);
 rt.addInt(ev->GetInt());
 rt.addInt(ev->GetExtraLong());
    rt.addTupleCount(4);
  } else {
    Etype = etmap[event->GetEventType() + wxEVT_USER_FIRST];
 wxSpinEvent * ev = (wxSpinEvent *) event;
    evClass = (char*)"wxSpinEvent";
    rt.addAtom((char*)"wxSpin");
    rt.addAtom(Etype->eName);
 rt.addInt(ev->GetInt());
    rt.addTupleCount(3);
  }
  break;
}
case 165: {// wxScrollWinEvent
    evClass = (char*)"wxScrollWinEvent";
    rt.addAtom((char*)"wxScrollWin");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 166: {// wxMouseEvent
 wxMouseEvent * ev = (wxMouseEvent *) event;
    evClass = (char*)"wxMouseEvent";
    rt.addAtom((char*)"wxMouse");
    rt.addAtom(Etype->eName);
 rt.addInt(ev->m_x);
 rt.addInt(ev->m_y);
 rt.addBool(ev->m_leftDown);
 rt.addBool(ev->m_middleDown);
 rt.addBool(ev->m_rightDown);
 rt.addBool(ev->m_controlDown);
 rt.addBool(ev->m_shiftDown);
 rt.addBool(ev->m_altDown);
 rt.addBool(ev->m_metaDown);
 rt.addInt(ev->m_wheelRotation);
 rt.addInt(ev->m_wheelDelta);
 rt.addInt(ev->m_linesPerAction);
    rt.addTupleCount(14);
  break;
}
case 167: {// wxSetCursorEvent
    evClass = (char*)"wxSetCursorEvent";
    rt.addAtom((char*)"wxSetCursor");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 168: {// wxKeyEvent
 wxKeyEvent * ev = (wxKeyEvent *) event;
    evClass = (char*)"wxKeyEvent";
    rt.addAtom((char*)"wxKey");
    rt.addAtom(Etype->eName);
 rt.addInt(ev->m_x);
 rt.addInt(ev->m_y);
 rt.addInt(ev->m_keyCode);
 rt.addBool(ev->m_controlDown);
 rt.addBool(ev->m_shiftDown);
 rt.addBool(ev->m_altDown);
 rt.addBool(ev->m_metaDown);
 rt.addBool(ev->m_scanCode);
 rt.addInt(ev->m_uniChar);
 rt.addUint(ev->m_rawCode);
 rt.addUint(ev->m_rawFlags);
    rt.addTupleCount(13);
  break;
}
case 169: {// wxSizeEvent
 wxSizeEvent * ev = (wxSizeEvent *) event;
    evClass = (char*)"wxSizeEvent";
    rt.addAtom((char*)"wxSize");
    rt.addAtom(Etype->eName);
 rt.add(ev->m_size);
 rt.add(ev->m_rect);
    rt.addTupleCount(4);
  break;
}
case 170: {// wxMoveEvent
    evClass = (char*)"wxMoveEvent";
    rt.addAtom((char*)"wxMove");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 171: {// wxPaintEvent
    evClass = (char*)"wxPaintEvent";
    rt.addAtom((char*)"wxPaint");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 172: {// wxNcPaintEvent
    evClass = (char*)"wxNcPaintEvent";
    rt.addAtom((char*)"wxNcPaint");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 173: {// wxEraseEvent
 wxEraseEvent * ev = (wxEraseEvent *) event;
 wxDC * GetDC = ev->GetDC();
    evClass = (char*)"wxEraseEvent";
    rt.addAtom((char*)"wxErase");
    rt.addAtom(Etype->eName);
 rt.addRef(getRef((void *)GetDC,memenv), "wxDC");
    rt.addTupleCount(3);
  break;
}
case 174: {// wxFocusEvent
    evClass = (char*)"wxFocusEvent";
    rt.addAtom((char*)"wxFocus");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 175: {// wxChildFocusEvent
    evClass = (char*)"wxChildFocusEvent";
    rt.addAtom((char*)"wxChildFocus");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 176: {// wxMenuEvent
    evClass = (char*)"wxMenuEvent";
    rt.addAtom((char*)"wxMenu");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 177: {// wxCloseEvent
    evClass = (char*)"wxCloseEvent";
    rt.addAtom((char*)"wxClose");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 178: {// wxShowEvent
    evClass = (char*)"wxShowEvent";
    rt.addAtom((char*)"wxShow");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 179: {// wxIconizeEvent
    evClass = (char*)"wxIconizeEvent";
    rt.addAtom((char*)"wxIconize");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 180: {// wxMaximizeEvent
    evClass = (char*)"wxMaximizeEvent";
    rt.addAtom((char*)"wxMaximize");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 181: {// wxJoystickEvent
    evClass = (char*)"wxJoystickEvent";
    rt.addAtom((char*)"wxJoystick");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 182: {// wxUpdateUIEvent
    evClass = (char*)"wxUpdateUIEvent";
    rt.addAtom((char*)"wxUpdateUI");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 183: {// wxSysColourChangedEvent
    evClass = (char*)"wxSysColourChangedEvent";
    rt.addAtom((char*)"wxSysColourChanged");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 184: {// wxMouseCaptureChangedEvent
    evClass = (char*)"wxMouseCaptureChangedEvent";
    rt.addAtom((char*)"wxMouseCaptureChanged");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 185: {// wxDisplayChangedEvent
    evClass = (char*)"wxDisplayChangedEvent";
    rt.addAtom((char*)"wxDisplayChanged");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 186: {// wxPaletteChangedEvent
    evClass = (char*)"wxPaletteChangedEvent";
    rt.addAtom((char*)"wxPaletteChanged");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 187: {// wxQueryNewPaletteEvent
    evClass = (char*)"wxQueryNewPaletteEvent";
    rt.addAtom((char*)"wxQueryNewPalette");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 188: {// wxNavigationKeyEvent
 wxNavigationKeyEvent * ev = (wxNavigationKeyEvent *) event;
    evClass = (char*)"wxNavigationKeyEvent";
    rt.addAtom((char*)"wxNavigationKey");
    rt.addAtom(Etype->eName);
 rt.addInt(ev->m_flags);
 rt.addRef(getRef((void *)ev->m_focus,memenv), "wxWindow");
    rt.addTupleCount(4);
  break;
}
case 189: {// wxWindowCreateEvent
    evClass = (char*)"wxWindowCreateEvent";
    rt.addAtom((char*)"wxWindowCreate");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 190: {// wxWindowDestroyEvent
    evClass = (char*)"wxWindowDestroyEvent";
    rt.addAtom((char*)"wxWindowDestroy");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 191: {// wxHelpEvent
    evClass = (char*)"wxHelpEvent";
    rt.addAtom((char*)"wxHelp");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 192: {// wxContextMenuEvent
    evClass = (char*)"wxContextMenuEvent";
    rt.addAtom((char*)"wxContextMenu");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 193: {// wxIdleEvent
    evClass = (char*)"wxIdleEvent";
    rt.addAtom((char*)"wxIdle");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 194: {// wxGridEvent
 wxGridEvent * ev = (wxGridEvent *) event;
    evClass = (char*)"wxGridEvent";
    rt.addAtom((char*)"wxGrid");
    rt.addAtom(Etype->eName);
 rt.addInt(ev->GetRow());
 rt.addInt(ev->GetCol());
 rt.addInt(ev->GetPosition().x);
 rt.addInt(ev->GetPosition().y);
 rt.addBool(ev->Selecting());
 rt.addBool(ev->ControlDown());
 rt.addBool(ev->MetaDown());
 rt.addBool(ev->ShiftDown());
 rt.addBool(ev->AltDown());
    rt.addTupleCount(11);
  break;
}
case 196: {// wxSashEvent
 wxSashEvent * ev = (wxSashEvent *) event;
    evClass = (char*)"wxSashEvent";
    rt.addAtom((char*)"wxSash");
    rt.addAtom(Etype->eName);
 rt.addInt(ev->GetEdge());
 rt.add(ev->GetDragRect());
 rt.addInt(ev->GetDragStatus());
    rt.addTupleCount(5);
  break;
}
case 197: {// wxListEvent
 wxListEvent * ev = (wxListEvent *) event;
    evClass = (char*)"wxListEvent";
    rt.addAtom((char*)"wxList");
    rt.addAtom(Etype->eName);
 rt.addInt(ev->GetKeyCode());
 rt.addInt(ev->m_oldItemIndex);
 rt.addInt(ev->GetIndex());
 rt.addInt(ev->m_col);
 rt.add(ev->GetPoint());
    rt.addTupleCount(7);
  break;
}
case 198: {// wxDateEvent
 wxDateEvent * ev = (wxDateEvent *) event;
    evClass = (char*)"wxDateEvent";
    rt.addAtom((char*)"wxDate");
    rt.addAtom(Etype->eName);
 rt.add(ev->GetDate());
    rt.addTupleCount(3);
  break;
}
case 199: {// wxCalendarEvent
    evClass = (char*)"wxCalendarEvent";
    rt.addAtom((char*)"wxCalendar");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 200: {// wxFileDirPickerEvent
 wxFileDirPickerEvent * ev = (wxFileDirPickerEvent *) event;
    evClass = (char*)"wxFileDirPickerEvent";
    rt.addAtom((char*)"wxFileDirPicker");
    rt.addAtom(Etype->eName);
 rt.add(ev->GetPath());
    rt.addTupleCount(3);
  break;
}
case 201: {// wxColourPickerEvent
 wxColourPickerEvent * ev = (wxColourPickerEvent *) event;
    evClass = (char*)"wxColourPickerEvent";
    rt.addAtom((char*)"wxColourPicker");
    rt.addAtom(Etype->eName);
 rt.add(ev->GetColour());
    rt.addTupleCount(3);
  break;
}
case 202: {// wxFontPickerEvent
 wxFontPickerEvent * ev = (wxFontPickerEvent *) event;
 wxFont * GetFont = new wxFont(ev->GetFont());
 app->newPtr((void *) GetFont,3, memenv);
    evClass = (char*)"wxFontPickerEvent";
    rt.addAtom((char*)"wxFontPicker");
    rt.addAtom(Etype->eName);
 rt.addRef(getRef((void *)GetFont,memenv), "wxFont");
    rt.addTupleCount(3);
  break;
}
case 203: {// wxStyledTextEvent
 wxStyledTextEvent * ev = (wxStyledTextEvent *) event;
    evClass = (char*)"wxStyledTextEvent";
    rt.addAtom((char*)"wxStyledText");
    rt.addAtom(Etype->eName);
 rt.addInt(ev->GetPosition());
 rt.addInt(ev->GetKey());
 rt.addInt(ev->GetModifiers());
 rt.addInt(ev->GetModificationType());
 rt.add(ev->GetText());
 rt.addInt(ev->GetLength());
 rt.addInt(ev->GetLinesAdded());
 rt.addInt(ev->GetLine());
 rt.addInt(ev->GetFoldLevelNow());
 rt.addInt(ev->GetFoldLevelPrev());
 rt.addInt(ev->GetMargin());
 rt.addInt(ev->GetMessage());
 rt.addInt(ev->GetWParam());
 rt.addInt(ev->GetLParam());
 rt.addInt(ev->GetListType());
 rt.addInt(ev->GetX());
 rt.addInt(ev->GetY());
 rt.add(ev->GetDragText());
 rt.addBool(ev->GetDragAllowMove());
 rt.addInt(ev->GetDragResult());
    rt.addTupleCount(22);
  break;
}
case 208: {// wxTreeEvent
 wxTreeEvent * ev = (wxTreeEvent *) event;
    evClass = (char*)"wxTreeEvent";
    rt.addAtom((char*)"wxTree");
    rt.addAtom(Etype->eName);
 rt.addRef(getRef((void *)ev->GetItem().m_pItem,memenv), "wxTreeItemId");
 rt.addRef(getRef((void *)ev->GetOldItem().m_pItem,memenv), "wxTreeItemId");
 rt.add(ev->GetPoint());
    rt.addTupleCount(5);
  break;
}
case 209: {// wxNotebookEvent
    evClass = (char*)"wxNotebookEvent";
    rt.addAtom((char*)"wxNotebook");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 215: {// wxSpinEvent
 wxSpinEvent * ev = (wxSpinEvent *) event;
    evClass = (char*)"wxSpinEvent";
    rt.addAtom((char*)"wxSpin");
    rt.addAtom(Etype->eName);
 rt.addInt(ev->GetInt());
    rt.addTupleCount(3);
  break;
}
case 217: {// wxSplitterEvent
    evClass = (char*)"wxSplitterEvent";
    rt.addAtom((char*)"wxSplitter");
    rt.addAtom(Etype->eName);
    rt.addTupleCount(2);
  break;
}
case 219: {// wxHtmlLinkEvent
 wxHtmlLinkEvent * ev = (wxHtmlLinkEvent *) event;
    evClass = (char*)"wxHtmlLinkEvent";
    rt.addAtom((char*)"wxHtmlLink");
    rt.addAtom(Etype->eName);
 rt.add(ev->GetLinkInfo());
    rt.addTupleCount(3);
  break;
}
case 220: {// wxAuiNotebookEvent
 wxAuiNotebookEvent * ev = (wxAuiNotebookEvent *) event;
 wxAuiNotebook * GetDragSource = ev->GetDragSource();
    evClass = (char*)"wxAuiNotebookEvent";
    rt.addAtom((char*)"wxAuiNotebook");
    rt.addAtom(Etype->eName);
 rt.addInt(ev->GetOldSelection());
 rt.addInt(ev->GetSelection());
 rt.addRef(getRef((void *)GetDragSource,memenv), "wxAuiNotebook");
    rt.addTupleCount(5);
  break;
}
case 221: {// wxAuiManagerEvent
 wxAuiManagerEvent * ev = (wxAuiManagerEvent *) event;
 wxAuiManager * GetManager = ev->GetManager();
 wxAuiPaneInfo * GetPane = ev->GetPane();
 wxDC * GetDC = ev->GetDC();
    evClass = (char*)"wxAuiManagerEvent";
    rt.addAtom((char*)"wxAuiManager");
    rt.addAtom(Etype->eName);
 rt.addRef(getRef((void *)GetManager,memenv), "wxAuiManager");
 rt.addRef(getRef((void *)GetPane,memenv), "wxAuiPaneInfo");
 rt.addInt(ev->GetButton());
 rt.addBool(ev->veto_flag);
 rt.addBool(ev->canveto_flag);
 rt.addRef(getRef((void *)GetDC,memenv), "wxDC");
    rt.addTupleCount(8);
  break;
}
 }

 rt.addTupleCount(5);
 if(cb->fun_id) {
   rt.addRef(getRef((void *)event,memenv), evClass);
   rt.addTupleCount(2);
   rt.addInt(cb->fun_id);
   rt.addAtom("_wx_invoke_cb_");
   rt.addTupleCount(3);
   pre_callback();
   send_res =  rt.send();
   if(send_res) handle_event_callback(port, cb->listener);
   app->clearPtr((void *) event);
 } else {
   send_res =  rt.send();
   if(cb->skip) event->Skip();
 };
 return send_res;
 }