diff options
Diffstat (limited to 'libpyside/qslot.cpp')
-rw-r--r-- | libpyside/qslot.cpp | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/libpyside/qslot.cpp b/libpyside/qslot.cpp index 762f85f28..5aab65490 100644 --- a/libpyside/qslot.cpp +++ b/libpyside/qslot.cpp @@ -38,11 +38,11 @@ typedef struct extern "C" { -static int slot_init(PyObject*, PyObject*, PyObject*); -static PyObject* slot_call(PyObject*, PyObject*, PyObject*); +static int slotTpInit(PyObject*, PyObject*, PyObject*); +static PyObject* slotCall(PyObject*, PyObject*, PyObject*); // Class Definition ----------------------------------------------- -static PyTypeObject Slot_Type = { +static PyTypeObject PySideSlotType = { PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "PySide.QtCore."SLOT_DEC_NAME, /*tp_name*/ @@ -58,7 +58,7 @@ static PyTypeObject Slot_Type = { 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash */ - slot_call, /*tp_call*/ + slotCall, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ @@ -79,7 +79,7 @@ static PyTypeObject Slot_Type = { 0, /*tp_descr_get */ 0, /*tp_descr_set */ 0, /*tp_dictoffset */ - (initproc)slot_init, /*tp_init */ + slotTpInit, /*tp_init */ 0, /*tp_alloc */ PyType_GenericNew, /*tp_new */ 0, /*tp_free */ @@ -92,19 +92,7 @@ static PyTypeObject Slot_Type = { 0, /*tp_del */ }; -void init_slot(PyObject *module) -{ - if (PyType_Ready(&Slot_Type) < 0) - return; - - Py_INCREF(&Slot_Type); - PyModule_AddObject(module, SLOT_DEC_NAME, ((PyObject*)&Slot_Type)); -} - - -} // extern "C" - -int slot_init(PyObject *self, PyObject *args, PyObject *kw) +int slotTpInit(PyObject *self, PyObject *args, PyObject *kw) { static PyObject *emptyTuple = 0; static const char *kwlist[] = {"name", "result", 0}; @@ -144,7 +132,7 @@ int slot_init(PyObject *self, PyObject *args, PyObject *kw) return 1; } -PyObject* slot_call(PyObject* self, PyObject* args, PyObject* kw) +PyObject* slotCall(PyObject* self, PyObject* args, PyObject* kw) { static PyObject* pySlotName = 0; PyObject* callback; @@ -190,3 +178,18 @@ PyObject* slot_call(PyObject* self, PyObject* args, PyObject* kw) return callback; } +} // extern "C" + +namespace PySide +{ + +void initSlotSupport(PyObject* module) +{ + if (PyType_Ready(&PySideSlotType) < 0) + return; + + Py_INCREF(&PySideSlotType); + PyModule_AddObject(module, SLOT_DEC_NAME, ((PyObject*)&PySideSlotType)); +} + +} // namespace PySide |