diff options
Diffstat (limited to 'sipgen')
-rw-r--r-- | sipgen/export.c | 12 | ||||
-rw-r--r-- | sipgen/gencode.c | 394 | ||||
-rw-r--r-- | sipgen/lexer.c | 4 | ||||
-rw-r--r-- | sipgen/lexer.l | 4 | ||||
-rw-r--r-- | sipgen/main.c | 2 | ||||
-rw-r--r-- | sipgen/parser.c | 62 | ||||
-rw-r--r-- | sipgen/parser.h | 20 | ||||
-rw-r--r-- | sipgen/parser.y | 34 | ||||
-rw-r--r-- | sipgen/sip.h | 24 | ||||
-rw-r--r-- | sipgen/transform.c | 56 |
10 files changed, 306 insertions, 306 deletions
diff --git a/sipgen/export.c b/sipgen/export.c index 641ea32..4c741c1 100644 --- a/sipgen/export.c +++ b/sipgen/export.c @@ -762,7 +762,7 @@ static void xmlType(sipSpec *pt, argDef *ad, int sec, FILE *fp) { int a; - prcode(fp, "SLOT("); + prcode(fp, "TQT_SLOT("); for (a = 0; a < ad->u.sa->nrArgs; ++a) { @@ -956,11 +956,11 @@ static const char *pyType(sipSpec *pt, argDef *ad, int sec, classDef **scope) break; case signal_type: - type_name = "SIGNAL()"; + type_name = "TQT_SIGNAL()"; break; case slot_type: - type_name = "SLOT()"; + type_name = "TQT_SLOT()"; break; case rxcon_type: @@ -968,12 +968,12 @@ static const char *pyType(sipSpec *pt, argDef *ad, int sec, classDef **scope) if (sec) type_name = "callable"; else - type_name = "QObject"; + type_name = TQOBJECT_OBJECT_NAME_STRING; break; case qobject_type: - type_name = "QObject"; + type_name = TQOBJECT_OBJECT_NAME_STRING; break; case ustring_type: @@ -1044,7 +1044,7 @@ static const char *pyType(sipSpec *pt, argDef *ad, int sec, classDef **scope) case slotcon_type: case anyslot_type: - type_name = "SLOT()"; + type_name = "TQT_SLOT()"; break; default: diff --git a/sipgen/gencode.c b/sipgen/gencode.c index b0c3d01..bd9fc11 100644 --- a/sipgen/gencode.c +++ b/sipgen/gencode.c @@ -500,10 +500,10 @@ static void generateInternalAPIHeader(sipSpec *pt, moduleDef *mod, , mname , mname); - if (pluginPyQt4(pt)) + if (pluginPyTQt4(pt)) prcode(fp, "\n" -"#include <QMetaType>\n" +"#include <TQMetaType>\n" ); /* Define the enabled features. */ @@ -639,8 +639,8 @@ static void generateInternalAPIHeader(sipSpec *pt, moduleDef *mod, "#define sipString_AsLatin1String sipAPI_%s->api_string_as_latin1_string\n" "#define sipString_AsUTF8Char sipAPI_%s->api_string_as_utf8_char\n" "#define sipString_AsUTF8String sipAPI_%s->api_string_as_utf8_string\n" -"#define sipUnicode_AsWChar sipAPI_%s->api_unicode_as_wchar\n" -"#define sipUnicode_AsWString sipAPI_%s->api_unicode_as_wstring\n" +"#define sipUnicode_AsWChar sipAPI_%s->api_tqunicode_as_wchar\n" +"#define sipUnicode_AsWString sipAPI_%s->api_tqunicode_as_wstring\n" "#define sipConvertFromConstVoidPtr sipAPI_%s->api_convert_from_const_void_ptr\n" "#define sipConvertFromVoidPtrAndSize sipAPI_%s->api_convert_from_void_ptr_and_size\n" "#define sipConvertFromConstVoidPtrAndSize sipAPI_%s->api_convert_from_const_void_ptr_and_size\n" @@ -802,13 +802,13 @@ static void generateInternalAPIHeader(sipSpec *pt, moduleDef *mod, , mname, mld->module->name); } - if (pluginPyQt4(pt)) + if (pluginPyTQt4(pt)) prcode(fp, "\n" -"typedef const QMetaObject *(*sip_qt_metaobject_func)(sipSimpleWrapper *,sipTypeDef *);\n" +"typedef const TQMetaObject *(*sip_qt_metaobject_func)(sipSimpleWrapper *,sipTypeDef *);\n" "extern sip_qt_metaobject_func sip_%s_qt_metaobject;\n" "\n" -"typedef int (*sip_qt_metacall_func)(sipSimpleWrapper *,sipTypeDef *,QMetaObject::Call,int,void **);\n" +"typedef int (*sip_qt_metacall_func)(sipSimpleWrapper *,sipTypeDef *,TQMetaObject::Call,int,void **);\n" "extern sip_qt_metacall_func sip_%s_qt_metacall;\n" "\n" "typedef int (*sip_qt_metacast_func)(sipSimpleWrapper *,sipTypeDef *,const char *);\n" @@ -873,7 +873,7 @@ static void generateCompositeCpp(sipSpec *pt, const char *codeDir) "\n" " /*\n" " * Note that we don't complain if the module can't be imported. This\n" -" * is a favour to Linux distro packagers who like to split PyQt into\n" +" * is a favour to Linux distro packagers who like to split PyTQt into\n" " * different sub-packages.\n" " */\n" " if (mod)\n" @@ -1199,23 +1199,23 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir, /* * Include the library headers for types used by virtual handlers, module - * level functions, module level variables and Qt meta types. + * level functions, module level variables and TQt meta types. */ generateUsedIncludes(mod->used, fp); /* - * If there should be a Qt support API then generate stubs values for the + * If there should be a TQt support API then generate stubs values for the * optional parts. These should be undefined in %ModuleCode if a C++ * implementation is provided. */ if (mod->qobjclass >= 0) prcode(fp, "\n" -"#define sipQtCreateUniversalSignal 0\n" -"#define sipQtFindUniversalSignal 0\n" -"#define sipQtEmitSignal 0\n" -"#define sipQtConnectPySignal 0\n" -"#define sipQtDisconnectPySignal 0\n" +"#define sipTQtCreateUniversalSignal 0\n" +"#define sipTQtFindUniversalSignal 0\n" +"#define sipTQtEmitSignal 0\n" +"#define sipTQtConnectPySignal 0\n" +"#define sipTQtDisconnectPySignal 0\n" ); /* Define the names. */ @@ -1394,7 +1394,7 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir, prcode(fp, " {%d, \"", cd->iff->ifacenr); - prScopedName(fp, classFQCName(cd), "."); + prScopedName(fp, classFTQCName(cd), "."); prcode(fp,"\"},\n" ); } @@ -1620,7 +1620,7 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir, continue; prcode(fp, -" {sipSubClass_%C, ",classFQCName(cd)); +" {sipSubClass_%C, ",classFTQCName(cd)); generateEncodedType(mod, cd->subbase, 0, fp); @@ -1787,27 +1787,27 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir, "};\n" ); - /* Generate any Qt support API. */ + /* Generate any TQt support API. */ if (mod->qobjclass >= 0) prcode(fp, "\n" "\n" -"/* This defines the Qt support API. */\n" +"/* This defines the TQt support API. */\n" "\n" -"static sipQtAPI qtAPI = {\n" +"static sipTQtAPI qtAPI = {\n" " &typesTable[%d],\n" -" sipQtCreateUniversalSignal,\n" -" sipQtFindUniversalSignal,\n" -" sipQtCreateUniversalSlot,\n" -" sipQtDestroyUniversalSlot,\n" -" sipQtFindSlot,\n" -" sipQtConnect,\n" -" sipQtDisconnect,\n" -" sipQtSameSignalSlotName,\n" -" sipQtFindSipslot,\n" -" sipQtEmitSignal,\n" -" sipQtConnectPySignal,\n" -" sipQtDisconnectPySignal\n" +" sipTQtCreateUniversalSignal,\n" +" sipTQtFindUniversalSignal,\n" +" sipTQtCreateUniversalSlot,\n" +" sipTQtDestroyUniversalSlot,\n" +" sipTQtFindSlot,\n" +" sipTQtConnect,\n" +" sipTQtDisconnect,\n" +" sipTQtSameSignalSlotName,\n" +" sipTQtFindSipslot,\n" +" sipTQtEmitSignal,\n" +" sipTQtConnectPySignal,\n" +" sipTQtDisconnectPySignal\n" "};\n" , mod->qobjclass); @@ -1889,7 +1889,7 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir, "const sipExportedModuleDef *sipModuleAPI_%s_%s;\n" , mname, mld->module->name); - if (pluginPyQt4(pt)) + if (pluginPyTQt4(pt)) prcode(fp, "\n" "sip_qt_metaobject_func sip_%s_qt_metaobject;\n" @@ -2016,7 +2016,7 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir, " }\n" , mname); - if (pluginPyQt4(pt)) + if (pluginPyTQt4(pt)) { /* Import the helpers. */ prcode(fp, @@ -2161,7 +2161,7 @@ static void generateTypesTable(sipSpec *pt, moduleDef *mod, FILE *fp) argDef *ad; const char *type_suffix; - type_suffix = (pluginPyQt4(pt) || pluginPyQt3(pt)) ? ".super" : ""; + type_suffix = (pluginPyTQt4(pt) || pluginPyTQt3(pt)) ? ".super" : ""; prcode(fp, "\n" @@ -2389,7 +2389,7 @@ static int generateSubClassConvertors(sipSpec *pt, moduleDef *mod, FILE *fp) if (!generating_c) prcode(fp, "extern \"C\" {static const sipTypeDef *sipSubClass_%C(void **);}\n" - , classFQCName(cd)); + , classFTQCName(cd)); /* Allow the deprecated use of sipClass rather than sipType. */ needs_sipClass = usedInCode(cd->convtosubcode, "sipClass"); @@ -2398,8 +2398,8 @@ static int generateSubClassConvertors(sipSpec *pt, moduleDef *mod, FILE *fp) "static const sipTypeDef *sipSubClass_%C(void **sipCppRet)\n" "{\n" " %S *sipCpp = reinterpret_cast<%S *>(*sipCppRet);\n" - , classFQCName(cd) - , classFQCName(cd->subbase), classFQCName(cd->subbase)); + , classFTQCName(cd) + , classFTQCName(cd->subbase), classFTQCName(cd->subbase)); if (needs_sipClass) prcode(fp, @@ -2740,11 +2740,11 @@ static int generateEnumMemberTable(sipSpec *pt, moduleDef *mod, classDef *cd, if (cd != NULL) { if (isProtectedEnum(emd->ed)) - prcode(fp, "sip%C::", classFQCName(cd)); + prcode(fp, "sip%C::", classFTQCName(cd)); else if (isProtectedClass(cd)) prcode(fp, "%U::", cd); else - prcode(fp, "%S::", classFQCName(cd)); + prcode(fp, "%S::", classFTQCName(cd)); } else if (mtd != NULL) { @@ -2859,7 +2859,7 @@ static void generateTypesInline(sipSpec *pt, moduleDef *mod, FILE *fp) if (vd->ecd == NULL) prcode(fp, "sipModuleDict"); else - prcode(fp, "(PyObject *)sipTypeAsPyTypeObject(sipType_%C)", classFQCName(vd->ecd)); + prcode(fp, "(PyObject *)sipTypeAsPyTypeObject(sipType_%C)", classFTQCName(vd->ecd)); prcode(fp, ",%N,", vd->pyname); @@ -2870,7 +2870,7 @@ static void generateTypesInline(sipSpec *pt, moduleDef *mod, FILE *fp) if (vd->type.atype == class_type) prcode(fp, ",sipType_%C);\n" - , classFQCName(vd->type.u.cd)); + , classFTQCName(vd->type.u.cd)); else if (vd->type.atype == enum_type) prcode(fp, ",sipType_%C);\n" , vd->type.u.ed->fqcname); @@ -2921,7 +2921,7 @@ static int generateClasses(sipSpec *pt, moduleDef *mod, classDef *cd, FILE *fp) "\n" "/* Define the class and enum instances to be added to this type dictionary. */\n" "static sipTypeInstanceDef typeInstances_%C[] = {\n" - , classFQCName(cd)); + , classFTQCName(cd)); else prcode(fp, "\n" @@ -2938,7 +2938,7 @@ static int generateClasses(sipSpec *pt, moduleDef *mod, classDef *cd, FILE *fp) if (vd->type.atype == class_type) { - scopedNameDef *vcname = classFQCName(vd->type.u.cd); + scopedNameDef *vcname = classFTQCName(vd->type.u.cd); if (vd->accessfunc != NULL) { @@ -3007,7 +3007,7 @@ static int generateVoidPointers(sipSpec *pt, moduleDef *mod, classDef *cd, "\n" "/* Define the void pointers to be added to this type dictionary. */\n" "static sipVoidPtrInstanceDef voidPtrInstances_%C[] = {\n" - , classFQCName(cd)); + , classFTQCName(cd)); else prcode(fp, "\n" @@ -3071,7 +3071,7 @@ static int generateChars(sipSpec *pt, moduleDef *mod, classDef *cd, FILE *fp) "\n" "/* Define the chars to be added to this type dictionary. */\n" "static sipCharInstanceDef charInstances_%C[] = {\n" - , classFQCName(cd)); + , classFTQCName(cd)); else prcode(fp, "\n" @@ -3130,7 +3130,7 @@ static int generateStrings(sipSpec *pt, moduleDef *mod, classDef *cd, FILE *fp) "\n" "/* Define the strings to be added to this type dictionary. */\n" "static sipStringInstanceDef stringInstances_%C[] = {\n" - , classFQCName(cd)); + , classFTQCName(cd)); else prcode(fp, "\n" @@ -3247,7 +3247,7 @@ static void ints_intro(classDef *cd, FILE *fp) "\n" "/* Define the ints to be added to this type dictionary. */\n" "static sipIntInstanceDef intInstances_%C[] = {\n" - ,classFQCName(cd)); + ,classFTQCName(cd)); else prcode(fp, "\n" @@ -3336,7 +3336,7 @@ static int generateVariableType(sipSpec *pt, moduleDef *mod, classDef *cd, "/* Define the %ss to be added to this type dictionary. */\n" "static sip%sInstanceDef %sInstances_%C[] = {\n" , eng - , s1, s2, classFQCName(cd)); + , s1, s2, classFTQCName(cd)); else prcode(fp, "\n" @@ -3396,7 +3396,7 @@ static int generateDoubles(sipSpec *pt, moduleDef *mod, classDef *cd, FILE *fp) "\n" "/* Define the doubles to be added to this type dictionary. */\n" "static sipDoubleInstanceDef doubleInstances_%C[] = {\n" - , classFQCName(cd)); + , classFTQCName(cd)); else prcode(fp, "\n" @@ -3813,7 +3813,7 @@ static void generateTypeDefLink(sipSpec *pt, ifaceFileDef *iff, FILE *fp) if (iff->next_alt->type == mappedtype_iface) prcode(fp, ".mtd_base"); - else if (pluginPyQt3(pt) || pluginPyQt4(pt)) + else if (pluginPyTQt3(pt) || pluginPyTQt4(pt)) prcode(fp, ".super.ctd_base"); else prcode(fp, ".ctd_base"); @@ -4230,11 +4230,11 @@ static void generateVariableGetter(ifaceFileDef *scope, varDef *vd, FILE *fp) if (generating_c) prcode(fp, " %S *sipCpp = (%S *)sipSelf;\n" - , classFQCName(vd->ecd), classFQCName(vd->ecd)); + , classFTQCName(vd->ecd), classFTQCName(vd->ecd)); else prcode(fp, " %S *sipCpp = reinterpret_cast<%S *>(sipSelf);\n" - , classFQCName(vd->ecd), classFQCName(vd->ecd)); + , classFTQCName(vd->ecd), classFTQCName(vd->ecd)); prcode(fp, "\n" @@ -4559,11 +4559,11 @@ static void generateVariableSetter(ifaceFileDef *scope, varDef *vd, FILE *fp) if (generating_c) prcode(fp, " %S *sipCpp = (%S *)sipSelf;\n" - , classFQCName(vd->ecd), classFQCName(vd->ecd)); + , classFTQCName(vd->ecd), classFTQCName(vd->ecd)); else prcode(fp, " %S *sipCpp = reinterpret_cast<%S *>(sipSelf);\n" - , classFQCName(vd->ecd), classFQCName(vd->ecd)); + , classFTQCName(vd->ecd), classFTQCName(vd->ecd)); prcode(fp, "\n" @@ -4656,7 +4656,7 @@ static void generateVariableSetter(ifaceFileDef *scope, varDef *vd, FILE *fp) prcode(fp, "\n" " sipReleaseType(sipVal, sipType_%C, sipValState);\n" - , classFQCName(vd->type.u.cd)); + , classFTQCName(vd->type.u.cd)); else if (vd->type.atype == mapped_type && vd->type.nrderefs == 0 && !noRelease(vd->type.u.mtd)) prcode(fp, "\n" @@ -4702,7 +4702,7 @@ static void generateVariableSetter(ifaceFileDef *scope, varDef *vd, FILE *fp) static void generateVarMember(varDef *vd, FILE *fp) { if (isStaticVar(vd)) - prcode(fp,"%S::",classFQCName(vd->ecd)); + prcode(fp,"%S::",classFTQCName(vd->ecd)); else prcode(fp,"sipCpp->"); @@ -4772,7 +4772,7 @@ static int generateObjToCppConversion(argDef *ad,FILE *fp) * all types). */ - prcode(fp, "sipForceConvertToType(sipPy,sipType_%C,NULL,%s,%s,&sipIsErr)", classFQCName(ad->u.cd), (ad->nrderefs ? "0" : "SIP_NOT_NONE"), (might_be_temp ? "&sipValState" : "NULL")); + prcode(fp, "sipForceConvertToType(sipPy,sipType_%C,NULL,%s,%s,&sipIsErr)", classFTQCName(ad->u.cd), (ad->nrderefs ? "0" : "SIP_NOT_NONE"), (might_be_temp ? "&sipValState" : "NULL")); prcode(fp, "%s;\n" , tail); @@ -5078,7 +5078,7 @@ static void generateSlot(moduleDef *mod, classDef *cd, enumDef *ed, { prefix = "Type"; pyname = cd->pyname; - fqcname = classFQCName(cd); + fqcname = classFTQCName(cd); overs = cd->overs; } else @@ -5335,7 +5335,7 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd, for (md = cd->members; md != NULL; md = md->next) if (cd->iff->type == namespace_iface) generateOrdinaryFunction(pt, mod, cd, NULL, md, fp); - else if (md->slot != no_slot && md->slot != unicode_slot) + else if (md->slot != no_slot && md->slot != tqunicode_slot) generateSlot(mod, cd, NULL, md, fp); if (cd->iff->type != namespace_iface && !generating_c) @@ -5363,7 +5363,7 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd, prcode(fp, " if (targetType == sipType_%C)\n" " return ptr;\n" - ,classFQCName(cd)); + ,classFTQCName(cd)); for (cl = cd->supers; cl != NULL; cl = cl->next) { @@ -5373,7 +5373,7 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd, "\n" " if ((res = ((const sipClassTypeDef *)sipType_%C)->ctd_cast((%S *)(%S *)ptr,targetType)) != NULL)\n" " return res;\n" - ,sname,sname,classFQCName(cd)); + ,sname,sname,classFTQCName(cd)); } prcode(fp, @@ -5454,7 +5454,7 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd, prcode(fp, " if (sipState & SIP_DERIVED_CLASS)\n" " delete reinterpret_cast<sip%C *>(sipCppV);\n" - , classFQCName(cd)); + , classFTQCName(cd)); if (isPublicDtor(cd)) prcode(fp, @@ -5490,12 +5490,12 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd, if (!generating_c) prcode(fp, "extern \"C\" {static int traverse_%C(void *, visitproc, void *);}\n" - , classFQCName(cd)); + , classFTQCName(cd)); prcode(fp, "static int traverse_%C(void *sipCppV,visitproc sipVisit,void *sipArg)\n" "{\n" -" ", classFQCName(cd)); +" ", classFTQCName(cd)); generateClassFromVoid(cd, "sipCpp", "sipCppV", fp); @@ -5524,12 +5524,12 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd, if (!generating_c) prcode(fp, "extern \"C\" {static int clear_%C(void *);}\n" - , classFQCName(cd)); + , classFTQCName(cd)); prcode(fp, "static int clear_%C(void *sipCppV)\n" "{\n" -" ", classFQCName(cd)); +" ", classFTQCName(cd)); generateClassFromVoid(cd, "sipCpp", "sipCppV", fp); @@ -5561,12 +5561,12 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd, if (!generating_c) prcode(fp, "extern \"C\" {static int getbuffer_%C(PyObject *, void *, Py_buffer *, int);}\n" - , classFQCName(cd)); + , classFTQCName(cd)); prcode(fp, "static int getbuffer_%C(PyObject *%s, void *%s, Py_buffer *sipBuffer, int %s)\n" "{\n" - , classFQCName(cd), argName("sipSelf", cd->getbufcode), (generating_c || need_cpp ? "sipCppV" : ""), argName("sipFlags", cd->getbufcode)); + , classFTQCName(cd), argName("sipSelf", cd->getbufcode), (generating_c || need_cpp ? "sipCppV" : ""), argName("sipFlags", cd->getbufcode)); if (need_cpp) { @@ -5602,12 +5602,12 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd, if (!generating_c) prcode(fp, "extern \"C\" {static void releasebuffer_%C(PyObject *, void *, Py_buffer *);}\n" - , classFQCName(cd)); + , classFTQCName(cd)); prcode(fp, "static void releasebuffer_%C(PyObject *%s, void *sipCppV, Py_buffer *)\n" "{\n" -" ", classFQCName(cd) +" ", classFTQCName(cd) , argName("sipSelf", cd->releasebufcode)); generateClassFromVoid(cd, "sipCpp", "sipCppV", fp); @@ -5635,12 +5635,12 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd, if (!generating_c) prcode(fp, "extern \"C\" {static SIP_SSIZE_T getreadbuffer_%C(PyObject *, void *, SIP_SSIZE_T, void **);}\n" - , classFQCName(cd)); + , classFTQCName(cd)); prcode(fp, "static SIP_SSIZE_T getreadbuffer_%C(PyObject *%s, void *sipCppV, SIP_SSIZE_T %s, void **%s)\n" "{\n" -" ", classFQCName(cd) +" ", classFTQCName(cd) , argName("sipSelf", cd->readbufcode) , argName("sipSegment", cd->readbufcode) , argName("sipPtrPtr", cd->readbufcode)); @@ -5673,12 +5673,12 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd, if (!generating_c) prcode(fp, "extern \"C\" {static SIP_SSIZE_T getwritebuffer_%C(PyObject *, void *, SIP_SSIZE_T, void **);}\n" - , classFQCName(cd)); + , classFTQCName(cd)); prcode(fp, "static SIP_SSIZE_T getwritebuffer_%C(PyObject *%s, void *sipCppV, SIP_SSIZE_T %s, void **%s)\n" "{\n" -" ", classFQCName(cd) +" ", classFTQCName(cd) , argName("sipSelf", cd->writebufcode) , argName("sipSegment", cd->writebufcode) , argName("sipPtrPtr", cd->writebufcode)); @@ -5711,12 +5711,12 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd, if (!generating_c) prcode(fp, "extern \"C\" {static SIP_SSIZE_T getsegcount_%C(PyObject *, void *, SIP_SSIZE_T *);}\n" - , classFQCName(cd)); + , classFTQCName(cd)); prcode(fp, "static SIP_SSIZE_T getsegcount_%C(PyObject *%s, void *sipCppV, SIP_SSIZE_T *%s)\n" "{\n" -" ", classFQCName(cd) +" ", classFTQCName(cd) , argName("sipSelf", cd->segcountcode) , argName("sipLenPtr", cd->segcountcode)); @@ -5748,12 +5748,12 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd, if (!generating_c) prcode(fp, "extern \"C\" {static SIP_SSIZE_T getcharbuffer_%C(PyObject *, void *, SIP_SSIZE_T, void **);}\n" - , classFQCName(cd)); + , classFTQCName(cd)); prcode(fp, "static SIP_SSIZE_T getcharbuffer_%C(PyObject *%s, void *sipCppV, SIP_SSIZE_T %s, void **%s)\n" "{\n" -" ", classFQCName(cd) +" ", classFTQCName(cd) , argName("sipSelf", cd->charbufcode) , argName("sipSegment", cd->charbufcode) , argName("sipPtrPtr", cd->charbufcode)); @@ -5786,12 +5786,12 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd, if (!generating_c) prcode(fp, "extern \"C\" {static PyObject *pickle_%C(void *);}\n" - , classFQCName(cd)); + , classFTQCName(cd)); prcode(fp, "static PyObject *pickle_%C(void *sipCppV)\n" "{\n" -" ", classFQCName(cd)); +" ", classFTQCName(cd)); generateClassFromVoid(cd, "sipCpp", "sipCppV", fp); @@ -5830,11 +5830,11 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd, if (generating_c) prcode(fp, " ((%S *)sipDst)[sipDstIdx] = *((const %S *)sipSrc);\n" - , classFQCName(cd), classFQCName(cd)); + , classFTQCName(cd), classFTQCName(cd)); else prcode(fp, " reinterpret_cast<%S *>(sipDst)[sipDstIdx] = *reinterpret_cast<const %S *>(sipSrc);\n" - , classFQCName(cd), classFQCName(cd)); + , classFTQCName(cd), classFTQCName(cd)); prcode(fp, "}\n" @@ -5859,11 +5859,11 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd, if (generating_c) prcode(fp, " return sipMalloc(sizeof (%S) * sipNrElem);\n" - , classFQCName(cd)); + , classFTQCName(cd)); else prcode(fp, " return new %S[sipNrElem];\n" - , classFQCName(cd)); + , classFTQCName(cd)); prcode(fp, "}\n" @@ -5891,12 +5891,12 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd, " *sipPtr = ((const %S *)sipSrc)[sipSrcIdx];\n" "\n" " return sipPtr;\n" - , classFQCName(cd), classFQCName(cd) - , classFQCName(cd)); + , classFTQCName(cd), classFTQCName(cd) + , classFTQCName(cd)); else prcode(fp, " return new %S(reinterpret_cast<const %S *>(sipSrc)[sipSrcIdx]);\n" - , classFQCName(cd), classFQCName(cd)); + , classFTQCName(cd), classFTQCName(cd)); prcode(fp, "}\n" @@ -5933,7 +5933,7 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd, " if (sipIsDerived(sipSelf))\n" " reinterpret_cast<sip%C *>(sipSelf->u.cppPtr)->sipPySelf = NULL;\n" "\n" - ,classFQCName(cd)); + ,classFTQCName(cd)); if (generating_c || isPublicDtor(cd) || (hasShadow(cd) && isProtectedDtor(cd))) { @@ -6005,11 +6005,11 @@ static void generateShadowCode(sipSpec *pt, moduleDef *mod, classDef *cd, prcode(fp, "\n" -"sip%C::sip%C(",classFQCName(cd),classFQCName(cd)); +"sip%C::sip%C(",classFTQCName(cd),classFTQCName(cd)); generateCalledArgs(cd->iff, ct->cppsig, Definition, TRUE, fp); - prcode(fp,")%X: %S(",ct->exceptions,classFQCName(cd)); + prcode(fp,")%X: %S(",ct->exceptions,classFTQCName(cd)); generateProtectedCallArgs(ct->cppsig, fp); @@ -6020,7 +6020,7 @@ static void generateShadowCode(sipSpec *pt, moduleDef *mod, classDef *cd, if (tracing) { prcode(fp, -" sipTrace(SIP_TRACE_CTORS,\"sip%C::sip%C(",classFQCName(cd),classFQCName(cd)); +" sipTrace(SIP_TRACE_CTORS,\"sip%C::sip%C(",classFTQCName(cd),classFTQCName(cd)); generateCalledArgs(cd->iff, ct->cppsig, Declaration, TRUE, fp); prcode(fp,")%X (this=0x%%08x)\\n\",this);\n" "\n" @@ -6045,13 +6045,13 @@ static void generateShadowCode(sipSpec *pt, moduleDef *mod, classDef *cd, "\n" "sip%C::~sip%C()%X\n" "{\n" - ,classFQCName(cd),classFQCName(cd),cd->dtorexceptions); + ,classFTQCName(cd),classFTQCName(cd),cd->dtorexceptions); if (tracing) prcode(fp, " sipTrace(SIP_TRACE_DTORS,\"sip%C::~sip%C()%X (this=0x%%08x)\\n\",this);\n" "\n" - ,classFQCName(cd),classFQCName(cd),cd->dtorexceptions); + ,classFTQCName(cd),classFTQCName(cd),cd->dtorexceptions); if (cd->dtorcode != NULL) generateCppCodeBlock(cd->dtorcode,fp); @@ -6063,21 +6063,21 @@ static void generateShadowCode(sipSpec *pt, moduleDef *mod, classDef *cd, } /* The meta methods if required. */ - if (pluginPyQt4(pt) && isQObjectSubClass(cd)) + if (pluginPyTQt4(pt) && isTQObjectSubClass(cd)) { - if (!noPyQt4QMetaObject(cd)) + if (!noPyTQt4TQMetaObject(cd)) prcode(fp, "\n" -"const QMetaObject *sip%C::metaObject() const\n" +"const TQMetaObject *sip%C::tqmetaObject() const\n" "{\n" " return sip_%s_qt_metaobject(sipPySelf,sipType_%C);\n" "}\n" - , classFQCName(cd) - , mod->name, classFQCName(cd)); + , classFTQCName(cd) + , mod->name, classFTQCName(cd)); prcode(fp, "\n" -"int sip%C::qt_metacall(QMetaObject::Call _c,int _id,void **_a)\n" +"int sip%C::qt_metacall(TQMetaObject::Call _c,int _id,void **_a)\n" "{\n" " _id = %S::qt_metacall(_c,_id,_a);\n" "\n" @@ -6091,11 +6091,11 @@ static void generateShadowCode(sipSpec *pt, moduleDef *mod, classDef *cd, "{\n" " return (sip_%s_qt_metacast && sip_%s_qt_metacast(sipPySelf,sipType_%C,_clname)) ? this : %S::qt_metacast(_clname);\n" "}\n" - , classFQCName(cd) - , classFQCName(cd) - , mod->name, classFQCName(cd) - , classFQCName(cd) - , mod->name, mod->name, classFQCName(cd), classFQCName(cd)); + , classFTQCName(cd) + , classFTQCName(cd) + , mod->name, classFTQCName(cd) + , classFTQCName(cd) + , mod->name, mod->name, classFTQCName(cd), classFTQCName(cd)); } /* Generate the virtual catchers. */ @@ -6129,7 +6129,7 @@ static void generateShadowCode(sipSpec *pt, moduleDef *mod, classDef *cd, generateProtectedDefinitions(cd,fp); /* Generate the emitters if needed. */ - if (pluginPyQt3(pt)) + if (pluginPyTQt3(pt)) generateEmitters(cd, fp); } @@ -6171,15 +6171,15 @@ static void generateEmitters(classDef *cd, FILE *fp) prcode(fp, "\n" -"static pyqt3QtSignal signals_%C[] = {\n" - ,classFQCName(cd)); +"static pyqt3TQtSignal signals_%C[] = {\n" + ,classFTQCName(cd)); noIntro = FALSE; } prcode(fp, " {%N, %C_emit_%s},\n" - ,vl->m->pyname,classFQCName(cd),vl->m->pyname->text); + ,vl->m->pyname,classFTQCName(cd),vl->m->pyname->text); break; } @@ -6232,7 +6232,7 @@ static void generateProtectedEnums(sipSpec *pt,classDef *cd,FILE *fp) for (emd = ed->members; emd != NULL; emd = emd->next) { prcode(fp,"%s" -" %s = %S::%s",eol,emd->cname,classFQCName(ed->ecd),emd->cname); +" %s = %S::%s",eol,emd->cname,classFTQCName(ed->ecd),emd->cname); eol = ",\n"; } @@ -6266,7 +6266,7 @@ static void generateVirtualCatcher(moduleDef *mod, classDef *cd, int virtNr, generateBaseType(cd->iff, &od->cppsig->result, TRUE, fp); - prcode(fp," sip%C::%O(",classFQCName(cd),od); + prcode(fp," sip%C::%O(",classFTQCName(cd),od); generateCalledArgs(cd->iff, od->cppsig, Definition, TRUE, fp); prcode(fp,")%s%X\n" "{\n" @@ -6278,7 +6278,7 @@ static void generateVirtualCatcher(moduleDef *mod, classDef *cd, int virtNr, " sipTrace(SIP_TRACE_CATCHERS,\""); generateBaseType(cd->iff, &od->cppsig->result, TRUE, fp); - prcode(fp," sip%C::%O(",classFQCName(cd),od); + prcode(fp," sip%C::%O(",classFTQCName(cd),od); generateCalledArgs(cd->iff, od->cppsig, Declaration, TRUE, fp); prcode(fp,")%s%X (this=0x%%08x)\\n\",this);\n" "\n" @@ -6394,7 +6394,7 @@ static void generateVirtualCatcher(moduleDef *mod, classDef *cd, int virtNr, /* Check that it has an API specified. */ if (avr == NULL) { - fatalScopedName(classFQCName(cd)); + fatalScopedName(classFTQCName(cd)); fatal("::"); prOverloadName(stderr, od); fatal(" has versioned and unversioned overloads\n"); @@ -6590,7 +6590,7 @@ static void generateUnambiguousClass(classDef *cd,classDef *scope,FILE *fp) for (cl = sub->cd->supers; cl != NULL; cl = cl->next) if (cl->cd == mro->cd) { - prcode(fp,"%S",classFQCName(sub->cd)); + prcode(fp,"%S",classFTQCName(sub->cd)); return; } @@ -6604,7 +6604,7 @@ static void generateUnambiguousClass(classDef *cd,classDef *scope,FILE *fp) } /* If we got here there is nothing to worry about. */ - prcode(fp,"%S",classFQCName(scope)); + prcode(fp,"%S",classFTQCName(scope)); } @@ -6685,7 +6685,7 @@ static void generateVirtHandlerErrorReturn(argDef *res, const char *indent, } else { - fatalScopedName(classFQCName(res->u.cd)); + fatalScopedName(classFTQCName(res->u.cd)); fatal(" must have a default constructor\n"); } } @@ -6757,7 +6757,7 @@ static void generateEmitter(classDef *cd, visibleList *vl, FILE *fp) "int sip%C::sipEmit_%s(PyObject *sipArgs)\n" "{\n" " PyObject *sipParseErr = NULL;\n" - ,classFQCName(cd),pname); + ,classFTQCName(cd),pname); for (od = vl->cd->overs; od != NULL; od = od->next) { @@ -6822,7 +6822,7 @@ static void generateEmitter(classDef *cd, visibleList *vl, FILE *fp) if (!generating_c) prcode(fp, "extern \"C\" {static int %C_emit_%s(sipSimpleWrapper *, PyObject *);}\n" - , classFQCName(cd), pname); + , classFTQCName(cd), pname); prcode(fp, "static int %C_emit_%s(sipSimpleWrapper *sw,PyObject *sipArgs)\n" @@ -6831,8 +6831,8 @@ static void generateEmitter(classDef *cd, visibleList *vl, FILE *fp) "\n" " return (ptr ? ptr->sipEmit_%s(sipArgs) : -1);\n" "}\n" - ,classFQCName(cd),pname - ,classFQCName(cd),classFQCName(cd) + ,classFTQCName(cd),pname + ,classFTQCName(cd),classFTQCName(cd) ,pname); } @@ -6943,13 +6943,13 @@ static void generateProtectedDefinitions(classDef *cd,FILE *fp) if (!isStatic(od) && !isAbstract(od) && (isVirtual(od) || isVirtualReimp(od))) { - prcode(fp, " sip%C::sipProtectVirt_%s(bool sipSelfWasArg", classFQCName(cd), mname); + prcode(fp, " sip%C::sipProtectVirt_%s(bool sipSelfWasArg", classFTQCName(cd), mname); if (od->cppsig->nrArgs > 0) prcode(fp, ","); } else - prcode(fp, " sip%C::sipProtect_%s(", classFQCName(cd), mname); + prcode(fp, " sip%C::sipProtect_%s(", classFTQCName(cd), mname); generateCalledArgs(cd->iff, od->cppsig, Definition, TRUE, fp); prcode(fp,")%s\n" @@ -6985,7 +6985,7 @@ static void generateProtectedDefinitions(classDef *cd,FILE *fp) { if (isVirtual(od) || isVirtualReimp(od)) { - prcode(fp, "(sipSelfWasArg ? %S::%s(", classFQCName(vl->cd), mname); + prcode(fp, "(sipSelfWasArg ? %S::%s(", classFTQCName(vl->cd), mname); generateProtectedCallArgs(od->cppsig, fp); @@ -6993,7 +6993,7 @@ static void generateProtectedDefinitions(classDef *cd,FILE *fp) ++parens; } else - prcode(fp, "%S::", classFQCName(vl->cd)); + prcode(fp, "%S::", classFTQCName(vl->cd)); } prcode(fp,"%s(",mname); @@ -7380,7 +7380,7 @@ static void generateParseResultExtraArgs(argDef *ad, int argnr, FILE *fp) break; case class_type: - prcode(fp, ",sipType_%C", classFQCName(ad->u.cd)); + prcode(fp, ",sipType_%C", classFTQCName(ad->u.cd)); break; case pytuple_type: @@ -7804,9 +7804,9 @@ static void generateTupleBuilder(signatureDef *sd,FILE *fp) if (ad->atype == mapped_type) prcode(fp, ",sipType_%T", ad); else if (ad->atype == fake_void_type || ad->atype == class_type) - prcode(fp, ",sipType_%C", classFQCName(ad->u.cd)); + prcode(fp, ",sipType_%C", classFTQCName(ad->u.cd)); else - prcode(fp,",sipType_QObject"); + prcode(fp,",sipType_TQObject"); if (!isArray(ad)) prcode(fp, ",NULL"); @@ -7982,8 +7982,8 @@ static void generateImportedClassAPI(classDef *cd, sipSpec *pt, moduleDef *mod, prcode(fp, "#define sipType_%C sipModuleAPI_%s_%s->em_types[%d]\n" "#define sipClass_%C sipModuleAPI_%s_%s->em_types[%d]->u.td_wrapper_type\n" - , classFQCName(cd), mname, imname, cd->iff->ifacenr - , classFQCName(cd), mname, imname, cd->iff->ifacenr); + , classFTQCName(cd), mname, imname, cd->iff->ifacenr + , classFTQCName(cd), mname, imname, cd->iff->ifacenr); if (cd->iff->type == namespace_iface) prcode(fp, @@ -8010,8 +8010,8 @@ static void generateClassAPI(classDef *cd, sipSpec *pt, FILE *fp) prcode(fp, "#define sipType_%C sipModuleAPI_%s.em_types[%d]\n" "#define sipClass_%C sipModuleAPI_%s.em_types[%d]->u.td_wrapper_type\n" - , classFQCName(cd), mname, cd->iff->ifacenr - , classFQCName(cd), mname, cd->iff->ifacenr); + , classFTQCName(cd), mname, cd->iff->ifacenr + , classFTQCName(cd), mname, cd->iff->ifacenr); generateEnumMacros(pt, cd->iff->module, cd, NULL, fp); @@ -8019,9 +8019,9 @@ static void generateClassAPI(classDef *cd, sipSpec *pt, FILE *fp) { const char *type_prefix; - if (pluginPyQt4(pt)) + if (pluginPyTQt4(pt)) type_prefix = "pyqt4"; - else if (pluginPyQt3(pt)) + else if (pluginPyTQt3(pt)) type_prefix = "pyqt3"; else type_prefix = "sip"; @@ -8107,7 +8107,7 @@ static void generateShadowClassDeclaration(sipSpec *pt,classDef *cd,FILE *fp) "class sip%C : public %S\n" "{\n" "public:\n" - ,classFQCName(cd),classFQCName(cd)); + ,classFTQCName(cd),classFTQCName(cd)); /* Define a shadow class for any protected classes we have. */ @@ -8160,7 +8160,7 @@ static void generateShadowClassDeclaration(sipSpec *pt,classDef *cd,FILE *fp) continue; prcode(fp, -" sip%C(",classFQCName(cd)); +" sip%C(",classFTQCName(cd)); generateCalledArgs(cd->iff, ct->cppsig, Declaration, TRUE, fp); @@ -8173,20 +8173,20 @@ static void generateShadowClassDeclaration(sipSpec *pt,classDef *cd,FILE *fp) if (!isPrivateDtor(cd)) prcode(fp, " %s~sip%C()%X;\n" - ,(cd->vmembers != NULL ? "virtual " : ""),classFQCName(cd),cd->dtorexceptions); + ,(cd->vmembers != NULL ? "virtual " : ""),classFTQCName(cd),cd->dtorexceptions); /* The metacall methods if required. */ - if (pluginPyQt4(pt) && isQObjectSubClass(cd)) + if (pluginPyTQt4(pt) && isTQObjectSubClass(cd)) { prcode(fp, "\n" -" int qt_metacall(QMetaObject::Call,int,void **);\n" +" int qt_metacall(TQMetaObject::Call,int,void **);\n" " void *qt_metacast(const char *);\n" ); - if (!noPyQt4QMetaObject(cd)) + if (!noPyTQt4TQMetaObject(cd)) prcode(fp, -" const QMetaObject *metaObject() const;\n" +" const TQMetaObject *tqmetaObject() const;\n" ); } @@ -8199,7 +8199,7 @@ static void generateShadowClassDeclaration(sipSpec *pt,classDef *cd,FILE *fp) generateProtectedDeclarations(cd,fp); /* The public wrapper around each signal emitter. */ - if (pluginPyQt3(pt)) + if (pluginPyTQt3(pt)) { visibleList *vl; @@ -8222,7 +8222,7 @@ static void generateShadowClassDeclaration(sipSpec *pt,classDef *cd,FILE *fp) prcode(fp, "\n" " /*\n" -" * There is a public method for every Qt signal that can be emitted\n" +" * There is a public method for every TQt signal that can be emitted\n" " * by this object. This function is called by Python to emit the\n" " * signal.\n" " */\n" @@ -8293,8 +8293,8 @@ static void generateShadowClassDeclaration(sipSpec *pt,classDef *cd,FILE *fp) "private:\n" " sip%C(const sip%C &);\n" " sip%C &operator = (const sip%C &);\n" - ,classFQCName(cd),classFQCName(cd) - ,classFQCName(cd),classFQCName(cd)); + ,classFTQCName(cd),classFTQCName(cd) + ,classFTQCName(cd),classFTQCName(cd)); if ((nrVirts = countVirtuals(cd)) > 0) prcode(fp, @@ -8641,7 +8641,7 @@ static void generateNamedBaseType(ifaceFileDef *scope, argDef *ad, char *name, case rxcon_type: case rxdis_type: nr_derefs = 1; - prcode(fp, "QObject"); + prcode(fp, TQOBJECT_OBJECT_NAME_STRING); break; case mapped_type: @@ -8915,7 +8915,7 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) "\n" "\n" "/* Define this type's super-types. */\n" -"static sipEncodedTypeDef supers_%C[] = {", classFQCName(cd)); +"static sipEncodedTypeDef supers_%C[] = {", classFTQCName(cd)); for (cl = cd->supers; cl != NULL; cl = cl->next) { @@ -8983,10 +8983,10 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) nr_methods = generateClassMethodTable(pt, cd, fp); nr_enums = generateEnumMemberTable(pt, mod, cd, NULL, fp); - /* Generate the PyQt4 signals table. */ + /* Generate the PyTQt4 signals table. */ is_signals = FALSE; - if (pluginPyQt4(pt) && isQObjectSubClass(cd)) + if (pluginPyTQt4(pt) && isTQObjectSubClass(cd)) { /* The signals must be grouped by name. */ for (md = cd->members; md != NULL; md = md->next) @@ -9022,9 +9022,9 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) prcode(fp, "\n" "\n" -"/* Define this type's PyQt4 signals. */\n" -"static const pyqt4QtSignal pyqt4_signals_%C[] = {\n" - , classFQCName(cd)); +"/* Define this type's PyTQt4 signals. */\n" +"static const pyqt4TQtSignal pyqt4_signals_%C[] = {\n" + , classFTQCName(cd)); } /* @@ -9132,12 +9132,12 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) has_docstring = TRUE; } - if (pluginPyQt4(pt)) + if (pluginPyTQt4(pt)) { type_prefix = "pyqt4"; embedded = TRUE; } - else if (pluginPyQt3(pt)) + else if (pluginPyTQt3(pt)) { type_prefix = "pyqt3"; embedded = TRUE; @@ -9264,52 +9264,52 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) " {"); if (is_inst_class) - prcode(fp, "typeInstances_%C, ", classFQCName(cd)); + prcode(fp, "typeInstances_%C, ", classFTQCName(cd)); else prcode(fp, "0, "); if (is_inst_voidp) - prcode(fp, "voidPtrInstances_%C, ", classFQCName(cd)); + prcode(fp, "voidPtrInstances_%C, ", classFTQCName(cd)); else prcode(fp, "0, "); if (is_inst_char) - prcode(fp, "charInstances_%C, ", classFQCName(cd)); + prcode(fp, "charInstances_%C, ", classFTQCName(cd)); else prcode(fp, "0, "); if (is_inst_string) - prcode(fp, "stringInstances_%C, ", classFQCName(cd)); + prcode(fp, "stringInstances_%C, ", classFTQCName(cd)); else prcode(fp, "0, "); if (is_inst_int) - prcode(fp, "intInstances_%C, ", classFQCName(cd)); + prcode(fp, "intInstances_%C, ", classFTQCName(cd)); else prcode(fp, "0, "); if (is_inst_long) - prcode(fp, "longInstances_%C, ", classFQCName(cd)); + prcode(fp, "longInstances_%C, ", classFTQCName(cd)); else prcode(fp, "0, "); if (is_inst_ulong) - prcode(fp, "unsignedLongInstances_%C, ", classFQCName(cd)); + prcode(fp, "unsignedLongInstances_%C, ", classFTQCName(cd)); else prcode(fp, "0, "); if (is_inst_longlong) - prcode(fp, "longLongInstances_%C, ", classFQCName(cd)); + prcode(fp, "longLongInstances_%C, ", classFTQCName(cd)); else prcode(fp,"0, "); if (is_inst_ulonglong) - prcode(fp, "unsignedLongLongInstances_%C, ", classFQCName(cd)); + prcode(fp, "unsignedLongLongInstances_%C, ", classFTQCName(cd)); else prcode(fp, "0, "); if (is_inst_double) - prcode(fp, "doubleInstances_%C", classFQCName(cd)); + prcode(fp, "doubleInstances_%C", classFTQCName(cd)); else prcode(fp, "0"); @@ -9347,7 +9347,7 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) if (cd->supers != NULL) prcode(fp, " supers_%C,\n" - , classFQCName(cd)); + , classFTQCName(cd)); else prcode(fp, " 0,\n" @@ -9374,7 +9374,7 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) if (cd->travcode != NULL) prcode(fp, " traverse_%C,\n" - , classFQCName(cd)); + , classFTQCName(cd)); else prcode(fp, " 0,\n" @@ -9383,7 +9383,7 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) if (cd->clearcode != NULL) prcode(fp, " clear_%C,\n" - , classFQCName(cd)); + , classFTQCName(cd)); else prcode(fp, " 0,\n" @@ -9396,7 +9396,7 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) if (cd->getbufcode != NULL) prcode(fp, " getbuffer_%C,\n" - , classFQCName(cd)); + , classFTQCName(cd)); else prcode(fp, " 0,\n" @@ -9405,7 +9405,7 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) if (cd->releasebufcode != NULL) prcode(fp, " releasebuffer_%C,\n" - , classFQCName(cd)); + , classFTQCName(cd)); else prcode(fp, " 0,\n" @@ -9418,7 +9418,7 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) if (cd->readbufcode != NULL) prcode(fp, " getreadbuffer_%C,\n" - , classFQCName(cd)); + , classFTQCName(cd)); else prcode(fp, " 0,\n" @@ -9427,7 +9427,7 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) if (cd->writebufcode != NULL) prcode(fp, " getwritebuffer_%C,\n" - , classFQCName(cd)); + , classFTQCName(cd)); else prcode(fp, " 0,\n" @@ -9436,7 +9436,7 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) if (cd->segcountcode != NULL) prcode(fp, " getsegcount_%C,\n" - , classFQCName(cd)); + , classFTQCName(cd)); else prcode(fp, " 0,\n" @@ -9445,7 +9445,7 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) if (cd->charbufcode != NULL) prcode(fp, " getcharbuffer_%C,\n" - , classFQCName(cd)); + , classFTQCName(cd)); else prcode(fp, " 0,\n" @@ -9514,7 +9514,7 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) if (cd->picklecode != NULL) prcode(fp, " pickle_%C\n" - , classFQCName(cd)); + , classFTQCName(cd)); else prcode(fp, " 0\n" @@ -9525,21 +9525,21 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) "},\n" ); - if (pluginPyQt3(pt)) + if (pluginPyTQt3(pt)) { if (hasSigSlots(cd)) prcode(fp, " signals_%C\n" - , classFQCName(cd)); + , classFTQCName(cd)); else prcode(fp, " 0\n" ); } - if (pluginPyQt4(pt)) + if (pluginPyTQt4(pt)) { - if (isQObjectSubClass(cd) && !noPyQt4QMetaObject(cd)) + if (isTQObjectSubClass(cd) && !noPyTQt4TQMetaObject(cd)) prcode(fp, " &%U::staticMetaObject,\n" , cd); @@ -9555,7 +9555,7 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) if (is_signals) prcode(fp, " pyqt4_signals_%C\n" - , classFQCName(cd)); + , classFTQCName(cd)); else prcode(fp, " 0\n" @@ -9569,7 +9569,7 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) /* - * Generate an entry in the PyQt4 signal table. + * Generate an entry in the PyTQt4 signal table. */ static void generateSignalTableEntry(sipSpec *pt, classDef *cd, overDef *sig, memberDef *md, int membernr, FILE *fp) @@ -9917,7 +9917,7 @@ static void generateTypeInit(classDef *cd, moduleDef *mod, FILE *fp) if (hasShadow(cd)) prcode(fp, " sip%C *sipCpp = 0;\n" - ,classFQCName(cd)); + ,classFTQCName(cd)); else prcode(fp, " %U *sipCpp = 0;\n" @@ -10196,7 +10196,7 @@ static void generateConstructorCall(classDef *cd, ctorDef *ct, int error_flag, else if (generating_c) prcode(fp, " sipCpp = sipMalloc(sizeof (%S));\n" - ,classFQCName(cd)); + ,classFTQCName(cd)); else { int rgil = ((release_gil || isReleaseGILCtor(ct)) && !isHoldGILCtor(ct)); @@ -10210,7 +10210,7 @@ static void generateConstructorCall(classDef *cd, ctorDef *ct, int error_flag, if (hasShadow(cd)) prcode(fp, -" sipCpp = new sip%C(",classFQCName(cd)); +" sipCpp = new sip%C(",classFTQCName(cd)); else prcode(fp, " sipCpp = new %U(",cd); @@ -10796,7 +10796,7 @@ static void generateHandleResult(overDef *od, int isNew, int result_size, if (ad->atype == mapped_type) prcode(fp, ",sipType_%T,%s", ad, (isTransferredBack(ad) ? "Py_None" : "NULL")); else if (ad->atype == class_type) - prcode(fp, ",sipType_%C,%s", classFQCName(ad->u.cd), (isTransferredBack(ad) ? "Py_None" : "NULL")); + prcode(fp, ",sipType_%C,%s", classFTQCName(ad->u.cd), (isTransferredBack(ad) ? "Py_None" : "NULL")); else if (ad->atype == enum_type && ad->u.ed->fqcname != NULL) prcode(fp,",sipType_%C", ad->u.ed->fqcname); } @@ -11881,7 +11881,7 @@ static int generateArgParser(signatureDef *sd, classDef *c_scope, mappedTypeDef *mt_scope, ctorDef *ct, overDef *od, int secCall, FILE *fp) { - int a, isQtSlot, optargs, arraylenarg, sigarg, handle_self, single_arg; + int a, isTQtSlot, optargs, arraylenarg, sigarg, handle_self, single_arg; int slotconarg, slotdisarg, need_owner; ifaceFileDef *scope; @@ -11903,8 +11903,8 @@ static int generateArgParser(signatureDef *sd, classDef *c_scope, handle_self = (od != NULL && od->common->slot == no_slot && !isStatic(od) && c_scope != NULL); - /* Assume there isn't a Qt slot. */ - isQtSlot = FALSE; + /* Assume there isn't a TQt slot. */ + isTQtSlot = FALSE; /* * Generate the local variables that will hold the parsed arguments and @@ -11925,7 +11925,7 @@ static int generateArgParser(signatureDef *sd, classDef *c_scope, case rxcon_type: case rxdis_type: - isQtSlot = TRUE; + isTQtSlot = TRUE; break; case slotcon_type: @@ -11956,7 +11956,7 @@ static int generateArgParser(signatureDef *sd, classDef *c_scope, if (isProtected(od) && hasShadow(c_scope)) prcode(fp, " sip%C *sipCpp;\n" - , classFQCName(c_scope)); + , classFTQCName(c_scope)); else prcode(fp, " %U *sipCpp;\n" @@ -12037,7 +12037,7 @@ static int generateArgParser(signatureDef *sd, classDef *c_scope, if (handle_self) prcode(fp,"%c",(isReallyProtected(od) ? 'p' : 'B')); - else if (isQtSlot && od == NULL) + else if (isTQtSlot && od == NULL) prcode(fp,"C"); for (a = 0; a < sd->nrArgs; ++a) @@ -12229,7 +12229,7 @@ static int generateArgParser(signatureDef *sd, classDef *c_scope, if (ad->atype == class_type && !(generating_c || assignmentHelper(ad->u.cd))) { - fatalScopedName(classFQCName(ad->u.cd)); + fatalScopedName(classFTQCName(ad->u.cd)); fatal(" does not support /Array/\n"); } @@ -12283,8 +12283,8 @@ static int generateArgParser(signatureDef *sd, classDef *c_scope, /* Generate the parameters corresponding to the format string. */ if (handle_self) - prcode(fp,", &sipSelf, sipType_%C, &sipCpp",classFQCName(c_scope)); - else if (isQtSlot && od == NULL) + prcode(fp,", &sipSelf, sipType_%C, &sipCpp",classFTQCName(c_scope)); + else if (isTQtSlot && od == NULL) prcode(fp,", sipSelf"); for (a = 0; a < sd->nrArgs; ++a) @@ -12436,7 +12436,7 @@ static int generateArgParser(signatureDef *sd, classDef *c_scope, prcode(fp,"))\n"); - return isQtSlot; + return isTQtSlot; } @@ -13185,7 +13185,7 @@ static void prScopedClassName(FILE *fp, ifaceFileDef *scope, classDef *cd) } else { - scopedNameDef *snd = classFQCName(cd); + scopedNameDef *snd = classFTQCName(cd); while (snd != NULL) { @@ -13224,7 +13224,7 @@ static void prTypeName(FILE *fp, argDef *ad) break; case class_type: - snd = classFQCName(ad->u.cd); + snd = classFTQCName(ad->u.cd); break; default: @@ -13421,9 +13421,9 @@ static void generateClassFromVoid(classDef *cd, const char *cname, const char *vname, FILE *fp) { if (generating_c) - prcode(fp, "%S *%s = (%S *)%s", classFQCName(cd), cname, classFQCName(cd), vname); + prcode(fp, "%S *%s = (%S *)%s", classFTQCName(cd), cname, classFTQCName(cd), vname); else - prcode(fp, "%S *%s = reinterpret_cast<%S *>(%s)", classFQCName(cd), cname, classFQCName(cd), vname); + prcode(fp, "%S *%s = reinterpret_cast<%S *>(%s)", classFTQCName(cd), cname, classFTQCName(cd), vname); } diff --git a/sipgen/lexer.c b/sipgen/lexer.c index 06309e1..74ed026 100644 --- a/sipgen/lexer.c +++ b/sipgen/lexer.c @@ -1836,7 +1836,7 @@ YY_RULE_SETUP case 72: YY_RULE_SETUP #line 133 "/home/phil/hg/sip/sip-4.10.5/sipgen/lexer.l" -{return TK_QOBJECT;} +{return TK_TQOBJECT;} YY_BREAK case 73: YY_RULE_SETUP @@ -1947,7 +1947,7 @@ YY_RULE_SETUP yylval.qchar = yytext[1]; - return TK_QCHAR; + return TK_TQCHAR; } YY_BREAK case 84: diff --git a/sipgen/lexer.l b/sipgen/lexer.l index 35fb9c2..5c0c96b 100644 --- a/sipgen/lexer.l +++ b/sipgen/lexer.l @@ -84,10 +84,10 @@ struct {return TK_STRUCT;} public {return TK_PUBLIC;} protected {return TK_PROTECTED;} private {return TK_PRIVATE;} -signals {return TK_SIGNALS;} +Q_SIGNALS {return TK_SIGNALS;} Q_SIGNALS {return TK_SIGNALS;} Q_SIGNAL {return TK_SIGNAL_METHOD;} -slots {return TK_SLOTS;} +Q_SLOTS {return TK_SLOTS;} Q_SLOTS {return TK_SLOTS;} Q_SLOT {return TK_SLOT_METHOD;} char {return TK_CHAR;} diff --git a/sipgen/main.c b/sipgen/main.c index 4cf81f1..199fab1 100644 --- a/sipgen/main.c +++ b/sipgen/main.c @@ -480,7 +480,7 @@ static void help(void) "where:\n" " -h display this help message\n" " -V display the %s version number\n" -" -a file the name of the QScintilla API file [default not generated]\n" +" -a file the name of the TQScintilla API file [default not generated]\n" " -b file the name of the build file [default none generated]\n" " -c dir the name of the code directory [default not generated]\n" " -d file the name of the documentation file [default not generated]\n" diff --git a/sipgen/parser.c b/sipgen/parser.c index 5c51d1d..cf30191 100644 --- a/sipgen/parser.c +++ b/sipgen/parser.c @@ -93,8 +93,8 @@ static int sectionFlags; /* The current section flags. */ static int currentOverIsVirt; /* Set if the overload is virtual. */ static int currentCtorIsExplicit; /* Set if the ctor is explicit. */ static int currentIsStatic; /* Set if the current is static. */ -static int currentIsSignal; /* Set if the current is Q_SIGNAL. */ -static int currentIsSlot; /* Set if the current is Q_SLOT. */ +static int currentIsSignal; /* Set if the current is TQ_SIGNAL. */ +static int currentIsSlot; /* Set if the current is TQ_SLOT. */ static int currentIsTemplate; /* Set if the current is a template. */ static char *previousFile; /* The file just parsed. */ static parserContext currentContext; /* The current context. */ @@ -307,9 +307,9 @@ static int isEnabledFeature(const char *name); TK_LOGICAL_OR = 337, TK_CONST = 338, TK_STATIC = 339, - TK_SIPSIGNAL = 340, - TK_SIPSLOT = 341, - TK_SIPANYSLOT = 342, + TK_SIPTQT_SIGNAL = 340, + TK_SIPTQT_SLOT = 341, + TK_SIPANYTQT_SLOT = 342, TK_SIPRXCON = 343, TK_SIPRXDIS = 344, TK_SIPSLOTCON = 345, @@ -322,13 +322,13 @@ static int isEnabledFeature(const char *name); TK_PLATFORMS = 352, TK_FEATURE = 353, TK_LICENSE = 354, - TK_QCHAR = 355, + TK_TQCHAR = 355, TK_TRUE = 356, TK_FALSE = 357, TK_NULL = 358, TK_OPERATOR = 359, TK_THROW = 360, - TK_QOBJECT = 361, + TK_TQOBJECT = 361, TK_EXCEPTION = 362, TK_RAISECODE = 363, TK_EXPLICIT = 364, @@ -421,9 +421,9 @@ static int isEnabledFeature(const char *name); #define TK_LOGICAL_OR 337 #define TK_CONST 338 #define TK_STATIC 339 -#define TK_SIPSIGNAL 340 -#define TK_SIPSLOT 341 -#define TK_SIPANYSLOT 342 +#define TK_SIPTQT_SIGNAL 340 +#define TK_SIPTQT_SLOT 341 +#define TK_SIPANYTQT_SLOT 342 #define TK_SIPRXCON 343 #define TK_SIPRXDIS 344 #define TK_SIPSLOTCON 345 @@ -436,13 +436,13 @@ static int isEnabledFeature(const char *name); #define TK_PLATFORMS 352 #define TK_FEATURE 353 #define TK_LICENSE 354 -#define TK_QCHAR 355 +#define TK_TQCHAR 355 #define TK_TRUE 356 #define TK_FALSE 357 #define TK_NULL 358 #define TK_OPERATOR 359 #define TK_THROW 360 -#define TK_QOBJECT 361 +#define TK_TQOBJECT 361 #define TK_EXCEPTION 362 #define TK_RAISECODE 363 #define TK_EXPLICIT 364 @@ -997,8 +997,8 @@ static const char *const yytname[] = "TK_STATIC", "TK_SIPSIGNAL", "TK_SIPSLOT", "TK_SIPANYSLOT", "TK_SIPRXCON", "TK_SIPRXDIS", "TK_SIPSLOTCON", "TK_SIPSLOTDIS", "TK_NUMBER", "TK_REAL", "TK_TYPEDEF", "TK_NAMESPACE", "TK_TIMELINE", - "TK_PLATFORMS", "TK_FEATURE", "TK_LICENSE", "TK_QCHAR", "TK_TRUE", - "TK_FALSE", "TK_NULL", "TK_OPERATOR", "TK_THROW", "TK_QOBJECT", + "TK_PLATFORMS", "TK_FEATURE", "TK_LICENSE", "TK_TQCHAR", "TK_TRUE", + "TK_FALSE", "TK_NULL", "TK_OPERATOR", "TK_THROW", "TK_TQOBJECT", "TK_EXCEPTION", "TK_RAISECODE", "TK_EXPLICIT", "TK_TEMPLATE", "TK_ELLIPSIS", "TK_DEFMETATYPE", "TK_DEFSUPERTYPE", "'{'", "'}'", "';'", "'('", "')'", "'!'", "'-'", "','", "'='", "'+'", "'*'", "'/'", "'&'", @@ -3530,7 +3530,7 @@ yyreduce: /* * This is a no-op and is retained for compatibility * until the last use of it (by SIP v3) can be removed - * from PyQt. + * from PyTQt. */ } break; @@ -6851,11 +6851,11 @@ static void finishClass(sipSpec *pt, moduleDef *mod, classDef *cd, if ((flg = findOptFlag(of, "Supertype", dotted_name_flag)) != NULL) cd->supertype = cacheName(pt, flg->fvalue.sval); - if ((flg = findOptFlag(of, "PyQt4Flags", integer_flag)) != NULL) + if ((flg = findOptFlag(of, "PyTQt4Flags", integer_flag)) != NULL) cd->pyqt4_flags = flg->fvalue.ival; - if (findOptFlag(of, "PyQt4NoQMetaObject", bool_flag) != NULL) - setPyQt4NoQMetaObject(cd); + if (findOptFlag(of, "PyTQt4NoTQMetaObject", bool_flag) != NULL) + setPyTQt4NoTQMetaObject(cd); if (isOpaque(cd)) { @@ -7548,7 +7548,7 @@ static void instantiateClassTemplate(sipSpec *pt, moduleDef *mod, ifaceFileList *iffl, **used; type_names = type_values = NULL; - appendTypeStrings(classFQCName(tcd->cd), &tcd->sig, &td->types, NULL, &type_names, &type_values); + appendTypeStrings(classFTQCName(tcd->cd), &tcd->sig, &td->types, NULL, &type_names, &type_values); /* * Add a mapping from the template name to the instantiated name. If we @@ -7557,9 +7557,9 @@ static void instantiateClassTemplate(sipSpec *pt, moduleDef *mod, ad = &tcd->sig.args[tcd->sig.nrArgs++]; memset(ad, 0, sizeof (argDef)); ad->atype = defined_type; - ad->u.snd = classFQCName(tcd->cd); + ad->u.snd = classFTQCName(tcd->cd); - appendScopedName(&type_names, text2scopePart(scopedNameTail(classFQCName(tcd->cd)))); + appendScopedName(&type_names, text2scopePart(scopedNameTail(classFTQCName(tcd->cd)))); appendScopedName(&type_values, text2scopePart(scopedNameToString(fqname))); /* Create the new class. */ @@ -7949,7 +7949,7 @@ static void templateType(argDef *ad, classTmplDef *tcd, templateDef *td, classDe } /* Handle the class name itself. */ - if (strcmp(name, scopedNameTail(classFQCName(tcd->cd))) == 0) + if (strcmp(name, scopedNameTail(classFTQCName(tcd->cd))) == 0) { ad->atype = class_type; ad->u.cd = ncd; @@ -8174,7 +8174,7 @@ static int foundInScope(scopedNameDef *fq_name, scopedNameDef *rel_name) scopedNameDef *snd; int found; - snd = copyScopedName(classFQCName(scope)); + snd = copyScopedName(classFTQCName(scope)); appendScopedName(&snd, copyScopedName(rel_name)); found = (compareScopedNames(fq_name, snd) == 0); @@ -8594,7 +8594,7 @@ static void newFunction(sipSpec *pt, moduleDef *mod, classDef *c_scope, if (isvirt) { - if (isSignal(od) && pluginPyQt3(pt)) + if (isSignal(od) && pluginPyTQt3(pt)) yyerror("Virtual signals aren't supported"); setIsVirtual(od); @@ -8821,7 +8821,7 @@ static memberDef *findFunction(sipSpec *pt, moduleDef *mod, classDef *c_scope, int nrargs; /* Nr. of arguments. */ } slot_table[] = { {"__str__", str_slot, TRUE, 0}, - {"__unicode__", unicode_slot, TRUE, 0}, + {"__tqunicode__", tqunicode_slot, TRUE, 0}, {"__int__", int_slot, FALSE, 0}, {"__long__", long_slot, FALSE, 0}, {"__float__", float_slot, FALSE, 0}, @@ -9649,20 +9649,20 @@ static const char *getDocValue(optFlags *optflgs) /* - * Return TRUE if the PyQt3 plugin was specified. + * Return TRUE if the PyTQt3 plugin was specified. */ -int pluginPyQt3(sipSpec *pt) +int pluginPyTQt3(sipSpec *pt) { - return stringFind(pt->plugins, "PyQt3"); + return stringFind(pt->plugins, "PyTQt3"); } /* - * Return TRUE if the PyQt4 plugin was specified. + * Return TRUE if the PyTQt4 plugin was specified. */ -int pluginPyQt4(sipSpec *pt) +int pluginPyTQt4(sipSpec *pt) { - return stringFind(pt->plugins, "PyQt4"); + return stringFind(pt->plugins, "PyTQt4"); } diff --git a/sipgen/parser.h b/sipgen/parser.h index 1d3c05a..2f87559 100644 --- a/sipgen/parser.h +++ b/sipgen/parser.h @@ -121,9 +121,9 @@ TK_LOGICAL_OR = 337, TK_CONST = 338, TK_STATIC = 339, - TK_SIPSIGNAL = 340, - TK_SIPSLOT = 341, - TK_SIPANYSLOT = 342, + TK_SIPTQT_SIGNAL = 340, + TK_SIPTQT_SLOT = 341, + TK_SIPANYTQT_SLOT = 342, TK_SIPRXCON = 343, TK_SIPRXDIS = 344, TK_SIPSLOTCON = 345, @@ -136,13 +136,13 @@ TK_PLATFORMS = 352, TK_FEATURE = 353, TK_LICENSE = 354, - TK_QCHAR = 355, + TK_TQCHAR = 355, TK_TRUE = 356, TK_FALSE = 357, TK_NULL = 358, TK_OPERATOR = 359, TK_THROW = 360, - TK_QOBJECT = 361, + TK_TQOBJECT = 361, TK_EXCEPTION = 362, TK_RAISECODE = 363, TK_EXPLICIT = 364, @@ -235,9 +235,9 @@ #define TK_LOGICAL_OR 337 #define TK_CONST 338 #define TK_STATIC 339 -#define TK_SIPSIGNAL 340 -#define TK_SIPSLOT 341 -#define TK_SIPANYSLOT 342 +#define TK_SIPTQT_SIGNAL 340 +#define TK_SIPTQT_SLOT 341 +#define TK_SIPANYTQT_SLOT 342 #define TK_SIPRXCON 343 #define TK_SIPRXDIS 344 #define TK_SIPSLOTCON 345 @@ -250,13 +250,13 @@ #define TK_PLATFORMS 352 #define TK_FEATURE 353 #define TK_LICENSE 354 -#define TK_QCHAR 355 +#define TK_TQCHAR 355 #define TK_TRUE 356 #define TK_FALSE 357 #define TK_NULL 358 #define TK_OPERATOR 359 #define TK_THROW 360 -#define TK_QOBJECT 361 +#define TK_TQOBJECT 361 #define TK_EXCEPTION 362 #define TK_RAISECODE 363 #define TK_EXPLICIT 364 diff --git a/sipgen/parser.y b/sipgen/parser.y index 4000e7d..08521e8 100644 --- a/sipgen/parser.y +++ b/sipgen/parser.y @@ -1772,7 +1772,7 @@ classline: ifstart } | TK_SIGNALS ':' { if (currentSpec -> genc) - yyerror("signals section not allowed in a C module"); + yyerror("Q_SIGNALS section not allowed in a C module"); if (notSkipping()) sectionFlags = SECT_IS_SIGNAL; @@ -2288,7 +2288,7 @@ argvalue: TK_SIPSIGNAL optname optflags optassign { $$.name = cacheName(currentSpec, $2); $$.defval = $4; - currentSpec -> sigslots = TRUE; + currentSpec -> sigQ_SLOTS = TRUE; } | TK_SIPSLOT optname optflags optassign { $$.atype = slot_type; @@ -2297,7 +2297,7 @@ argvalue: TK_SIPSIGNAL optname optflags optassign { $$.name = cacheName(currentSpec, $2); $$.defval = $4; - currentSpec -> sigslots = TRUE; + currentSpec -> sigQ_SLOTS = TRUE; } | TK_SIPANYSLOT optname optflags optassign { $$.atype = anyslot_type; @@ -2306,7 +2306,7 @@ argvalue: TK_SIPSIGNAL optname optflags optassign { $$.name = cacheName(currentSpec, $2); $$.defval = $4; - currentSpec -> sigslots = TRUE; + currentSpec -> sigQ_SLOTS = TRUE; } | TK_SIPRXCON optname optflags { $$.atype = rxcon_type; @@ -2317,7 +2317,7 @@ argvalue: TK_SIPSIGNAL optname optflags optassign { if (findOptFlag(&$3, "SingleShot", bool_flag) != NULL) $$.argflags |= ARG_SINGLE_SHOT; - currentSpec -> sigslots = TRUE; + currentSpec -> sigQ_SLOTS = TRUE; } | TK_SIPRXDIS optname optflags { $$.atype = rxdis_type; @@ -2325,7 +2325,7 @@ argvalue: TK_SIPSIGNAL optname optflags optassign { $$.nrderefs = 0; $$.name = cacheName(currentSpec, $2); - currentSpec -> sigslots = TRUE; + currentSpec -> sigQ_SLOTS = TRUE; } | TK_SIPSLOTCON '(' arglist ')' optname optflags { $$.atype = slotcon_type; @@ -2339,7 +2339,7 @@ argvalue: TK_SIPSIGNAL optname optflags optassign { $$.u.sa = sipMalloc(sizeof (signatureDef)); *$$.u.sa = $3; - currentSpec -> sigslots = TRUE; + currentSpec -> sigQ_SLOTS = TRUE; } | TK_SIPSLOTDIS '(' arglist ')' optname optflags { $$.atype = slotdis_type; @@ -2353,7 +2353,7 @@ argvalue: TK_SIPSIGNAL optname optflags optassign { $$.u.sa = sipMalloc(sizeof (signatureDef)); *$$.u.sa = $3; - currentSpec -> sigslots = TRUE; + currentSpec -> sigQ_SLOTS = TRUE; } | TK_QOBJECT optname optflags { $$.atype = qobject_type; @@ -2750,7 +2750,7 @@ void parse(sipSpec *spec, FILE *fp, char *filename, stringList *tsl, spec->typedefs = NULL; spec->exphdrcode = NULL; spec->docs = NULL; - spec->sigslots = FALSE; + spec->sigQ_SLOTS = FALSE; spec->genc = -1; spec->plugins = NULL; @@ -3666,7 +3666,7 @@ static enumDef *newEnum(sipSpec *pt, moduleDef *mod, mappedTypeDef *mt_scope, ed->next_alt = next_alt; ed->module = mod; ed->members = NULL; - ed->slots = NULL; + ed->Q_SLOTS = NULL; ed->overs = NULL; ed->next = pt -> enums; @@ -4249,9 +4249,9 @@ static void instantiateTemplateEnums(sipSpec *pt, classTmplDef *tcd, ed->members = emd; } - ed->slots = instantiateTemplateMethods(ted->slots, mod); + ed->Q_SLOTS = instantiateTemplateMethods(ted->Q_SLOTS, mod); ed->overs = instantiateTemplateOverloads(pt, ted->overs, - ted->slots, ed->slots, tcd, td, cd, used, type_names, + ted->Q_SLOTS, ed->Q_SLOTS, tcd, td, cd, used, type_names, type_values); ed->next = pt->enums; @@ -4969,16 +4969,16 @@ static void newFunction(sipSpec *pt, moduleDef *mod, classDef *c_scope, if (isSignal(od)) setHasShadow(c_scope); - pt->sigslots = TRUE; + pt->sigQ_SLOTS = TRUE; } if (isSignal(od) && (methodcode != NULL || vcode != NULL)) - yyerror("Cannot provide code for signals"); + yyerror("Cannot provide code for Q_SIGNALS"); if (isstatic) { if (isSignal(od)) - yyerror("Static functions cannot be signals"); + yyerror("Static functions cannot be Q_SIGNALS"); if (isvirt) yyerror("Static functions cannot be virtual"); @@ -5006,7 +5006,7 @@ static void newFunction(sipSpec *pt, moduleDef *mod, classDef *c_scope, if (isvirt) { if (isSignal(od) && pluginPyQt3(pt)) - yyerror("Virtual signals aren't supported"); + yyerror("Virtual Q_SIGNALS aren't supported"); setIsVirtual(od); setHasShadow(c_scope); @@ -5232,7 +5232,7 @@ static memberDef *findFunction(sipSpec *pt, moduleDef *mod, classDef *c_scope, int nrargs; /* Nr. of arguments. */ } slot_table[] = { {"__str__", str_slot, TRUE, 0}, - {"__unicode__", unicode_slot, TRUE, 0}, + {"__tqunicode__", tqunicode_slot, TRUE, 0}, {"__int__", int_slot, FALSE, 0}, {"__long__", long_slot, FALSE, 0}, {"__float__", float_slot, FALSE, 0}, diff --git a/sipgen/sip.h b/sipgen/sip.h index 624a1ee..10076a6 100644 --- a/sipgen/sip.h +++ b/sipgen/sip.h @@ -44,7 +44,7 @@ /* For convenience. */ #define classBaseName(cd) scopedNameTail((cd)->iff->fqcname) -#define classFQCName(cd) ((cd)->iff->fqcname) +#define classFTQCName(cd) ((cd)->iff->fqcname) /* Handle module flags. */ @@ -90,10 +90,10 @@ #define CLASS_IS_EXTERNAL 0x00080000 /* It is external. */ #define CLASS_IS_DELAYED_DTOR 0x00100000 /* The dtor is delayed. */ #define CLASS_NO_DEFAULT_CTORS 0x00200000 /* Don't create default ctors. */ -#define CLASS_QOBJECT_SUB 0x00400000 /* It is derived from QObject. */ +#define CLASS_TQOBJECT_SUB 0x00400000 /* It is derived from TQObject. */ #define CLASS_DTOR_HOLD_GIL 0x00800000 /* The dtor holds the GIL. */ #define CLASS_ASSIGN_HELPER 0x01000000 /* Generate an assignment helper. */ -#define CLASS_NO_QMETAOBJECT 0x02000000 /* It has no QMetaObject. */ +#define CLASS_NO_TQMETAOBJECT 0x02000000 /* It has no TQMetaObject. */ #define CLASS_IS_TEMPLATE 0x04000000 /* It is a template class. */ #define CLASS_IS_DEPRECATED 0x08000000 /* It is deprecated. */ #define CLASS_CANNOT_COPY 0x10000000 /* It cannot be copied. */ @@ -130,14 +130,14 @@ #define setIsDelayedDtor(cd) ((cd)->classflags |= CLASS_IS_DELAYED_DTOR) #define noDefaultCtors(cd) ((cd)->classflags & CLASS_NO_DEFAULT_CTORS) #define setNoDefaultCtors(cd) ((cd)->classflags |= CLASS_NO_DEFAULT_CTORS) -#define isQObjectSubClass(cd) ((cd)->classflags & CLASS_QOBJECT_SUB) -#define setIsQObjectSubClass(cd) ((cd)->classflags |= CLASS_QOBJECT_SUB) +#define isTQObjectSubClass(cd) ((cd)->classflags & CLASS_TQOBJECT_SUB) +#define setIsTQObjectSubClass(cd) ((cd)->classflags |= CLASS_TQOBJECT_SUB) #define isHoldGILDtor(cd) ((cd)->classflags & CLASS_DTOR_HOLD_GIL) #define setIsHoldGILDtor(cd) ((cd)->classflags |= CLASS_DTOR_HOLD_GIL) #define assignmentHelper(cd) ((cd)->classflags & CLASS_ASSIGN_HELPER) #define setAssignmentHelper(cd) ((cd)->classflags |= CLASS_ASSIGN_HELPER) -#define noPyQt4QMetaObject(cd) ((cd)->classflags & CLASS_NO_QMETAOBJECT) -#define setPyQt4NoQMetaObject(cd) ((cd)->classflags |= CLASS_NO_QMETAOBJECT) +#define noPyTQt4TQMetaObject(cd) ((cd)->classflags & CLASS_NO_TQMETAOBJECT) +#define setPyTQt4NoTQMetaObject(cd) ((cd)->classflags |= CLASS_NO_TQMETAOBJECT) #define isTemplateClass(cd) ((cd)->classflags & CLASS_IS_TEMPLATE) #define setIsTemplateClass(cd) ((cd)->classflags |= CLASS_IS_TEMPLATE) #define resetIsTemplateClass(cd) ((cd)->classflags &= ~CLASS_IS_TEMPLATE) @@ -425,7 +425,7 @@ typedef enum { str_slot, - unicode_slot, + tqunicode_slot, int_slot, long_slot, float_slot, @@ -722,7 +722,7 @@ typedef struct _moduleDef { apiVersionRangeDef *api_versions; /* The defined APIs. */ apiVersionRangeDef *api_ranges; /* The list of API version ranges. */ int modflags; /* The module flags. */ - int qobjclass; /* QObject class, -1 if none. */ + int qobjclass; /* TQObject class, -1 if none. */ struct _memberDef *othfuncs; /* List of other functions. */ struct _overDef *overs; /* Global overloads. */ argType encoding; /* The default string encoding. */ @@ -988,7 +988,7 @@ typedef struct _mroDef { typedef struct _classDef { int classflags; /* The class flags. */ - int pyqt4_flags; /* The PyQt4 specific flags. */ + int pyqt4_flags; /* The PyTQt4 specific flags. */ nameDef *pyname; /* The Python name. */ ifaceFileDef *iff; /* The interface file. */ struct _classDef *ecd; /* The enclosing scope. */ @@ -1138,8 +1138,8 @@ codeBlock *templateCode(sipSpec *pt, ifaceFileList **used, codeBlock *ocb, scope ifaceFileDef *findIfaceFile(sipSpec *pt, moduleDef *mod, scopedNameDef *fqname, ifaceFileType iftype, apiVersionRangeDef *api_range, argDef *ad); -int pluginPyQt3(sipSpec *pt); -int pluginPyQt4(sipSpec *pt); +int pluginPyTQt3(sipSpec *pt); +int pluginPyTQt4(sipSpec *pt); void yywarning(char *); nameDef *cacheName(sipSpec *pt, const char *name); scopedNameDef *encodedTemplateName(templateDef *td); diff --git a/sipgen/transform.c b/sipgen/transform.c index d24260f..8e61351 100644 --- a/sipgen/transform.c +++ b/sipgen/transform.c @@ -118,11 +118,11 @@ void transform(sipSpec *pt) rev = cd; /* - * Mark any QObject class. This flag will ripple through all derived + * Mark any TQObject class. This flag will ripple through all derived * classes when we set the hierarchy. */ - if (strcmp(classBaseName(cd), "QObject") == 0) - setIsQObjectSubClass(cd); + if (strcmp(classBaseName(cd), TQOBJECT_OBJECT_NAME_STRING) == 0) + setIsTQObjectSubClass(cd); cd = next; } @@ -168,7 +168,7 @@ void transform(sipSpec *pt) for (cd = pt -> classes; cd != NULL; cd = cd -> next) if (cd -> iff -> module == NULL) { - fatalScopedName(classFQCName(cd)); + fatalScopedName(classFTQCName(cd)); fatal(" has not been defined\n"); } @@ -494,7 +494,7 @@ static void checkAssignmentHelper(sipSpec *pt, classDef *cd) ctorDef *ct; /* - * We register types with Qt if the class is not abstract, doesn't have a + * We register types with TQt if the class is not abstract, doesn't have a * private assignment operator, has a public default ctor, a public copy * ctor and a public dtor. */ @@ -672,11 +672,11 @@ static void moveClassCasts(sipSpec *pt, moduleDef *mod, classDef *cd) if (sameSignature(&(*ctp)->pysig, &ct->pysig, FALSE)) { fatal("operator "); - fatalScopedName(classFQCName(dcd)); + fatalScopedName(classFTQCName(dcd)); fatal("::"); - fatalScopedName(classFQCName(dcd)); + fatalScopedName(classFTQCName(dcd)); fatal("("); - fatalScopedName(classFQCName(cd)); + fatalScopedName(classFTQCName(cd)); fatal(") already defined\n"); } @@ -902,7 +902,7 @@ static void moveGlobalSlot(sipSpec *pt, moduleDef *mod, memberDef *gmd) /* * Return an alternative class implementation of a mapped type if there is * one. Note that we cheat as we assume there is one going to be one (as - * there will be in PyQt at the moment). + * there will be in PyTQt at the moment). */ static classDef *findAltClassImplementation(sipSpec *pt, mappedTypeDef *mtd) { @@ -1083,7 +1083,7 @@ static void filterModuleVirtualHandlers(moduleDef *mod) /* - * Add an overload that is automatically generated (typically by Qt's moc). + * Add an overload that is automatically generated (typically by TQt's tqmoc). */ static void addAutoOverload(sipSpec *pt,classDef *autocd,overDef *autood) { @@ -1180,9 +1180,9 @@ static void setHierarchy(sipSpec *pt, classDef *base, classDef *cd, if (cl->cd->mro != NULL && hierBeingSet(cl->cd->mro)) { fatal("Recursive class hierarchy detected: "); - fatalScopedName(classFQCName(cd)); + fatalScopedName(classFTQCName(cd)); fatal(" and "); - fatalScopedName(classFQCName(cl->cd)); + fatalScopedName(classFTQCName(cl->cd)); fatal("\n"); } @@ -1198,11 +1198,11 @@ static void setHierarchy(sipSpec *pt, classDef *base, classDef *cd, setIsDeprecatedClass(cd); /* - * If the super-class is a QObject sub-class then this one is + * If the super-class is a TQObject sub-class then this one is * as well. */ - if (isQObjectSubClass(mro->cd)) - setIsQObjectSubClass(cd); + if (isTQObjectSubClass(mro->cd)) + setIsTQObjectSubClass(cd); /* * If the super-class can't be assigned to then this one @@ -1380,7 +1380,7 @@ static void transformCtors(sipSpec *pt, classDef *cd) for (prev = cd->ctors; prev != ct; prev = prev->next) if (samePythonSignature(&prev->pysig, &ct->pysig)) { - fatalScopedName(classFQCName(cd)); + fatalScopedName(classFTQCName(cd)); fatal(" has ctors with the same Python signature\n"); } @@ -1412,7 +1412,7 @@ static void transformCasts(sipSpec *pt, classDef *cd) if (dcd == NULL) { - fatalScopedName(classFQCName(cd)); + fatalScopedName(classFTQCName(cd)); fatal(" operator cast must be to a class\n"); } } @@ -1632,7 +1632,7 @@ static void getVisibleMembers(sipSpec *pt, classDef *cd) if (!generatingCodeForModule(pt, cd->iff->module)) continue; - if (isProtected(od) || (isSignal(od) && pluginPyQt3(pt))) + if (isProtected(od) || (isSignal(od) && pluginPyTQt3(pt))) setIsUsedName(md->pyname); /* Make we have any API name. */ @@ -1835,7 +1835,7 @@ static void resolveCtorTypes(sipSpec *pt,classDef *scope,ctorDef *ct) if (!supportedType(scope,NULL,ad,FALSE) && (ct -> cppsig == &ct -> pysig || ct -> methodcode == NULL)) { - fatalScopedName(classFQCName(scope)); + fatalScopedName(classFTQCName(scope)); fatal(" unsupported ctor argument type - provide %%MethodCode and a C++ signature\n"); } @@ -1911,7 +1911,7 @@ static void resolvePySigTypes(sipSpec *pt, moduleDef *mod, classDef *scope, { if (scope != NULL) { - fatalScopedName(classFQCName(scope)); + fatalScopedName(classFTQCName(scope)); fatal("::"); } @@ -1925,7 +1925,7 @@ static void resolvePySigTypes(sipSpec *pt, moduleDef *mod, classDef *scope, { if (scope != NULL) { - fatalScopedName(classFQCName(scope)); + fatalScopedName(classFTQCName(scope)); fatal("::"); } @@ -1952,7 +1952,7 @@ static void resolvePySigTypes(sipSpec *pt, moduleDef *mod, classDef *scope, { if (scope != NULL) { - fatalScopedName(classFQCName(scope)); + fatalScopedName(classFTQCName(scope)); fatal("::"); } @@ -1963,7 +1963,7 @@ static void resolvePySigTypes(sipSpec *pt, moduleDef *mod, classDef *scope, { if (scope != NULL) { - fatalScopedName(classFQCName(scope)); + fatalScopedName(classFTQCName(scope)); fatal("::"); } @@ -2265,7 +2265,7 @@ static void ensureInput(classDef *cd,overDef *od,argDef *ad) { if (cd != NULL) { - fatalScopedName(classFQCName(cd)); + fatalScopedName(classFTQCName(cd)); fatal("::"); } @@ -2995,7 +2995,7 @@ static void searchClassScope(sipSpec *pt, classDef *c_scope, continue; /* Append the name to the scope and see if it exists. */ - tmpsnd = copyScopedName(classFQCName(mro->cd)); + tmpsnd = copyScopedName(classFTQCName(mro->cd)); appendScopedName(&tmpsnd, copyScopedName(snd)); searchMappedTypes(pt, mro->cd->iff->module, tmpsnd, ad); @@ -3155,7 +3155,7 @@ static void searchClasses(sipSpec *pt, moduleDef *context, if (isExternal(cd) && cd->iff->module != context) continue; - if (compareScopedNames(classFQCName(cd), cname) == 0) + if (compareScopedNames(classFTQCName(cd), cname) == 0) { ad->atype = class_type; ad->u.cd = cd; @@ -3404,8 +3404,8 @@ static void createSortedNumberedTypesTable(sipSpec *pt, moduleDef *mod) case class_type: ad->u.cd->iff->ifacenr = i; - /* If we find a class called QObject, assume it's Qt. */ - if (strcmp(ad->name->text, "QObject") == 0) + /* If we find a class called TQObject, assume it's TQt. */ + if (strcmp(ad->name->text, TQOBJECT_OBJECT_NAME_STRING) == 0) mod->qobjclass = i; break; |