From 7d27356bafd5670adcc8753ab5437b3bf8ffa4be Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 22 Nov 2011 03:12:38 -0600 Subject: Initial TQt conversion --- siplib/qtlib.c | 100 +++++++++++++++++++++++------------------------ siplib/sip.h | 76 ++++++++++++++++++------------------ siplib/sipint.h | 4 +- siplib/siplib.c | 118 ++++++++++++++++++++++++++++---------------------------- 4 files changed, 149 insertions(+), 149 deletions(-) (limited to 'siplib') diff --git a/siplib/qtlib.c b/siplib/qtlib.c index ca0817a..88432b7 100644 --- a/siplib/qtlib.c +++ b/siplib/qtlib.c @@ -1,6 +1,6 @@ /* * The SIP library code that implements the interface to the optional module - * supplied Qt support. + * supplied TQt support. * * Copyright (c) 2010 Riverbank Computing Limited * @@ -26,9 +26,9 @@ #include "sipint.h" -/* This is how Qt "types" signals and slots. */ -#define isQtSlot(s) (*(s) == '1') -#define isQtSignal(s) (*(s) == '2') +/* This is how TQt "types" signals and slots. */ +#define isTQtSlot(s) (*(s) == '1') +#define isTQtSignal(s) (*(s) == '2') static PyObject *getWeakRef(PyObject *obj); @@ -44,8 +44,8 @@ static void *newSignal(void *txrx, const char **sig); */ static void *findSignal(void *txrx, const char **sig) { - if (sipQtSupport->qt_find_universal_signal != NULL) - txrx = sipQtSupport->qt_find_universal_signal(txrx, sig); + if (sipTQtSupport->qt_find_universal_signal != NULL) + txrx = sipTQtSupport->qt_find_universal_signal(txrx, sig); return txrx; } @@ -58,8 +58,8 @@ static void *newSignal(void *txrx, const char **sig) { void *new_txrx = findSignal(txrx, sig); - if (new_txrx == NULL && sipQtSupport->qt_create_universal_signal != NULL) - new_txrx = sipQtSupport->qt_create_universal_signal(txrx, sig); + if (new_txrx == NULL && sipTQtSupport->qt_create_universal_signal != NULL) + new_txrx = sipTQtSupport->qt_create_universal_signal(txrx, sig); return new_txrx; } @@ -72,7 +72,7 @@ static void *newSignal(void *txrx, const char **sig) static void *createUniversalSlot(sipWrapper *txSelf, const char *sig, PyObject *rxObj, const char *slot, const char **member, int flags) { - void *us = sipQtSupport->qt_create_universal_slot(txSelf, sig, rxObj, slot, + void *us = sipTQtSupport->qt_create_universal_slot(txSelf, sig, rxObj, slot, member, flags); if (us && txSelf) @@ -83,7 +83,7 @@ static void *createUniversalSlot(sipWrapper *txSelf, const char *sig, /* - * Invoke a single slot (Qt or Python) and return the result. + * Invoke a single slot (TQt or Python) and return the result. */ PyObject *sip_api_invoke_slot(const sipSlot *slot, PyObject *sigargs) { @@ -92,12 +92,12 @@ PyObject *sip_api_invoke_slot(const sipSlot *slot, PyObject *sigargs) /* Keep some compilers quiet. */ oxtype = oxvalue = oxtb = NULL; - /* Fan out Qt signals. (Only PyQt3 will do this.) */ + /* Fan out TQt signals. (Only PyTQt3 will do this.) */ if (slot->name != NULL && slot->name[0] != '\0') { - assert(sipQtSupport->qt_emit_signal); + assert(sipTQtSupport->qt_emit_signal); - if (sipQtSupport->qt_emit_signal(slot->pyobj, slot->name, sigargs) < 0) + if (sipTQtSupport->qt_emit_signal(slot->pyobj, slot->name, sigargs) < 0) return NULL; Py_INCREF(Py_None); @@ -125,7 +125,7 @@ PyObject *sip_api_invoke_slot(const sipSlot *slot, PyObject *sigargs) { /* * If the real object has gone then we pretend everything is Ok. This - * mimics the Qt behaviour of not caring if a receiving object has been + * mimics the TQt behaviour of not caring if a receiving object has been * deleted. */ Py_DECREF(sref); @@ -191,7 +191,7 @@ PyObject *sip_api_invoke_slot(const sipSlot *slot, PyObject *sigargs) * We make repeated attempts to call a slot. If we work out that it failed * because of an immediate type error we try again with one less argument. * We keep going until we run out of arguments to drop. This emulates the - * Qt ability of the slot to accept fewer arguments than a signal provides. + * TQt ability of the slot to accept fewer arguments than a signal provides. */ sa = sigargs; Py_INCREF(sa); @@ -307,13 +307,13 @@ PyObject *sip_api_invoke_slot(const sipSlot *slot, PyObject *sigargs) */ int sip_api_same_slot(const sipSlot *sp, PyObject *rxObj, const char *slot) { - /* See if they are signals or Qt slots, ie. they have a name. */ + /* See if they are signals or TQt slots, ie. they have a name. */ if (slot != NULL) { if (sp->name == NULL || sp->name[0] == '\0') return 0; - return (sipQtSupport->qt_same_name(sp->name, slot) && sp->pyobj == rxObj); + return (sipTQtSupport->qt_same_name(sp->name, slot) && sp->pyobj == rxObj); } /* See if they are pure Python methods. */ @@ -352,32 +352,32 @@ void *sipGetRx(sipSimpleWrapper *txSelf, const char *sigargs, PyObject *rxObj, const char *slot, const char **memberp) { if (slot != NULL) - if (isQtSlot(slot) || isQtSignal(slot)) + if (isTQtSlot(slot) || isTQtSignal(slot)) { void *rx; *memberp = slot; - if ((rx = sip_api_get_cpp_ptr((sipSimpleWrapper *)rxObj, sipQObjectType)) == NULL) + if ((rx = sip_api_get_cpp_ptr((sipSimpleWrapper *)rxObj, sipTQObjectType)) == NULL) return NULL; - if (isQtSignal(slot)) + if (isTQtSignal(slot)) rx = findSignal(rx, memberp); return rx; } /* - * The slot was either a Python callable or PyQt3 Python signal so there + * The slot was either a Python callable or PyTQt3 Python signal so there * should be a universal slot. */ - return sipQtSupport->qt_find_slot(sipGetAddress(txSelf), sigargs, rxObj, slot, memberp); + return sipTQtSupport->qt_find_slot(sipGetAddress(txSelf), sigargs, rxObj, slot, memberp); } /* - * Convert a Python receiver (either a Python signal or slot or a Qt signal or - * slot) to a Qt receiver. It is only ever called when the signal is a Qt + * Convert a Python receiver (either a Python signal or slot or a TQt signal or + * slot) to a TQt receiver. It is only ever called when the signal is a TQt * signal. Return NULL is there was an error. */ void *sip_api_convert_rx(sipWrapper *txSelf, const char *sigargs, @@ -386,16 +386,16 @@ void *sip_api_convert_rx(sipWrapper *txSelf, const char *sigargs, if (slot == NULL) return createUniversalSlot(txSelf, sigargs, rxObj, NULL, memberp, flags); - if (isQtSlot(slot) || isQtSignal(slot)) + if (isTQtSlot(slot) || isTQtSignal(slot)) { void *rx; *memberp = slot; - if ((rx = sip_api_get_cpp_ptr((sipSimpleWrapper *)rxObj, sipQObjectType)) == NULL) + if ((rx = sip_api_get_cpp_ptr((sipSimpleWrapper *)rxObj, sipTQObjectType)) == NULL) return NULL; - if (isQtSignal(slot)) + if (isTQtSignal(slot)) rx = newSignal(rx, memberp); return rx; @@ -407,20 +407,20 @@ void *sip_api_convert_rx(sipWrapper *txSelf, const char *sigargs, /* - * Connect a Qt signal or a Python signal to a Qt slot, a Qt signal, a Python + * Connect a TQt signal or a Python signal to a TQt slot, a TQt signal, a Python * slot or a Python signal. This is all possible combinations. */ PyObject *sip_api_connect_rx(PyObject *txObj, const char *sig, PyObject *rxObj, const char *slot, int type) { - /* Handle Qt signals. */ - if (isQtSignal(sig)) + /* Handle TQt signals. */ + if (isTQtSignal(sig)) { void *tx, *rx; const char *member, *real_sig; int res; - if ((tx = sip_api_get_cpp_ptr((sipSimpleWrapper *)txObj, sipQObjectType)) == NULL) + if ((tx = sip_api_get_cpp_ptr((sipSimpleWrapper *)txObj, sipTQObjectType)) == NULL) return NULL; real_sig = sig; @@ -431,15 +431,15 @@ PyObject *sip_api_connect_rx(PyObject *txObj, const char *sig, PyObject *rxObj, if ((rx = sip_api_convert_rx((sipWrapper *)txObj, sig, rxObj, slot, &member, 0)) == NULL) return NULL; - res = sipQtSupport->qt_connect(tx, real_sig, rx, member, type); + res = sipTQtSupport->qt_connect(tx, real_sig, rx, member, type); return PyBool_FromLong(res); } - /* Handle Python signals. Only PyQt3 will get this far. */ - assert(sipQtSupport->qt_connect_py_signal); + /* Handle Python signals. Only PyTQt3 will get this far. */ + assert(sipTQtSupport->qt_connect_py_signal); - if (sipQtSupport->qt_connect_py_signal(txObj, sig, rxObj, slot) < 0) + if (sipTQtSupport->qt_connect_py_signal(txObj, sig, rxObj, slot) < 0) return NULL; Py_INCREF(Py_True); @@ -448,20 +448,20 @@ PyObject *sip_api_connect_rx(PyObject *txObj, const char *sig, PyObject *rxObj, /* - * Disconnect a signal to a signal or a Qt slot. + * Disconnect a signal to a signal or a TQt slot. */ PyObject *sip_api_disconnect_rx(PyObject *txObj,const char *sig, PyObject *rxObj,const char *slot) { - /* Handle Qt signals. */ - if (isQtSignal(sig)) + /* Handle TQt signals. */ + if (isTQtSignal(sig)) { sipSimpleWrapper *txSelf = (sipSimpleWrapper *)txObj; void *tx, *rx; const char *member; int res; - if ((tx = sip_api_get_cpp_ptr(txSelf, sipQObjectType)) == NULL) + if ((tx = sip_api_get_cpp_ptr(txSelf, sipTQObjectType)) == NULL) return NULL; if ((rx = sipGetRx(txSelf, sig, rxObj, slot, &member)) == NULL) @@ -473,22 +473,22 @@ PyObject *sip_api_disconnect_rx(PyObject *txObj,const char *sig, /* Handle Python signals. */ tx = findSignal(tx, &sig); - res = sipQtSupport->qt_disconnect(tx, sig, rx, member); + res = sipTQtSupport->qt_disconnect(tx, sig, rx, member); /* * Delete it if it is a universal slot as this will be it's only * connection. If the slot is actually a universal signal then it * should leave it in place. */ - sipQtSupport->qt_destroy_universal_slot(rx); + sipTQtSupport->qt_destroy_universal_slot(rx); return PyBool_FromLong(res); } - /* Handle Python signals. Only PyQt3 will get this far. */ - assert(sipQtSupport->qt_disconnect_py_signal); + /* Handle Python signals. Only PyTQt3 will get this far. */ + assert(sipTQtSupport->qt_disconnect_py_signal); - sipQtSupport->qt_disconnect_py_signal(txObj, sig, rxObj, slot); + sipTQtSupport->qt_disconnect_py_signal(txObj, sig, rxObj, slot); Py_INCREF(Py_True); return Py_True; @@ -530,7 +530,7 @@ static char *sipStrdup(const char *s) /* * Initialise a slot, returning 0 if there was no error. If the signal was a - * Qt signal, then the slot may be a Python signal or a Python slot. If the + * TQt signal, then the slot may be a Python signal or a Python slot. If the * signal was a Python signal, then the slot may be anything. */ int sip_api_save_slot(sipSlot *sp, PyObject *rxObj, const char *slot) @@ -576,7 +576,7 @@ int sip_api_save_slot(sipSlot *sp, PyObject *rxObj, const char *slot) * because they are generated on the fly and we can't take a * reference as that may keep the instance (ie. self) alive. * We therefore treat it as if the user had specified the slot - * at "obj, SLOT('meth()')" rather than "obj.meth" (see below). + * at "obj, TQT_SLOT('meth()')" rather than "obj.meth" (see below). */ const char *meth; @@ -613,11 +613,11 @@ int sip_api_save_slot(sipSlot *sp, PyObject *rxObj, const char *slot) } else if ((sp -> name = sipStrdup(slot)) == NULL) return -1; - else if (isQtSlot(slot)) + else if (isTQtSlot(slot)) { /* - * The user has decided to connect a Python signal to a Qt slot and - * specified the slot as "obj, SLOT('meth()')" rather than "obj.meth". + * The user has decided to connect a Python signal to a TQt slot and + * specified the slot as "obj, TQT_SLOT('meth()')" rather than "obj.meth". */ char *tail; @@ -638,7 +638,7 @@ int sip_api_save_slot(sipSlot *sp, PyObject *rxObj, const char *slot) sp -> pyobj = rxObj; } else - /* It's a Qt signal. */ + /* It's a TQt signal. */ sp -> pyobj = rxObj; return 0; diff --git a/siplib/sip.h b/siplib/sip.h index b22b77c..68622be 100644 --- a/siplib/sip.h +++ b/siplib/sip.h @@ -22,8 +22,8 @@ /* - * This gets round a problem with Qt's moc and Python v2.3. Strictly speaking - * it's a Qt problem but later versions of Python include a fix for it so we + * This gets round a problem with TQt's tqmoc and Python v2.3. Strictly speaking + * it's a TQt problem but later versions of Python include a fix for it so we * might as well too. */ #undef slots @@ -99,7 +99,7 @@ extern "C" { * 4.0 Much refactoring. * * 3.8 Added sip_api_register_qt_metatype() and sip_api_deprecated(). - * Added qt_register_meta_type() to the Qt support API. + * Added qt_register_meta_type() to the TQt support API. * The C/C++ names of enums and types are now always defined in the * relevant structures and don't default to the Python name. * Added the 'XE' format characters to sip_api_parse_args(). @@ -125,9 +125,9 @@ extern "C" { * 3.5 Added the td_pickle field to the sipTypeDef structure. * Added sip_api_transfer_break(). * - * 3.4 Added qt_find_connection() to the Qt support API. - * Added sip_api_string_as_char(), sip_api_unicode_as_wchar(), - * sip_api_unicode_as_wstring(), sip_api_find_class(), + * 3.4 Added qt_find_connection() to the TQt support API. + * Added sip_api_string_as_char(), sip_api_tqunicode_as_wchar(), + * sip_api_tqunicode_as_wstring(), sip_api_find_class(), * sip_api_find_named_enum() and sip_api_parse_signature(). * Added the 'A', 'w' and 'x' format characters to sip_api_parse_args(), * sip_api_parse_result(), sip_api_build_result() and @@ -139,7 +139,7 @@ extern "C" { * * 3.1 Added sip_api_add_mapped_type_instance(). * - * 3.0 Moved the Qt support out of the sip module and into PyQt. This is + * 3.0 Moved the TQt support out of the sip module and into PyTQt. This is * such a dramatic change that there is no point in attempting to maintain * backwards compatibility. * @@ -927,8 +927,8 @@ typedef struct _sipExportedModuleDef { /* The imported modules. */ sipImportedModuleDef *em_imports; - /* The optional Qt support API. */ - struct _sipQtAPI *em_qt_api; + /* The optional TQt support API. */ + struct _sipTQtAPI *em_qt_api; /* The number of types. */ int em_nrtypes; @@ -1199,13 +1199,13 @@ typedef struct _sipPyMethod { /* - * A slot (in the Qt, rather than Python, sense). + * A slot (in the TQt, rather than Python, sense). */ typedef struct _sipSlot { - /* Name if a Qt or Python signal. */ + /* Name if a TQt or Python signal. */ char *name; - /* Signal or Qt slot object. */ + /* Signal or TQt slot object. */ PyObject *pyobj; /* Python slot method, pyobj is NULL. */ @@ -1302,7 +1302,7 @@ typedef struct _sipAPIDef { const sipStringTypeClassMap *map, int maplen); /* - * The following may be used by Qt support code but no other handwritten + * The following may be used by TQt support code but no other handwritten * code. */ void (*api_free_sipslot)(sipSlot *slot); @@ -1355,11 +1355,11 @@ typedef struct _sipAPIDef { char (*api_string_as_utf8_char)(PyObject *obj); const char *(*api_string_as_utf8_string)(PyObject **obj); #if defined(HAVE_WCHAR_H) - wchar_t (*api_unicode_as_wchar)(PyObject *obj); - wchar_t *(*api_unicode_as_wstring)(PyObject *obj); + wchar_t (*api_tqunicode_as_wchar)(PyObject *obj); + wchar_t *(*api_tqunicode_as_wstring)(PyObject *obj); #else - int (*api_unicode_as_wchar)(PyObject *obj); - int *(*api_unicode_as_wstring)(PyObject *obj); + int (*api_tqunicode_as_wchar)(PyObject *obj); + int *(*api_tqunicode_as_wstring)(PyObject *obj); #endif int (*api_deprecated)(const char *classname, const char *method); void (*api_keep_reference)(PyObject *self, int key, PyObject *obj); @@ -1371,9 +1371,9 @@ typedef struct _sipAPIDef { /* - * The API implementing the optional Qt support. + * The API implementing the optional TQt support. */ -typedef struct _sipQtAPI { +typedef struct _sipTQtAPI { sipTypeDef **qt_qobject; void *(*qt_create_universal_signal)(void *, const char **); void *(*qt_find_universal_signal)(void *, const char **); @@ -1391,7 +1391,7 @@ typedef struct _sipQtAPI { const char *); void (*qt_disconnect_py_signal)(PyObject *, const char *, PyObject *, const char *); -} sipQtAPI; +} sipTQtAPI; /* @@ -1411,7 +1411,7 @@ typedef struct _sipQtAPI { /* - * These flags are specific to the Qt support API. + * These flags are specific to the TQt support API. */ #define SIP_SINGLE_SHOT 0x01 /* The connection is single shot. */ @@ -1495,27 +1495,27 @@ typedef struct _sipQtAPI { /* - * The following are PyQt3-specific extensions. In SIP v5 they will be pushed - * out to a plugin supplied by PyQt3. + * The following are PyTQt3-specific extensions. In SIP v5 they will be pushed + * out to a plugin supplied by PyTQt3. */ typedef int (*pyqt3EmitFunc)(sipSimpleWrapper *, PyObject *); /* - * Maps the name of a Qt signal to a wrapper function to emit it. + * Maps the name of a TQt signal to a wrapper function to emit it. */ -typedef struct _pyqt3QtSignal { +typedef struct _pyqt3TQtSignal { /* The signal name. */ const char *st_name; /* The emitter function. */ pyqt3EmitFunc st_emitfunc; -} pyqt3QtSignal; +} pyqt3TQtSignal; /* - * This is the PyQt3-specific extension to the generated class type structure. + * This is the PyTQt3-specific extension to the generated class type structure. */ typedef struct _pyqt3ClassTypeDef { /* @@ -1524,20 +1524,20 @@ typedef struct _pyqt3ClassTypeDef { */ sipClassTypeDef super; - /* The emit table for Qt signals. */ - pyqt3QtSignal *qt3_emit; + /* The emit table for TQt signals. */ + pyqt3TQtSignal *qt3_emit; } pyqt3ClassTypeDef; /* - * The following are PyQt4-specific extensions. In SIP v5 they will be pushed - * out to a plugin supplied by PyQt4. + * The following are PyTQt4-specific extensions. In SIP v5 they will be pushed + * out to a plugin supplied by PyTQt4. */ /* - * The description of a Qt signal for PyQt4. + * The description of a TQt signal for PyTQt4. */ -typedef struct _pyqt4QtSignal { +typedef struct _pyqt4TQtSignal { /* The C++ name and signature of the signal. */ const char *signature; @@ -1549,11 +1549,11 @@ typedef struct _pyqt4QtSignal { * code that implements those methods. */ PyMethodDef *non_signals; -} pyqt4QtSignal; +} pyqt4TQtSignal; /* - * This is the PyQt4-specific extension to the generated class type structure. + * This is the PyTQt4-specific extension to the generated class type structure. */ typedef struct _pyqt4ClassTypeDef { /* @@ -1562,12 +1562,12 @@ typedef struct _pyqt4ClassTypeDef { */ sipClassTypeDef super; - /* A pointer to the QObject sub-class's staticMetaObject class variable. */ + /* A pointer to the TQObject sub-class's staticMetaObject class variable. */ const void *qt4_static_metaobject; /* * A set of flags. At the moment only bit 0 is used to say if the type is - * derived from QFlags. + * derived from TQFlags. */ unsigned qt4_flags; @@ -1575,7 +1575,7 @@ typedef struct _pyqt4ClassTypeDef { * The table of signals emitted by the type. These are grouped by signal * name. */ - const pyqt4QtSignal *qt4_signals; + const pyqt4TQtSignal *qt4_signals; } pyqt4ClassTypeDef; diff --git a/siplib/sipint.h b/siplib/sipint.h index 19a8b1b..3758b36 100644 --- a/siplib/sipint.h +++ b/siplib/sipint.h @@ -89,9 +89,9 @@ PyObject *sip_api_convert_from_const_void_ptr_and_size(const void *val, SIP_SSIZE_T size); -extern sipQtAPI *sipQtSupport; /* The Qt support API. */ +extern sipTQtAPI *sipTQtSupport; /* The TQt support API. */ extern sipWrapperType sipSimpleWrapper_Type; /* The simple wrapper type. */ -extern sipTypeDef *sipQObjectType; /* The QObject type. */ +extern sipTypeDef *sipTQObjectType; /* The TQObject type. */ void *sipGetRx(sipSimpleWrapper *txSelf, const char *sigargs, PyObject *rxObj, const char *slot, const char **memberp); diff --git a/siplib/siplib.c b/siplib/siplib.c index f419b6b..9c8ad30 100644 --- a/siplib/siplib.c +++ b/siplib/siplib.c @@ -232,11 +232,11 @@ static const char *sip_api_string_as_latin1_string(PyObject **obj); static char sip_api_string_as_utf8_char(PyObject *obj); static const char *sip_api_string_as_utf8_string(PyObject **obj); #if defined(HAVE_WCHAR_H) -static wchar_t sip_api_unicode_as_wchar(PyObject *obj); -static wchar_t *sip_api_unicode_as_wstring(PyObject *obj); +static wchar_t sip_api_tqunicode_as_wchar(PyObject *obj); +static wchar_t *sip_api_tqunicode_as_wstring(PyObject *obj); #else -static int sip_api_unicode_as_wchar(PyObject *obj); -static int *sip_api_unicode_as_wstring(PyObject *obj); +static int sip_api_tqunicode_as_wchar(PyObject *obj); +static int *sip_api_tqunicode_as_wstring(PyObject *obj); #endif static void sip_api_transfer_break(PyObject *self); static int sip_api_deprecated(const char *classname, const char *method); @@ -316,7 +316,7 @@ static const sipAPIDef sip_api = { sip_api_map_int_to_class, sip_api_map_string_to_class, /* - * The following may be used by Qt support code but by no other handwritten + * The following may be used by TQt support code but by no other handwritten * code. */ sip_api_free_sipslot, @@ -357,8 +357,8 @@ static const sipAPIDef sip_api = { sip_api_string_as_latin1_string, sip_api_string_as_utf8_char, sip_api_string_as_utf8_string, - sip_api_unicode_as_wchar, - sip_api_unicode_as_wstring, + sip_api_tqunicode_as_wchar, + sip_api_tqunicode_as_wstring, sip_api_deprecated, sip_api_keep_reference, sip_api_parse_kwd_args, @@ -494,8 +494,8 @@ static PyTypeObject sipEnumType_Type = { }; -sipQtAPI *sipQtSupport = NULL; -sipTypeDef *sipQObjectType; +sipTQtAPI *sipTQtSupport = NULL; +sipTypeDef *sipTQObjectType; /* @@ -541,7 +541,7 @@ static int parsePass2(sipSimpleWrapper *self, int selfarg, PyObject *sipArgs, va_list va); static PyObject *signature_FromDocstring(const char *doc, SIP_SSIZE_T line); static PyObject *detail_FromFailure(PyObject *failure_obj); -static int isQObject(PyObject *obj); +static int isTQObject(PyObject *obj); static int canConvertFromSequence(PyObject *seq, const sipTypeDef *td); static int convertFromSequence(PyObject *seq, const sipTypeDef *td, void **array, SIP_SSIZE_T *nr_elem); @@ -834,7 +834,7 @@ PyMODINIT_FUNC SIP_MODULE_ENTRY(void) /* Initialise the object map. */ sipOMInit(&cppPyMap); - sipQtSupport = NULL; + sipTQtSupport = NULL; /* * Get the current interpreter. This will be shared between all @@ -1247,11 +1247,11 @@ static int sip_api_export_module(sipExportedModuleDef *client, return -1; } - /* Only one module can claim to wrap QObject. */ + /* Only one module can claim to wrap TQObject. */ if (em->em_qt_api != NULL && client->em_qt_api != NULL) { PyErr_Format(PyExc_RuntimeError, - "the %s and %s modules both wrap the QObject class", + "the %s and %s modules both wrap the TQObject class", full_name, sipNameOfModule(em)); return -1; @@ -1383,11 +1383,11 @@ static int sip_api_init_module(sipExportedModuleDef *client, } } - /* Set any Qt support API. */ + /* Set any TQt support API. */ if (client->em_qt_api != NULL) { - sipQtSupport = client->em_qt_api; - sipQObjectType = *sipQtSupport->qt_qobject; + sipTQtSupport = client->em_qt_api; + sipTQObjectType = *sipTQtSupport->qt_qobject; } /* Append any initialiser extenders to the relevant classes. */ @@ -3727,13 +3727,13 @@ static int parsePass1(PyObject **parseErrp, sipSimpleWrapper **selfp, case 'R': { - /* Sub-class of QObject. */ + /* Sub-class of TQObject. */ PyObject **p = va_arg(va, PyObject **); if (arg != NULL) { - if (isQObject(arg)) + if (isTQObject(arg)) { *p = arg; } @@ -3796,13 +3796,13 @@ static int parsePass1(PyObject **parseErrp, sipSimpleWrapper **selfp, case 'q': { - /* Qt receiver to connect. */ + /* TQt receiver to connect. */ va_arg(va, char *); va_arg(va, void **); va_arg(va, const char **); - if (arg != NULL && !isQObject(arg)) + if (arg != NULL && !isTQObject(arg)) { failure.reason = WrongType; failure.detail_obj = arg; @@ -3814,13 +3814,13 @@ static int parsePass1(PyObject **parseErrp, sipSimpleWrapper **selfp, case 'Q': { - /* Qt receiver to disconnect. */ + /* TQt receiver to disconnect. */ va_arg(va, char *); va_arg(va, void **); va_arg(va, const char **); - if (arg != NULL && !isQObject(arg)) + if (arg != NULL && !isTQObject(arg)) { failure.reason = WrongType; failure.detail_obj = arg; @@ -3839,7 +3839,7 @@ static int parsePass1(PyObject **parseErrp, sipSimpleWrapper **selfp, va_arg(va, void **); va_arg(va, const char **); - if (arg != NULL && (sipQtSupport == NULL || !PyCallable_Check(arg))) + if (arg != NULL && (sipTQtSupport == NULL || !PyCallable_Check(arg))) { failure.reason = WrongType; failure.detail_obj = arg; @@ -3857,7 +3857,7 @@ static int parsePass1(PyObject **parseErrp, sipSimpleWrapper **selfp, va_arg(va, void **); va_arg(va, const char **); - if (arg != NULL && (sipQtSupport == NULL || !PyCallable_Check(arg))) + if (arg != NULL && (sipTQtSupport == NULL || !PyCallable_Check(arg))) { failure.reason = WrongType; failure.detail_obj = arg; @@ -4572,7 +4572,7 @@ static int parsePass2(sipSimpleWrapper *self, int selfarg, PyObject *sipArgs, case 'q': { - /* Qt receiver to connect. */ + /* TQt receiver to connect. */ char *sig = va_arg(va, char *); void **rx = va_arg(va, void **); @@ -4592,7 +4592,7 @@ static int parsePass2(sipSimpleWrapper *self, int selfarg, PyObject *sipArgs, case 'Q': { - /* Qt receiver to disconnect. */ + /* TQt receiver to disconnect. */ char *sig = va_arg(va, char *); void **rx = va_arg(va, void **); @@ -4850,11 +4850,11 @@ static int parsePass2(sipSimpleWrapper *self, int selfarg, PyObject *sipArgs, /* - * Return TRUE if an object is a QObject. + * Return TRUE if an object is a TQObject. */ -static int isQObject(PyObject *obj) +static int isTQObject(PyObject *obj) { - return (sipQtSupport != NULL && PyObject_TypeCheck(obj, sipTypeAsPyTypeObject(sipQObjectType))); + return (sipTQtSupport != NULL && PyObject_TypeCheck(obj, sipTypeAsPyTypeObject(sipTQObjectType))); } @@ -6302,7 +6302,7 @@ static void sip_api_no_method(PyObject *parseErr, const char *scope, /* - * Return a string/unicode object extracted from a particular line of a + * Return a string/tqunicode object extracted from a particular line of a * docstring. */ static PyObject *signature_FromDocstring(const char *doc, SIP_SSIZE_T line) @@ -6339,7 +6339,7 @@ static PyObject *signature_FromDocstring(const char *doc, SIP_SSIZE_T line) /* - * Return a string/unicode object that describes the given failure. + * Return a string/tqunicode object that describes the given failure. */ static PyObject *detail_FromFailure(PyObject *failure_obj) { @@ -7363,8 +7363,8 @@ void *sipGetAddress(sipSimpleWrapper *sw) /* * Get the C/C++ pointer for a complex object. Note that not casting the C++ - * pointer is a bug. However this is only ever called by PyQt3 signal emitter - * code and PyQt doesn't contain anything that multiply inherits from QObject. + * pointer is a bug. However this is only ever called by PyTQt3 signal emitter + * code and PyTQt doesn't contain anything that multiply inherits from TQObject. */ static void *sip_api_get_complex_cpp_ptr(sipSimpleWrapper *sw) { @@ -8574,7 +8574,7 @@ static int sipSimpleWrapper_init(sipSimpleWrapper *self, PyObject *args, /* * Get any keyword handler if necessary. In SIP v5 this will be - * generalised and not PyQt specific. + * generalised and not PyTQt specific. */ if (!got_kw_handler) { @@ -8584,9 +8584,9 @@ static int sipSimpleWrapper_init(sipSimpleWrapper *self, PyObject *args, /* * We are interested in unused keyword arguments if we are creating a - * QObject and we have a handler. + * TQObject and we have a handler. */ - unused_p = (kw_handler != NULL && isQObject((PyObject *)self)) ? &unused : NULL; + unused_p = (kw_handler != NULL && isTQObject((PyObject *)self)) ? &unused : NULL; unused = NULL; /* Check there is no existing C++ instance waiting to be wrapped. */ @@ -8914,7 +8914,7 @@ static void sipSimpleWrapper_dealloc(sipSimpleWrapper *self) /* * Now that the C++ object no longer exists we can tidy up the Python * object. We used to do this first but that meant lambda slots were - * removed too soon (if they were connected to QObject.destroyed()). + * removed too soon (if they were connected to TQObject.destroyed()). */ sipSimpleWrapper_clear(self); @@ -9189,7 +9189,7 @@ static int sipWrapper_clear(sipWrapper *self) vret = sipSimpleWrapper_clear(sw); /* Remove any slots connected via a proxy. */ - if (sipQtSupport != NULL && sipPossibleProxy(sw)) + if (sipTQtSupport != NULL && sipPossibleProxy(sw)) { void *tx = sipGetAddress(sw); @@ -9198,7 +9198,7 @@ static int sipWrapper_clear(sipWrapper *self) sipSlot *slot; void *context = NULL; - while ((slot = sipQtSupport->qt_find_sipslot(tx, &context)) != NULL) + while ((slot = sipTQtSupport->qt_find_sipslot(tx, &context)) != NULL) { sip_api_clear_any_slot_reference(slot); @@ -9208,12 +9208,12 @@ static int sipWrapper_clear(sipWrapper *self) } } - /* Detach children (which will be owned by C/C++). */ + /* Detach tqchildren (which will be owned by C/C++). */ while ((sw = (sipSimpleWrapper *)self->first_child) != NULL) { /* * Although this object is being garbage collected it doesn't follow - * that it's children should be. So we make sure that the child stays + * that it's tqchildren should be. So we make sure that the child stays * alive and remember we have done so. */ Py_INCREF(sw); @@ -9256,8 +9256,8 @@ static int sipWrapper_traverse(sipWrapper *self, visitproc visit, void *arg) if ((vret = sipSimpleWrapper_traverse(sw, visit, arg)) != 0) return vret; - /* This should be handwritten code in PyQt. */ - if (sipQtSupport != NULL) + /* This should be handwritten code in PyTQt. */ + if (sipTQtSupport != NULL) { void *tx = sipGetAddress(sw); @@ -9266,7 +9266,7 @@ static int sipWrapper_traverse(sipWrapper *self, visitproc visit, void *arg) sipSlot *slot; void *context = NULL; - while ((slot = sipQtSupport->qt_find_sipslot(tx, &context)) != NULL) + while ((slot = sipTQtSupport->qt_find_sipslot(tx, &context)) != NULL) { if ((vret = sip_api_visit_slot(slot, visit, arg)) != 0) return vret; @@ -9672,7 +9672,7 @@ static void forgetObject(sipSimpleWrapper *sw) * further calls that pass the instance as an argument. If this is * still in the map then it's reference count would be increased (to * one) and bad things happen when it drops back to zero again. (An - * example is PyQt events generated during the dtor call being passed + * example is PyTQt events generated during the dtor call being passed * to an event filter implemented in Python.) By removing it from the * map first we ensure that a new Python object is created. */ @@ -9788,7 +9788,7 @@ static void *sip_api_import_symbol(const char *name) /* * Visit a slot connected to an object for the cyclic garbage collector. This - * is only called externally by PyQt3. + * is only called externally by PyTQt3. */ static int sip_api_visit_slot(sipSlot *slot, visitproc visit, void *arg) { @@ -9802,7 +9802,7 @@ static int sip_api_visit_slot(sipSlot *slot, visitproc visit, void *arg) /* * Clear a slot if it has an extra reference to keep it alive. This is only - * called externally by PyQt3. + * called externally by PyTQt3. */ static void sip_api_clear_any_slot_reference(sipSlot *slot) { @@ -9888,7 +9888,7 @@ static char sip_api_string_as_ascii_char(PyObject *obj) #if PY_MAJOR_VERSION >= 3 "bytes or ASCII string of length 1 expected not '%s'", #else - "string or ASCII unicode of length 1 expected not '%s'", + "string or ASCII tqunicode of length 1 expected not '%s'", #endif Py_TYPE(obj)->tp_name); @@ -9924,7 +9924,7 @@ static char sip_api_string_as_latin1_char(PyObject *obj) #if PY_MAJOR_VERSION >= 3 "bytes or Latin-1 string of length 1 expected not '%s'", #else - "string or Latin-1 unicode of length 1 expected not '%s'", + "string or Latin-1 tqunicode of length 1 expected not '%s'", #endif Py_TYPE(obj)->tp_name); @@ -9960,7 +9960,7 @@ static char sip_api_string_as_utf8_char(PyObject *obj) #if PY_MAJOR_VERSION >= 3 "bytes or UTF-8 string of length 1 expected not '%s'", #else - "string or UTF-8 unicode of length 1 expected not '%s'", + "string or UTF-8 tqunicode of length 1 expected not '%s'", #endif Py_TYPE(obj)->tp_name); @@ -10028,7 +10028,7 @@ static const char *sip_api_string_as_ascii_string(PyObject **obj) #if PY_MAJOR_VERSION >= 3 "bytes or ASCII string expected not '%s'", #else - "string or ASCII unicode expected not '%s'", + "string or ASCII tqunicode expected not '%s'", #endif Py_TYPE(s)->tp_name); @@ -10067,7 +10067,7 @@ static const char *sip_api_string_as_latin1_string(PyObject **obj) #if PY_MAJOR_VERSION >= 3 "bytes or Latin-1 string expected not '%s'", #else - "string or Latin-1 unicode expected not '%s'", + "string or Latin-1 tqunicode expected not '%s'", #endif Py_TYPE(s)->tp_name); @@ -10106,7 +10106,7 @@ static const char *sip_api_string_as_utf8_string(PyObject **obj) #if PY_MAJOR_VERSION >= 3 "bytes or UTF-8 string expected not '%s'", #else - "string or UTF-8 unicode expected not '%s'", + "string or UTF-8 tqunicode expected not '%s'", #endif Py_TYPE(s)->tp_name); @@ -10215,7 +10215,7 @@ static int parseBytes_AsString(PyObject *obj, const char **ap) /* * Convert a Python object to a wide character. */ -static wchar_t sip_api_unicode_as_wchar(PyObject *obj) +static wchar_t sip_api_tqunicode_as_wchar(PyObject *obj) { wchar_t ch; @@ -10225,7 +10225,7 @@ static wchar_t sip_api_unicode_as_wchar(PyObject *obj) #if PY_MAJOR_VERSION >= 3 "string" #else - "unicode string" + "tqunicode string" #endif " of length 1 expected, not %s", Py_TYPE(obj)->tp_name); @@ -10239,7 +10239,7 @@ static wchar_t sip_api_unicode_as_wchar(PyObject *obj) /* * Convert a Python object to a wide character string on the heap. */ -static wchar_t *sip_api_unicode_as_wstring(PyObject *obj) +static wchar_t *sip_api_tqunicode_as_wstring(PyObject *obj) { wchar_t *p; @@ -10249,7 +10249,7 @@ static wchar_t *sip_api_unicode_as_wstring(PyObject *obj) #if PY_MAJOR_VERSION >= 3 "string" #else - "unicode string" + "tqunicode string" #endif " expected, not %s", Py_TYPE(obj)->tp_name); @@ -10437,7 +10437,7 @@ static int convertToWCharString(PyObject *obj, wchar_t **ap) /* * Convert a Python object to a wide character. */ -static int sip_api_unicode_as_wchar(PyObject *obj) +static int sip_api_tqunicode_as_wchar(PyObject *obj) { raiseNoWChar(); @@ -10448,7 +10448,7 @@ static int sip_api_unicode_as_wchar(PyObject *obj) /* * Convert a Python object to a wide character. */ -static int *sip_api_unicode_as_wstring(PyObject *obj) +static int *sip_api_tqunicode_as_wstring(PyObject *obj) { raiseNoWChar(); -- cgit v1.2.3