Rename some slot internal functions and structures and remove C linkage from init_slot function.
This commit is contained in:
parent
a43eafaae4
commit
740137e51a
3 changed files with 61 additions and 27 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue