summaryrefslogtreecommitdiffstats
path: root/siplib/siplib.c
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-22 03:12:38 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-22 03:12:38 -0600
commit7d27356bafd5670adcc8753ab5437b3bf8ffa4be (patch)
tree959eb3757b9dc41290c81c022e45c955573e9a59 /siplib/siplib.c
parent6c4cc3653e8dd7668295f3e659b7eb4dc571b67c (diff)
downloadsip4-tqt-7d27356bafd5670adcc8753ab5437b3bf8ffa4be.tar.gz
sip4-tqt-7d27356bafd5670adcc8753ab5437b3bf8ffa4be.zip
Initial TQt conversion
Diffstat (limited to 'siplib/siplib.c')
-rw-r--r--siplib/siplib.c118
1 files changed, 59 insertions, 59 deletions
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();