/* * Interface wrapper code. * * Generated by SIP 4.12-snapshot-93040d2c716c * * Copyright: (c) 2010 by Total Control Software * License: wxWindows License */ #include "sipAPI_core.h" #line 107 "sip/gen/event.sip" #include #line 15 "sip_corewxEventBlocker.cpp" #line 36 "sip/gen/event.sip" #include #line 19 "sip_corewxEventBlocker.cpp" #line 129 "sip/gen/event.sip" #include #line 22 "sip_corewxEventBlocker.cpp" #line 17 "sip/gen/object.sip" #include #line 25 "sip_corewxEventBlocker.cpp" #line 40 "sip/gen/object.sip" #include #line 28 "sip_corewxEventBlocker.cpp" #line 84 "sip/gen/object.sip" #include #line 31 "sip_corewxEventBlocker.cpp" class sipwxEventBlocker : public wxEventBlocker { public: sipwxEventBlocker(wxWindow *,wxEventType); virtual ~sipwxEventBlocker(); /* * There is a protected method for every virtual method visible from * this class. */ protected: void QueueEvent(wxEvent *); void AddPendingEvent(const wxEvent&); bool ProcessEvent(wxEvent&); void SetNextHandler(wxEvtHandler *); void SetPreviousHandler(wxEvtHandler *); wxClassInfo * GetClassInfo(); public: sipSimpleWrapper *sipPySelf; private: sipwxEventBlocker(const sipwxEventBlocker &); sipwxEventBlocker &operator = (const sipwxEventBlocker &); char sipPyMethods[6]; }; sipwxEventBlocker::sipwxEventBlocker(wxWindow *win,wxEventType type): wxEventBlocker(win,type), sipPySelf(0) { memset(sipPyMethods, 0, sizeof (sipPyMethods)); } sipwxEventBlocker::~sipwxEventBlocker() { sipCommonDtor(sipPySelf); } void sipwxEventBlocker::QueueEvent(wxEvent *event) { sip_gilstate_t sipGILState; PyObject *sipMeth; sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,NULL,sipName_QueueEvent); if (!sipMeth) { wxEvtHandler::QueueEvent(event); return; } extern void sipVH__core_5(sip_gilstate_t,PyObject *,wxEvent *); sipVH__core_5(sipGILState,sipMeth,event); } void sipwxEventBlocker::AddPendingEvent(const wxEvent& event) { sip_gilstate_t sipGILState; PyObject *sipMeth; sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[1],sipPySelf,NULL,sipName_AddPendingEvent); if (!sipMeth) { wxEvtHandler::AddPendingEvent(event); return; } extern void sipVH__core_4(sip_gilstate_t,PyObject *,const wxEvent&); sipVH__core_4(sipGILState,sipMeth,event); } bool sipwxEventBlocker::ProcessEvent(wxEvent& event) { sip_gilstate_t sipGILState; PyObject *sipMeth; sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[2],sipPySelf,NULL,sipName_ProcessEvent); if (!sipMeth) return wxEvtHandler::ProcessEvent(event); extern bool sipVH__core_3(sip_gilstate_t,PyObject *,wxEvent&); return sipVH__core_3(sipGILState,sipMeth,event); } void sipwxEventBlocker::SetNextHandler(wxEvtHandler *handler) { sip_gilstate_t sipGILState; PyObject *sipMeth; sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[3],sipPySelf,NULL,sipName_SetNextHandler); if (!sipMeth) { wxEvtHandler::SetNextHandler(handler); return; } extern void sipVH__core_2(sip_gilstate_t,PyObject *,wxEvtHandler *); sipVH__core_2(sipGILState,sipMeth,handler); } void sipwxEventBlocker::SetPreviousHandler(wxEvtHandler *handler) { sip_gilstate_t sipGILState; PyObject *sipMeth; sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[4],sipPySelf,NULL,sipName_SetPreviousHandler); if (!sipMeth) { wxEvtHandler::SetPreviousHandler(handler); return; } extern void sipVH__core_2(sip_gilstate_t,PyObject *,wxEvtHandler *); sipVH__core_2(sipGILState,sipMeth,handler); } wxClassInfo * sipwxEventBlocker::GetClassInfo() { sip_gilstate_t sipGILState; PyObject *sipMeth; sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[5],sipPySelf,NULL,sipName_GetClassInfo); if (!sipMeth) return wxObject::GetClassInfo(); extern wxClassInfo * sipVH__core_6(sip_gilstate_t,PyObject *); return sipVH__core_6(sipGILState,sipMeth); } PyDoc_STRVAR(doc_wxEventBlocker_Block, "EventBlocker.Block(int)"); extern "C" {static PyObject *meth_wxEventBlocker_Block(PyObject *, PyObject *, PyObject *);} static PyObject *meth_wxEventBlocker_Block(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds) { PyObject *sipParseErr = NULL; { wxEventType eventType; wxEventBlocker *sipCpp; static const char *sipKwdList[] = { sipName_eventType, }; if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, NULL, "Bi", &sipSelf, sipType_wxEventBlocker, &sipCpp, &eventType)) { try { sipCpp->Block(eventType); } catch (...) { sipRaiseUnknownException(); return NULL; } Py_INCREF(Py_None); return Py_None; } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_EventBlocker, sipName_Block, doc_wxEventBlocker_Block); return NULL; } /* Cast a pointer to a type somewhere in its superclass hierarchy. */ extern "C" {static void *cast_wxEventBlocker(void *, const sipTypeDef *);} static void *cast_wxEventBlocker(void *ptr, const sipTypeDef *targetType) { void *res; if (targetType == sipType_wxEventBlocker) return ptr; if ((res = ((const sipClassTypeDef *)sipType_wxEvtHandler)->ctd_cast((wxEvtHandler *)(wxEventBlocker *)ptr,targetType)) != NULL) return res; return NULL; } /* Call the instance's destructor. */ extern "C" {static void release_wxEventBlocker(void *, int);} static void release_wxEventBlocker(void *sipCppV,int sipState) { if (sipState & SIP_DERIVED_CLASS) delete reinterpret_cast(sipCppV); else delete reinterpret_cast(sipCppV); } extern "C" {static void dealloc_wxEventBlocker(sipSimpleWrapper *);} static void dealloc_wxEventBlocker(sipSimpleWrapper *sipSelf) { if (sipIsDerived(sipSelf)) reinterpret_cast(sipGetAddress(sipSelf))->sipPySelf = NULL; if (sipIsPyOwned(sipSelf)) { release_wxEventBlocker(sipGetAddress(sipSelf),sipSelf->flags); } } extern "C" {static void *init_wxEventBlocker(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);} static void *init_wxEventBlocker(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr) { sipwxEventBlocker *sipCpp = 0; { wxWindow * win; wxEventType type = -1; static const char *sipKwdList[] = { sipName_win, sipName_type, }; if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J8|i", sipType_wxWindow, &win, &type)) { try { sipCpp = new sipwxEventBlocker(win,type); } catch (...) { sipRaiseUnknownException(); return NULL; } sipCpp->sipPySelf = sipSelf; return sipCpp; } } return NULL; } /* Define this type's super-types. */ static sipEncodedTypeDef supers_wxEventBlocker[] = {{23, 255, 1}}; static PyMethodDef methods_wxEventBlocker[] = { {SIP_MLNAME_CAST(sipName_Block), (PyCFunction)meth_wxEventBlocker_Block, METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxEventBlocker_Block)} }; PyDoc_STRVAR(doc_wxEventBlocker, "\1EventBlocker(Window, int type=-1)"); sipClassTypeDef sipTypeDef__core_wxEventBlocker = { { -1, 0, 0, SIP_TYPE_CLASS, sipNameNr_wxEventBlocker, {0} }, { sipNameNr_EventBlocker, {0, 0, 1}, 1, methods_wxEventBlocker, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, }, doc_wxEventBlocker, -1, -1, supers_wxEventBlocker, 0, init_wxEventBlocker, 0, 0, #if PY_MAJOR_VERSION >= 3 0, 0, #else 0, 0, 0, 0, #endif dealloc_wxEventBlocker, 0, 0, 0, release_wxEventBlocker, cast_wxEventBlocker, 0, 0, 0 };