aboutsummaryrefslogtreecommitdiffstats
path: root/libpyside/qslot.cpp
diff options
context:
space:
mode:
authorrenatofilho <renato.filho@openbossa.org>2010-10-29 16:21:50 -0300
committerrenatofilho <renato.filho@openbossa.org>2010-11-03 10:28:15 -0300
commitc7945787c556d2e3e40a1b9ef93147c640ee8ff6 (patch)
tree96ac95001401d2c300f4833b3dfd2b9855578260 /libpyside/qslot.cpp
parent62fd909705a4bf99590346712b040f7b40c9bb74 (diff)
Created Singal/Slot/Property namespace for pure C structures.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Lauro Neto <lauro.neto@openbossa.org>
Diffstat (limited to 'libpyside/qslot.cpp')
-rw-r--r--libpyside/qslot.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/libpyside/qslot.cpp b/libpyside/qslot.cpp
index 5aab65490..ff63a6ca3 100644
--- a/libpyside/qslot.cpp
+++ b/libpyside/qslot.cpp
@@ -33,7 +33,7 @@ typedef struct
char* slotName;
char* args;
char* resultType;
-} SlotData;
+} PySideSlot;
extern "C"
{
@@ -46,7 +46,7 @@ static PyTypeObject PySideSlotType = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
"PySide.QtCore."SLOT_DEC_NAME, /*tp_name*/
- sizeof(SlotData), /*tp_basicsize*/
+ sizeof(PySideSlot), /*tp_basicsize*/
0, /*tp_itemsize*/
0, /*tp_dealloc*/
0, /*tp_print*/
@@ -105,10 +105,10 @@ int slotTpInit(PyObject *self, PyObject *args, PyObject *kw)
if (!PyArg_ParseTupleAndKeywords(emptyTuple, kw, "|sO:QtCore."SLOT_DEC_NAME, (char**) kwlist, &argName, &argResult))
return 0;
- SlotData *data = reinterpret_cast<SlotData*>(self);
+ PySideSlot *data = reinterpret_cast<PySideSlot*>(self);
for(Py_ssize_t i = 0, i_max = PyTuple_Size(args); i < i_max; i++) {
PyObject *argType = PyTuple_GET_ITEM(args, i);
- char *typeName = PySide::getTypeName(argType);
+ char *typeName = PySide::Signal::getTypeName(argType);
if (typeName) {
if (data->args) {
data->args = reinterpret_cast<char*>(realloc(data->args, (strlen(data->args) + 1 + strlen(typeName)) * sizeof(char*)));
@@ -125,7 +125,7 @@ int slotTpInit(PyObject *self, PyObject *args, PyObject *kw)
data->slotName = strdup(argName);
if (argResult)
- data->resultType = PySide::getTypeName(argResult);
+ data->resultType = PySide::Signal::getTypeName(argResult);
else
data->resultType = strdup("void");
@@ -140,7 +140,7 @@ PyObject* slotCall(PyObject* self, PyObject* args, PyObject* kw)
Py_INCREF(callback);
if (PyFunction_Check(callback)) {
- SlotData *data = reinterpret_cast<SlotData*>(self);
+ PySideSlot *data = reinterpret_cast<PySideSlot*>(self);
if (!data->slotName) {
PyObject *funcName = reinterpret_cast<PyFunctionObject*>(callback)->func_name;
@@ -180,10 +180,9 @@ PyObject* slotCall(PyObject* self, PyObject* args, PyObject* kw)
} // extern "C"
-namespace PySide
-{
+namespace PySide { namespace Slot {
-void initSlotSupport(PyObject* module)
+void init(PyObject* module)
{
if (PyType_Ready(&PySideSlotType) < 0)
return;
@@ -192,4 +191,5 @@ void initSlotSupport(PyObject* module)
PyModule_AddObject(module, SLOT_DEC_NAME, ((PyObject*)&PySideSlotType));
}
+} // namespace Slot
} // namespace PySide