mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-10 05:47:09 +01:00
git-svn-id: https://svn.wxwidgets.org/svn/wx/sandbox/trunk/Phoenix@66198 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
576 lines
15 KiB
C++
576 lines
15 KiB
C++
/*
|
|
* 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 677 "sip/gen/event.sip"
|
|
#include <wx/event.h>
|
|
#line 15 "sip_corewxKeyEvent.cpp"
|
|
|
|
#line 23 "sip/gen/gdicmn.sip"
|
|
#include <wx/gdicmn.h>
|
|
#line 19 "sip_corewxKeyEvent.cpp"
|
|
#line 40 "sip/gen/object.sip"
|
|
#include <wx/object.h>
|
|
#line 22 "sip_corewxKeyEvent.cpp"
|
|
#line 129 "sip/gen/event.sip"
|
|
#include <wx/event.h>
|
|
#line 25 "sip_corewxKeyEvent.cpp"
|
|
#line 17 "sip/gen/object.sip"
|
|
#include <wx/object.h>
|
|
#line 28 "sip_corewxKeyEvent.cpp"
|
|
#line 84 "sip/gen/object.sip"
|
|
#include <wx/object.h>
|
|
#line 31 "sip_corewxKeyEvent.cpp"
|
|
|
|
|
|
class sipwxKeyEvent : public wxKeyEvent
|
|
{
|
|
public:
|
|
sipwxKeyEvent(wxEventType);
|
|
sipwxKeyEvent(const wxKeyEvent&);
|
|
virtual ~sipwxKeyEvent();
|
|
|
|
/*
|
|
* There is a protected method for every virtual method visible from
|
|
* this class.
|
|
*/
|
|
protected:
|
|
wxEvent * Clone();
|
|
wxEventCategory GetEventCategory();
|
|
wxClassInfo * GetClassInfo();
|
|
|
|
public:
|
|
sipSimpleWrapper *sipPySelf;
|
|
|
|
private:
|
|
sipwxKeyEvent(const sipwxKeyEvent &);
|
|
sipwxKeyEvent &operator = (const sipwxKeyEvent &);
|
|
|
|
char sipPyMethods[3];
|
|
};
|
|
|
|
sipwxKeyEvent::sipwxKeyEvent(wxEventType keyEventType): wxKeyEvent(keyEventType), sipPySelf(0)
|
|
{
|
|
memset(sipPyMethods, 0, sizeof (sipPyMethods));
|
|
}
|
|
|
|
sipwxKeyEvent::sipwxKeyEvent(const wxKeyEvent& a0): wxKeyEvent(a0), sipPySelf(0)
|
|
{
|
|
memset(sipPyMethods, 0, sizeof (sipPyMethods));
|
|
}
|
|
|
|
sipwxKeyEvent::~sipwxKeyEvent()
|
|
{
|
|
sipCommonDtor(sipPySelf);
|
|
}
|
|
|
|
wxEvent * sipwxKeyEvent::Clone()
|
|
{
|
|
sip_gilstate_t sipGILState;
|
|
PyObject *sipMeth;
|
|
|
|
sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,NULL,sipName_Clone);
|
|
|
|
if (!sipMeth)
|
|
return wxEvent::Clone();
|
|
|
|
extern wxEvent * sipVH__core_1(sip_gilstate_t,PyObject *);
|
|
|
|
return sipVH__core_1(sipGILState,sipMeth);
|
|
}
|
|
|
|
wxEventCategory sipwxKeyEvent::GetEventCategory()
|
|
{
|
|
sip_gilstate_t sipGILState;
|
|
PyObject *sipMeth;
|
|
|
|
sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[1],sipPySelf,NULL,sipName_GetEventCategory);
|
|
|
|
if (!sipMeth)
|
|
return wxEvent::GetEventCategory();
|
|
|
|
extern wxEventCategory sipVH__core_0(sip_gilstate_t,PyObject *);
|
|
|
|
return sipVH__core_0(sipGILState,sipMeth);
|
|
}
|
|
|
|
wxClassInfo * sipwxKeyEvent::GetClassInfo()
|
|
{
|
|
sip_gilstate_t sipGILState;
|
|
PyObject *sipMeth;
|
|
|
|
sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[2],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_wxKeyEvent_GetPosition, "KeyEvent.GetPosition() -> Point");
|
|
|
|
extern "C" {static PyObject *meth_wxKeyEvent_GetPosition(PyObject *, PyObject *);}
|
|
static PyObject *meth_wxKeyEvent_GetPosition(PyObject *sipSelf, PyObject *sipArgs)
|
|
{
|
|
PyObject *sipParseErr = NULL;
|
|
|
|
{
|
|
wxKeyEvent *sipCpp;
|
|
|
|
if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxKeyEvent, &sipCpp))
|
|
{
|
|
wxPoint *sipRes;
|
|
|
|
try
|
|
{
|
|
sipRes = new wxPoint(sipCpp->GetPosition());
|
|
}
|
|
catch (...)
|
|
{
|
|
sipRaiseUnknownException();
|
|
return NULL;
|
|
}
|
|
|
|
return sipConvertFromNewType(sipRes,sipType_wxPoint,NULL);
|
|
}
|
|
}
|
|
|
|
/* Raise an exception if the arguments couldn't be parsed. */
|
|
sipNoMethod(sipParseErr, sipName_KeyEvent, sipName_GetPosition, doc_wxKeyEvent_GetPosition);
|
|
|
|
return NULL;
|
|
}
|
|
|
|
|
|
PyDoc_STRVAR(doc_wxKeyEvent_GetKeyCode, "KeyEvent.GetKeyCode() -> int");
|
|
|
|
extern "C" {static PyObject *meth_wxKeyEvent_GetKeyCode(PyObject *, PyObject *);}
|
|
static PyObject *meth_wxKeyEvent_GetKeyCode(PyObject *sipSelf, PyObject *sipArgs)
|
|
{
|
|
PyObject *sipParseErr = NULL;
|
|
|
|
{
|
|
wxKeyEvent *sipCpp;
|
|
|
|
if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxKeyEvent, &sipCpp))
|
|
{
|
|
int sipRes;
|
|
|
|
try
|
|
{
|
|
sipRes = sipCpp->GetKeyCode();
|
|
}
|
|
catch (...)
|
|
{
|
|
sipRaiseUnknownException();
|
|
return NULL;
|
|
}
|
|
|
|
return SIPLong_FromLong(sipRes);
|
|
}
|
|
}
|
|
|
|
/* Raise an exception if the arguments couldn't be parsed. */
|
|
sipNoMethod(sipParseErr, sipName_KeyEvent, sipName_GetKeyCode, doc_wxKeyEvent_GetKeyCode);
|
|
|
|
return NULL;
|
|
}
|
|
|
|
|
|
PyDoc_STRVAR(doc_wxKeyEvent_IsKeyInCategory, "KeyEvent.IsKeyInCategory(int) -> bool");
|
|
|
|
extern "C" {static PyObject *meth_wxKeyEvent_IsKeyInCategory(PyObject *, PyObject *, PyObject *);}
|
|
static PyObject *meth_wxKeyEvent_IsKeyInCategory(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
|
|
{
|
|
PyObject *sipParseErr = NULL;
|
|
|
|
{
|
|
int category;
|
|
wxKeyEvent *sipCpp;
|
|
|
|
static const char *sipKwdList[] = {
|
|
sipName_category,
|
|
};
|
|
|
|
if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, NULL, "Bi", &sipSelf, sipType_wxKeyEvent, &sipCpp, &category))
|
|
{
|
|
bool sipRes;
|
|
|
|
try
|
|
{
|
|
sipRes = sipCpp->IsKeyInCategory(category);
|
|
}
|
|
catch (...)
|
|
{
|
|
sipRaiseUnknownException();
|
|
return NULL;
|
|
}
|
|
|
|
return PyBool_FromLong(sipRes);
|
|
}
|
|
}
|
|
|
|
/* Raise an exception if the arguments couldn't be parsed. */
|
|
sipNoMethod(sipParseErr, sipName_KeyEvent, sipName_IsKeyInCategory, doc_wxKeyEvent_IsKeyInCategory);
|
|
|
|
return NULL;
|
|
}
|
|
|
|
|
|
PyDoc_STRVAR(doc_wxKeyEvent_GetRawKeyCode, "KeyEvent.GetRawKeyCode() -> int");
|
|
|
|
extern "C" {static PyObject *meth_wxKeyEvent_GetRawKeyCode(PyObject *, PyObject *);}
|
|
static PyObject *meth_wxKeyEvent_GetRawKeyCode(PyObject *sipSelf, PyObject *sipArgs)
|
|
{
|
|
PyObject *sipParseErr = NULL;
|
|
|
|
{
|
|
wxKeyEvent *sipCpp;
|
|
|
|
if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxKeyEvent, &sipCpp))
|
|
{
|
|
wxUint32 sipRes;
|
|
|
|
try
|
|
{
|
|
sipRes = sipCpp->GetRawKeyCode();
|
|
}
|
|
catch (...)
|
|
{
|
|
sipRaiseUnknownException();
|
|
return NULL;
|
|
}
|
|
|
|
return PyLong_FromUnsignedLong(sipRes);
|
|
}
|
|
}
|
|
|
|
/* Raise an exception if the arguments couldn't be parsed. */
|
|
sipNoMethod(sipParseErr, sipName_KeyEvent, sipName_GetRawKeyCode, doc_wxKeyEvent_GetRawKeyCode);
|
|
|
|
return NULL;
|
|
}
|
|
|
|
|
|
PyDoc_STRVAR(doc_wxKeyEvent_GetRawKeyFlags, "KeyEvent.GetRawKeyFlags() -> int");
|
|
|
|
extern "C" {static PyObject *meth_wxKeyEvent_GetRawKeyFlags(PyObject *, PyObject *);}
|
|
static PyObject *meth_wxKeyEvent_GetRawKeyFlags(PyObject *sipSelf, PyObject *sipArgs)
|
|
{
|
|
PyObject *sipParseErr = NULL;
|
|
|
|
{
|
|
wxKeyEvent *sipCpp;
|
|
|
|
if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxKeyEvent, &sipCpp))
|
|
{
|
|
wxUint32 sipRes;
|
|
|
|
try
|
|
{
|
|
sipRes = sipCpp->GetRawKeyFlags();
|
|
}
|
|
catch (...)
|
|
{
|
|
sipRaiseUnknownException();
|
|
return NULL;
|
|
}
|
|
|
|
return PyLong_FromUnsignedLong(sipRes);
|
|
}
|
|
}
|
|
|
|
/* Raise an exception if the arguments couldn't be parsed. */
|
|
sipNoMethod(sipParseErr, sipName_KeyEvent, sipName_GetRawKeyFlags, doc_wxKeyEvent_GetRawKeyFlags);
|
|
|
|
return NULL;
|
|
}
|
|
|
|
|
|
PyDoc_STRVAR(doc_wxKeyEvent_GetUnicodeKey, "KeyEvent.GetUnicodeKey() -> str");
|
|
|
|
extern "C" {static PyObject *meth_wxKeyEvent_GetUnicodeKey(PyObject *, PyObject *);}
|
|
static PyObject *meth_wxKeyEvent_GetUnicodeKey(PyObject *sipSelf, PyObject *sipArgs)
|
|
{
|
|
PyObject *sipParseErr = NULL;
|
|
|
|
{
|
|
wxKeyEvent *sipCpp;
|
|
|
|
if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxKeyEvent, &sipCpp))
|
|
{
|
|
wxChar sipRes;
|
|
|
|
try
|
|
{
|
|
sipRes = sipCpp->GetUnicodeKey();
|
|
}
|
|
catch (...)
|
|
{
|
|
sipRaiseUnknownException();
|
|
return NULL;
|
|
}
|
|
|
|
return PyUnicode_FromWideChar(&sipRes,1);
|
|
}
|
|
}
|
|
|
|
/* Raise an exception if the arguments couldn't be parsed. */
|
|
sipNoMethod(sipParseErr, sipName_KeyEvent, sipName_GetUnicodeKey, doc_wxKeyEvent_GetUnicodeKey);
|
|
|
|
return NULL;
|
|
}
|
|
|
|
|
|
PyDoc_STRVAR(doc_wxKeyEvent_GetX, "KeyEvent.GetX() -> int");
|
|
|
|
extern "C" {static PyObject *meth_wxKeyEvent_GetX(PyObject *, PyObject *);}
|
|
static PyObject *meth_wxKeyEvent_GetX(PyObject *sipSelf, PyObject *sipArgs)
|
|
{
|
|
PyObject *sipParseErr = NULL;
|
|
|
|
{
|
|
wxKeyEvent *sipCpp;
|
|
|
|
if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxKeyEvent, &sipCpp))
|
|
{
|
|
wxCoord sipRes;
|
|
|
|
try
|
|
{
|
|
sipRes = sipCpp->GetX();
|
|
}
|
|
catch (...)
|
|
{
|
|
sipRaiseUnknownException();
|
|
return NULL;
|
|
}
|
|
|
|
return SIPLong_FromLong(sipRes);
|
|
}
|
|
}
|
|
|
|
/* Raise an exception if the arguments couldn't be parsed. */
|
|
sipNoMethod(sipParseErr, sipName_KeyEvent, sipName_GetX, doc_wxKeyEvent_GetX);
|
|
|
|
return NULL;
|
|
}
|
|
|
|
|
|
PyDoc_STRVAR(doc_wxKeyEvent_GetY, "KeyEvent.GetY() -> int");
|
|
|
|
extern "C" {static PyObject *meth_wxKeyEvent_GetY(PyObject *, PyObject *);}
|
|
static PyObject *meth_wxKeyEvent_GetY(PyObject *sipSelf, PyObject *sipArgs)
|
|
{
|
|
PyObject *sipParseErr = NULL;
|
|
|
|
{
|
|
wxKeyEvent *sipCpp;
|
|
|
|
if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxKeyEvent, &sipCpp))
|
|
{
|
|
wxCoord sipRes;
|
|
|
|
try
|
|
{
|
|
sipRes = sipCpp->GetY();
|
|
}
|
|
catch (...)
|
|
{
|
|
sipRaiseUnknownException();
|
|
return NULL;
|
|
}
|
|
|
|
return SIPLong_FromLong(sipRes);
|
|
}
|
|
}
|
|
|
|
/* Raise an exception if the arguments couldn't be parsed. */
|
|
sipNoMethod(sipParseErr, sipName_KeyEvent, sipName_GetY, doc_wxKeyEvent_GetY);
|
|
|
|
return NULL;
|
|
}
|
|
|
|
|
|
/* Cast a pointer to a type somewhere in its superclass hierarchy. */
|
|
extern "C" {static void *cast_wxKeyEvent(void *, const sipTypeDef *);}
|
|
static void *cast_wxKeyEvent(void *ptr, const sipTypeDef *targetType)
|
|
{
|
|
void *res;
|
|
|
|
if (targetType == sipType_wxKeyEvent)
|
|
return ptr;
|
|
|
|
if ((res = ((const sipClassTypeDef *)sipType_wxEvent)->ctd_cast((wxEvent *)(wxKeyEvent *)ptr,targetType)) != NULL)
|
|
return res;
|
|
|
|
if ((res = ((const sipClassTypeDef *)sipType_wxKeyboardState)->ctd_cast((wxKeyboardState *)(wxKeyEvent *)ptr,targetType)) != NULL)
|
|
return res;
|
|
|
|
return NULL;
|
|
}
|
|
|
|
|
|
/* Call the instance's destructor. */
|
|
extern "C" {static void release_wxKeyEvent(void *, int);}
|
|
static void release_wxKeyEvent(void *sipCppV,int sipState)
|
|
{
|
|
if (sipState & SIP_DERIVED_CLASS)
|
|
delete reinterpret_cast<sipwxKeyEvent *>(sipCppV);
|
|
else
|
|
delete reinterpret_cast<wxKeyEvent *>(sipCppV);
|
|
}
|
|
|
|
|
|
extern "C" {static void dealloc_wxKeyEvent(sipSimpleWrapper *);}
|
|
static void dealloc_wxKeyEvent(sipSimpleWrapper *sipSelf)
|
|
{
|
|
if (sipIsDerived(sipSelf))
|
|
reinterpret_cast<sipwxKeyEvent *>(sipGetAddress(sipSelf))->sipPySelf = NULL;
|
|
|
|
if (sipIsPyOwned(sipSelf))
|
|
{
|
|
release_wxKeyEvent(sipGetAddress(sipSelf),sipSelf->flags);
|
|
}
|
|
}
|
|
|
|
|
|
extern "C" {static void *init_wxKeyEvent(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
|
|
static void *init_wxKeyEvent(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
|
|
{
|
|
sipwxKeyEvent *sipCpp = 0;
|
|
|
|
{
|
|
wxEventType keyEventType = wxEVT_NULL;
|
|
|
|
static const char *sipKwdList[] = {
|
|
sipName_keyEventType,
|
|
};
|
|
|
|
if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|i", &keyEventType))
|
|
{
|
|
try
|
|
{
|
|
sipCpp = new sipwxKeyEvent(keyEventType);
|
|
}
|
|
catch (...)
|
|
{
|
|
sipRaiseUnknownException();
|
|
return NULL;
|
|
}
|
|
|
|
sipCpp->sipPySelf = sipSelf;
|
|
|
|
return sipCpp;
|
|
}
|
|
}
|
|
|
|
{
|
|
const wxKeyEvent * a0;
|
|
|
|
if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, NULL, sipUnused, "J9", sipType_wxKeyEvent, &a0))
|
|
{
|
|
try
|
|
{
|
|
sipCpp = new sipwxKeyEvent(*a0);
|
|
}
|
|
catch (...)
|
|
{
|
|
sipRaiseUnknownException();
|
|
return NULL;
|
|
}
|
|
|
|
sipCpp->sipPySelf = sipSelf;
|
|
|
|
return sipCpp;
|
|
}
|
|
}
|
|
|
|
return NULL;
|
|
}
|
|
|
|
|
|
/* Define this type's super-types. */
|
|
static sipEncodedTypeDef supers_wxKeyEvent[] = {{19, 255, 0}, {40, 255, 1}};
|
|
|
|
|
|
static PyMethodDef methods_wxKeyEvent[] = {
|
|
{SIP_MLNAME_CAST(sipName_GetKeyCode), meth_wxKeyEvent_GetKeyCode, METH_VARARGS, SIP_MLDOC_CAST(doc_wxKeyEvent_GetKeyCode)},
|
|
{SIP_MLNAME_CAST(sipName_GetPosition), meth_wxKeyEvent_GetPosition, METH_VARARGS, SIP_MLDOC_CAST(doc_wxKeyEvent_GetPosition)},
|
|
{SIP_MLNAME_CAST(sipName_GetRawKeyCode), meth_wxKeyEvent_GetRawKeyCode, METH_VARARGS, SIP_MLDOC_CAST(doc_wxKeyEvent_GetRawKeyCode)},
|
|
{SIP_MLNAME_CAST(sipName_GetRawKeyFlags), meth_wxKeyEvent_GetRawKeyFlags, METH_VARARGS, SIP_MLDOC_CAST(doc_wxKeyEvent_GetRawKeyFlags)},
|
|
{SIP_MLNAME_CAST(sipName_GetUnicodeKey), meth_wxKeyEvent_GetUnicodeKey, METH_VARARGS, SIP_MLDOC_CAST(doc_wxKeyEvent_GetUnicodeKey)},
|
|
{SIP_MLNAME_CAST(sipName_GetX), meth_wxKeyEvent_GetX, METH_VARARGS, SIP_MLDOC_CAST(doc_wxKeyEvent_GetX)},
|
|
{SIP_MLNAME_CAST(sipName_GetY), meth_wxKeyEvent_GetY, METH_VARARGS, SIP_MLDOC_CAST(doc_wxKeyEvent_GetY)},
|
|
{SIP_MLNAME_CAST(sipName_IsKeyInCategory), (PyCFunction)meth_wxKeyEvent_IsKeyInCategory, METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxKeyEvent_IsKeyInCategory)}
|
|
};
|
|
|
|
sipVariableDef variables_wxKeyEvent[] = {
|
|
{PropertyVariable, sipName_UnicodeKey, &methods_wxKeyEvent[4], NULL, NULL, NULL},
|
|
{PropertyVariable, sipName_RawKeyFlags, &methods_wxKeyEvent[3], NULL, NULL, NULL},
|
|
{PropertyVariable, sipName_RawKeyCode, &methods_wxKeyEvent[2], NULL, NULL, NULL},
|
|
{PropertyVariable, sipName_Position, &methods_wxKeyEvent[1], NULL, NULL, NULL},
|
|
{PropertyVariable, sipName_KeyCode, &methods_wxKeyEvent[0], NULL, NULL, NULL},
|
|
{PropertyVariable, sipName_Y, &methods_wxKeyEvent[6], NULL, NULL, NULL},
|
|
{PropertyVariable, sipName_X, &methods_wxKeyEvent[5], NULL, NULL, NULL},
|
|
};
|
|
|
|
PyDoc_STRVAR(doc_wxKeyEvent, "\1KeyEvent(int keyEventType=wxEVT_NULL)\n"
|
|
"KeyEvent(KeyEvent)");
|
|
|
|
|
|
sipClassTypeDef sipTypeDef__core_wxKeyEvent = {
|
|
{
|
|
-1,
|
|
0,
|
|
0,
|
|
SIP_TYPE_CLASS,
|
|
sipNameNr_wxKeyEvent,
|
|
{0}
|
|
},
|
|
{
|
|
sipNameNr_KeyEvent,
|
|
{0, 0, 1},
|
|
8, methods_wxKeyEvent,
|
|
0, 0,
|
|
7, variables_wxKeyEvent,
|
|
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
},
|
|
doc_wxKeyEvent,
|
|
-1,
|
|
-1,
|
|
supers_wxKeyEvent,
|
|
0,
|
|
init_wxKeyEvent,
|
|
0,
|
|
0,
|
|
#if PY_MAJOR_VERSION >= 3
|
|
0,
|
|
0,
|
|
#else
|
|
0,
|
|
0,
|
|
0,
|
|
0,
|
|
#endif
|
|
dealloc_wxKeyEvent,
|
|
0,
|
|
0,
|
|
0,
|
|
release_wxKeyEvent,
|
|
cast_wxKeyEvent,
|
|
0,
|
|
0,
|
|
0
|
|
};
|