Skip to content

Instantly share code, notes, and snippets.

@kevinw
Created January 13, 2011 18:51
Show Gist options
  • Save kevinw/778381 to your computer and use it in GitHub Desktop.
Save kevinw/778381 to your computer and use it in GitHub Desktop.
/*
* Interface wrapper code.
*
* Generated by SIP 4.8-snapshot-20090409 *
*
* copyright 2008 Kevin Watters
* released under the wxWidgets License
*/
#line 19 "src/wx.sip"
#include "stdwxpy.h"
#line 12 "sip_wxcorewxTimer.cpp"
#include "sipAPI_wxcore.h"
#line 7 "src/evthandler.sip"
class wxPyCallback: public wxObject
{
public:
wxPyCallback(PyObject* func);
virtual ~wxPyCallback();
void EventThunker(wxEvent& event);
PyObject* callback() const
{
return m_func;
}
protected:
PyObject* m_func;
};
#line 85 "src/evthandler.sip"
#include <wx/event.h>
#line 37 "sip_wxcorewxTimer.cpp"
#line 27 "src/window.sip"
#include <wx/window.h>
#include <wx/dynlib.h>
#line 41 "sip_wxcorewxTimer.cpp"
#line 5 "src/object.sip"
#include <wx/object.h>
#include <wx/gbsizer.h>
#line 45 "sip_wxcorewxTimer.cpp"
class sipwxTimer : public wxTimer
{
public:
sipwxTimer(wxEvtHandler *,int);
virtual ~sipwxTimer();
/*
* There is a protected method for every virtual method visible from
* this class.
*/
protected:
void Notify();
public:
sipSimpleWrapper *sipPySelf;
private:
sipwxTimer(const sipwxTimer &);
sipwxTimer &operator = (const sipwxTimer &);
char sipPyMethods[1];
};
sipwxTimer::sipwxTimer(wxEvtHandler *a0,int a1): wxTimer(a0,a1), sipPySelf(0)
{
memset(sipPyMethods, 0, sizeof (sipPyMethods));
}
sipwxTimer::~sipwxTimer()
{
sipCommonDtor(sipPySelf);
}
void sipwxTimer::Notify()
{
extern void sipVH__wxcore_11(sip_gilstate_t,PyObject *);
sip_gilstate_t sipGILState;
PyObject *meth;
meth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,NULL,sipName_Notify);
if (!meth)
{
wxTimer::Notify();
return;
}
sipVH__wxcore_11(sipGILState,meth);
}
extern "C" {static PyObject *meth_wxTimer_SetOwner(PyObject *, PyObject *);}
static PyObject *meth_wxTimer_SetOwner(PyObject *sipSelf,PyObject *sipArgs)
{
int sipArgsParsed = 0;
{
wxEvtHandler * a0;
int a1 = wxID_ANY;
wxTimer *sipCpp;
if (sipParseArgs(&sipArgsParsed,sipArgs,"BJ8|i",&sipSelf,sipType_wxTimer,&sipCpp,sipType_wxEvtHandler,&a0,&a1))
{
sipCpp->SetOwner(a0,a1);
Py_INCREF(Py_None);
return Py_None;
}
}
/* Raise an exception if the arguments couldn't be parsed. */
sipNoMethod(sipArgsParsed,sipName_Timer,sipName_SetOwner);
return NULL;
}
extern "C" {static PyObject *meth_wxTimer_GetOwner(PyObject *, PyObject *);}
static PyObject *meth_wxTimer_GetOwner(PyObject *sipSelf,PyObject *sipArgs)
{
int sipArgsParsed = 0;
{
wxTimer *sipCpp;
if (sipParseArgs(&sipArgsParsed,sipArgs,"B",&sipSelf,sipType_wxTimer,&sipCpp))
{
wxEvtHandler *sipRes;
sipRes = sipCpp->GetOwner();
return sipConvertFromType(sipRes,sipType_wxEvtHandler,NULL);
}
}
/* Raise an exception if the arguments couldn't be parsed. */
sipNoMethod(sipArgsParsed,sipName_Timer,sipName_GetOwner);
return NULL;
}
extern "C" {static PyObject *meth_wxTimer_Start(PyObject *, PyObject *);}
static PyObject *meth_wxTimer_Start(PyObject *sipSelf,PyObject *sipArgs)
{
int sipArgsParsed = 0;
{
int a0 = -1;
bool a1 = 0;
wxTimer *sipCpp;
if (sipParseArgs(&sipArgsParsed,sipArgs,"B|ib",&sipSelf,sipType_wxTimer,&sipCpp,&a0,&a1))
{
bool sipRes;
sipRes = sipCpp->Start(a0,a1);
return PyBool_FromLong(sipRes);
}
}
/* Raise an exception if the arguments couldn't be parsed. */
sipNoMethod(sipArgsParsed,sipName_Timer,sipName_Start);
return NULL;
}
extern "C" {static PyObject *meth_wxTimer_Stop(PyObject *, PyObject *);}
static PyObject *meth_wxTimer_Stop(PyObject *sipSelf,PyObject *sipArgs)
{
int sipArgsParsed = 0;
{
wxTimer *sipCpp;
if (sipParseArgs(&sipArgsParsed,sipArgs,"B",&sipSelf,sipType_wxTimer,&sipCpp))
{
sipCpp->Stop();
Py_INCREF(Py_None);
return Py_None;
}
}
/* Raise an exception if the arguments couldn't be parsed. */
sipNoMethod(sipArgsParsed,sipName_Timer,sipName_Stop);
return NULL;
}
extern "C" {static PyObject *meth_wxTimer_Notify(PyObject *, PyObject *);}
static PyObject *meth_wxTimer_Notify(PyObject *sipSelf,PyObject *sipArgs)
{
int sipArgsParsed = 0;
bool sipSelfWasArg = (!sipSelf || sipIsDerived((sipSimpleWrapper *)sipSelf));
{
wxTimer *sipCpp;
if (sipParseArgs(&sipArgsParsed,sipArgs,"B",&sipSelf,sipType_wxTimer,&sipCpp))
{
(sipSelfWasArg ? sipCpp->wxTimer::Notify() : sipCpp->Notify());
Py_INCREF(Py_None);
return Py_None;
}
}
/* Raise an exception if the arguments couldn't be parsed. */
sipNoMethod(sipArgsParsed,sipName_Timer,sipName_Notify);
return NULL;
}
extern "C" {static PyObject *meth_wxTimer_IsRunning(PyObject *, PyObject *);}
static PyObject *meth_wxTimer_IsRunning(PyObject *sipSelf,PyObject *sipArgs)
{
int sipArgsParsed = 0;
{
wxTimer *sipCpp;
if (sipParseArgs(&sipArgsParsed,sipArgs,"B",&sipSelf,sipType_wxTimer,&sipCpp))
{
bool sipRes;
sipRes = sipCpp->IsRunning();
return PyBool_FromLong(sipRes);
}
}
/* Raise an exception if the arguments couldn't be parsed. */
sipNoMethod(sipArgsParsed,sipName_Timer,sipName_IsRunning);
return NULL;
}
extern "C" {static PyObject *meth_wxTimer_GetInterval(PyObject *, PyObject *);}
static PyObject *meth_wxTimer_GetInterval(PyObject *sipSelf,PyObject *sipArgs)
{
int sipArgsParsed = 0;
{
wxTimer *sipCpp;
if (sipParseArgs(&sipArgsParsed,sipArgs,"B",&sipSelf,sipType_wxTimer,&sipCpp))
{
int sipRes;
sipRes = sipCpp->GetInterval();
return SIPLong_FromLong(sipRes);
}
}
/* Raise an exception if the arguments couldn't be parsed. */
sipNoMethod(sipArgsParsed,sipName_Timer,sipName_GetInterval);
return NULL;
}
extern "C" {static PyObject *meth_wxTimer_GetId(PyObject *, PyObject *);}
static PyObject *meth_wxTimer_GetId(PyObject *sipSelf,PyObject *sipArgs)
{
int sipArgsParsed = 0;
{
wxTimer *sipCpp;
if (sipParseArgs(&sipArgsParsed,sipArgs,"B",&sipSelf,sipType_wxTimer,&sipCpp))
{
int sipRes;
sipRes = sipCpp->GetId();
return SIPLong_FromLong(sipRes);
}
}
/* Raise an exception if the arguments couldn't be parsed. */
sipNoMethod(sipArgsParsed,sipName_Timer,sipName_GetId);
return NULL;
}
extern "C" {static PyObject *meth_wxTimer_IsOneShot(PyObject *, PyObject *);}
static PyObject *meth_wxTimer_IsOneShot(PyObject *sipSelf,PyObject *sipArgs)
{
int sipArgsParsed = 0;
{
wxTimer *sipCpp;
if (sipParseArgs(&sipArgsParsed,sipArgs,"B",&sipSelf,sipType_wxTimer,&sipCpp))
{
bool sipRes;
sipRes = sipCpp->IsOneShot();
return PyBool_FromLong(sipRes);
}
}
/* Raise an exception if the arguments couldn't be parsed. */
sipNoMethod(sipArgsParsed,sipName_Timer,sipName_IsOneShot);
return NULL;
}
/* Cast a pointer to a type somewhere in its superclass hierarchy. */
extern "C" {static void *cast_wxTimer(void *, const sipTypeDef *);}
static void *cast_wxTimer(void *ptr,const sipTypeDef *targetType)
{
void *res;
if (targetType == sipType_wxTimer)
return ptr;
if ((res = ((const sipClassTypeDef *)sipType_wxEvtHandler)->ctd_cast((wxEvtHandler *)(wxTimer *)ptr,targetType)) != NULL)
return res;
return NULL;
}
/* Call the instance's destructor. */
extern "C" {static void release_wxTimer(void *, int);}
static void release_wxTimer(void *sipCppV,int state)
{
if (!wxIsMainThread()) {
wxpy_add_pending_delete(&sipType__wxcore_wxTimer, sipCppV, state);
} else {
wxpy_remove_pending_delete(&sipType__wxcore_wxTimer, sipCppV, state);
if (state & SIP_DERIVED_CLASS)
delete reinterpret_cast<sipwxTimer *>(sipCppV);
else
delete reinterpret_cast<wxTimer *>(sipCppV);
}
}
extern "C" {static void dealloc_wxTimer(sipSimpleWrapper *);}
static void dealloc_wxTimer(sipSimpleWrapper *sipSelf)
{
if (sipIsDerived(sipSelf))
reinterpret_cast<sipwxTimer *>(sipSelf->u.cppPtr)->sipPySelf = NULL;
if (sipIsPyOwned(sipSelf))
{
release_wxTimer(sipSelf->u.cppPtr,sipSelf->flags);
}
}
extern "C" {static void *init_wxTimer(sipSimpleWrapper *, PyObject *, PyObject **, int *);}
static void *init_wxTimer(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject **, int *sipArgsParsed)
{
sipwxTimer *sipCpp = 0;
if (!sipCpp)
{
wxEvtHandler * a0 = 0;
int a1 = wxID_ANY;
if (sipParseArgs(sipArgsParsed,sipArgs,"|J8i",sipType_wxEvtHandler,&a0,&a1))
{
sipCpp = new sipwxTimer(a0,a1);
}
}
if (sipCpp)
sipCpp->sipPySelf = sipSelf;
return sipCpp;
}
/* Define this type's super-types. */
static sipEncodedClassDef supers_wxTimer[] = {{81, 255, 1}};
static PyMethodDef methods_wxTimer[] = {
{SIP_PYMETHODDEF_CAST(sipName_GetId), meth_wxTimer_GetId, METH_VARARGS, NULL},
{SIP_PYMETHODDEF_CAST(sipName_GetInterval), meth_wxTimer_GetInterval, METH_VARARGS, NULL},
{SIP_PYMETHODDEF_CAST(sipName_GetOwner), meth_wxTimer_GetOwner, METH_VARARGS, NULL},
{SIP_PYMETHODDEF_CAST(sipName_IsOneShot), meth_wxTimer_IsOneShot, METH_VARARGS, NULL},
{SIP_PYMETHODDEF_CAST(sipName_IsRunning), meth_wxTimer_IsRunning, METH_VARARGS, NULL},
{SIP_PYMETHODDEF_CAST(sipName_Notify), meth_wxTimer_Notify, METH_VARARGS, NULL},
{SIP_PYMETHODDEF_CAST(sipName_SetOwner), meth_wxTimer_SetOwner, METH_VARARGS, NULL},
{SIP_PYMETHODDEF_CAST(sipName_Start), meth_wxTimer_Start, METH_VARARGS, NULL},
{SIP_PYMETHODDEF_CAST(sipName_Stop), meth_wxTimer_Stop, METH_VARARGS, NULL}
};
extern "C" {static PyObject *varget_wxTimer_Id(void *, PyObject *, PyObject *);}
static PyObject *varget_wxTimer_Id(void *sipSelf, PyObject *, PyObject *)
{
int sipVal;
wxTimer *sipCpp = reinterpret_cast<wxTimer *>(sipSelf);
sipVal = sipCpp->GetId();
return SIPLong_FromLong(sipVal);
}
extern "C" {static int varset_wxTimer_Id(void *, PyObject*, PyObject *);}
static int varset_wxTimer_Id(void *, PyObject* sipPy, PyObject *)
{
PyErr_SetNone(PyExc_AttributeError);
return NULL;
}
extern "C" {static PyObject *varget_wxTimer_Interval(void *, PyObject *, PyObject *);}
static PyObject *varget_wxTimer_Interval(void *sipSelf, PyObject *, PyObject *)
{
int sipVal;
wxTimer *sipCpp = reinterpret_cast<wxTimer *>(sipSelf);
sipVal = sipCpp->GetInterval();
return SIPLong_FromLong(sipVal);
}
extern "C" {static int varset_wxTimer_Interval(void *, PyObject*, PyObject *);}
static int varset_wxTimer_Interval(void *, PyObject* sipPy, PyObject *)
{
PyErr_SetNone(PyExc_AttributeError);
return NULL;
}
extern "C" {static PyObject *varget_wxTimer_Owner(void *, PyObject *, PyObject *);}
static PyObject *varget_wxTimer_Owner(void *sipSelf, PyObject *, PyObject *)
{
wxEvtHandler *sipVal;
wxTimer *sipCpp = reinterpret_cast<wxTimer *>(sipSelf);
sipVal = sipCpp->GetOwner();
return sipConvertFromType(sipVal,sipType_wxEvtHandler, NULL);
}
extern "C" {static int varset_wxTimer_Owner(void *, PyObject*, PyObject *);}
static int varset_wxTimer_Owner(void *sipSelf, PyObject* sipPy, PyObject *)
{
wxEvtHandler *sipVal;
wxTimer *sipCpp = reinterpret_cast<wxTimer *>(sipSelf);
int sipIsErr = 0;
sipVal = reinterpret_cast<wxEvtHandler *>(sipForceConvertToType(sipPy,sipType_wxEvtHandler,NULL,0,NULL,&sipIsErr));
if (sipIsErr)
return -1;
sipCpp->SetOwner(sipVal);
return 0;
}
sipVariableDef variables_wxTimer[] = {
{sipName_Id, varget_wxTimer_Id, varset_wxTimer_Id, 0},
{sipName_Interval, varget_wxTimer_Interval, varset_wxTimer_Interval, 0},
{sipName_Owner, varget_wxTimer_Owner, varset_wxTimer_Owner, 0},
};
sipClassTypeDef sipType__wxcore_wxTimer = {
{
0,
0,
0,
SIP_TYPE_SCC|SIP_TYPE_CLASS,
sipNameNr_wxTimer,
{0}
},
sipNameNr_Timer,
-1,
-1,
{0, 0, 1},
supers_wxTimer,
0,
9, methods_wxTimer,
0, 0,
3, variables_wxTimer,
init_wxTimer,
0,
0,
#if PY_MAJOR_VERSION >= 3
0,
0,
#else
0,
0,
0,
0,
#endif
dealloc_wxTimer,
release_wxTimer,
cast_wxTimer,
0,
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
0,
0
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment