diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2023-01-03 01:01:50 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2023-01-22 13:21:17 +0100 |
commit | 0f630aff5c42d03eb301cd3fc5faff80d9c3c727 (patch) | |
tree | 94c873376a07783255db1f419f5d17bfa5151128 /sipgen | |
parent | 3e5815bce63e9e476bdeb58cbe230239622e1ba5 (diff) | |
download | sip4-tqt-0f630aff5c42d03eb301cd3fc5faff80d9c3c727.tar.gz sip4-tqt-0f630aff5c42d03eb301cd3fc5faff80d9c3c727.zip |
Entry step for renaming PyTQt module libraries from qt* to tqt*.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'sipgen')
-rw-r--r-- | sipgen/export.c | 4 | ||||
-rw-r--r-- | sipgen/gencode.c | 72 | ||||
-rw-r--r-- | sipgen/lexer.l | 2 | ||||
-rw-r--r-- | sipgen/parser.y | 14 | ||||
-rw-r--r-- | sipgen/sip.h | 6 | ||||
-rw-r--r-- | sipgen/transform.c | 6 |
6 files changed, 52 insertions, 52 deletions
diff --git a/sipgen/export.c b/sipgen/export.c index e18feba..e9b4f5a 100644 --- a/sipgen/export.c +++ b/sipgen/export.c @@ -753,7 +753,7 @@ static void xmlType(sipSpec *pt, argDef *ad, int sec, FILE *fp) type_type = "class"; break; - case qobject_type: + case tqobject_type: type_type = "class"; break; @@ -972,7 +972,7 @@ static const char *pyType(sipSpec *pt, argDef *ad, int sec, classDef **scope) break; - case qobject_type: + case tqobject_type: type_name = TQOBJECT_OBJECT_NAME_STRING; break; diff --git a/sipgen/gencode.c b/sipgen/gencode.c index 7d0dd63..7dbe6ad 100644 --- a/sipgen/gencode.c +++ b/sipgen/gencode.c @@ -802,14 +802,14 @@ static void generateInternalAPIHeader(sipSpec *pt, moduleDef *mod, if (pluginPyQt4(pt)) prcode(fp, "\n" -"typedef const TQMetaObject *(*sip_qt_metaobject_func)(sipSimpleWrapper *,sipTypeDef *);\n" -"extern sip_qt_metaobject_func sip_%s_qt_metaobject;\n" +"typedef const TQMetaObject *(*sip_tqt_metaobject_func)(sipSimpleWrapper *,sipTypeDef *);\n" +"extern sip_tqt_metaobject_func sip_%s_tqt_metaobject;\n" "\n" -"typedef int (*sip_qt_metacall_func)(sipSimpleWrapper *,sipTypeDef *,TQMetaObject::Call,int,void **);\n" -"extern sip_qt_metacall_func sip_%s_qt_metacall;\n" +"typedef int (*sip_tqt_metacall_func)(sipSimpleWrapper *,sipTypeDef *,TQMetaObject::Call,int,void **);\n" +"extern sip_tqt_metacall_func sip_%s_tqt_metacall;\n" "\n" -"typedef int (*sip_qt_metacast_func)(sipSimpleWrapper *,sipTypeDef *,const char *);\n" -"extern sip_qt_metacast_func sip_%s_qt_metacast;\n" +"typedef int (*sip_tqt_metacast_func)(sipSimpleWrapper *,sipTypeDef *,const char *);\n" +"extern sip_tqt_metacast_func sip_%s_tqt_metacast;\n" , mname , mname , mname); @@ -1164,7 +1164,7 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir, * optional parts. These should be undefined in %ModuleCode if a C++ * implementation is provided. */ - if (mod->qobjclass >= 0) + if (mod->tqobjclass >= 0) prcode(fp, "\n" "#define sipTQtCreateUniversalSignal 0\n" @@ -1702,13 +1702,13 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir, ); /* Generate any TQt support API. */ - if (mod->qobjclass >= 0) + if (mod->tqobjclass >= 0) prcode(fp, "\n" "\n" "/* This defines the TQt support API. */\n" "\n" -"static sipTQtAPI qtAPI = {\n" +"static sipTQtAPI tqtAPI = {\n" " &typesTable[%d],\n" " sipTQtCreateUniversalSignal,\n" " sipTQtFindUniversalSignal,\n" @@ -1723,7 +1723,7 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir, " sipTQtConnectPySignal,\n" " sipTQtDisconnectPySignal\n" "};\n" - , mod->qobjclass); + , mod->tqobjclass); prcode(fp, "\n" @@ -1762,7 +1762,7 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir, , mod->version , pt->module->name , mod->allimports != NULL ? "importsTable" : "NULL" - , mod->qobjclass >= 0 ? "&qtAPI" : "NULL" + , mod->tqobjclass >= 0 ? "&tqtAPI" : "NULL" , mod->nrtypes , mod->nrtypes > 0 ? "typesTable" : "NULL" , hasexternal ? "externalTypesTable" : "NULL" @@ -1806,9 +1806,9 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir, if (pluginPyQt4(pt)) prcode(fp, "\n" -"sip_qt_metaobject_func sip_%s_qt_metaobject;\n" -"sip_qt_metacall_func sip_%s_qt_metacall;\n" -"sip_qt_metacast_func sip_%s_qt_metacast;\n" +"sip_tqt_metaobject_func sip_%s_tqt_metaobject;\n" +"sip_tqt_metacall_func sip_%s_tqt_metacall;\n" +"sip_tqt_metacast_func sip_%s_tqt_metacast;\n" , mname , mname , mname); @@ -1907,9 +1907,9 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir, /* Import the helpers. */ prcode(fp, "\n" -" sip_%s_qt_metaobject = (sip_qt_metaobject_func)sipImportSymbol(\"qtcore_qt_metaobject\");\n" -" sip_%s_qt_metacall = (sip_qt_metacall_func)sipImportSymbol(\"qtcore_qt_metacall\");\n" -" sip_%s_qt_metacast = (sip_qt_metacast_func)sipImportSymbol(\"qtcore_qt_metacast\");\n" +" sip_%s_tqt_metaobject = (sip_tqt_metaobject_func)sipImportSymbol(\"tqtcore_tqt_metaobject\");\n" +" sip_%s_tqt_metacall = (sip_tqt_metacall_func)sipImportSymbol(\"tqtcore_tqt_metacall\");\n" +" sip_%s_tqt_metacast = (sip_tqt_metacast_func)sipImportSymbol(\"tqtcore_tqt_metacast\");\n" "\n" , mname , mname @@ -2037,7 +2037,7 @@ static void generateTypesTable(sipSpec *pt, moduleDef *mod, FILE *fp) argDef *ad; const char *type_suffix; - type_suffix = (pluginPyQt4(pt) || pluginPyTQt3(pt)) ? ".super" : ""; + type_suffix = (pluginPyQt4(pt) || pluginPyTQt(pt)) ? ".super" : ""; prcode(fp, "\n" @@ -3623,7 +3623,7 @@ static void generateTypeDefLink(sipSpec *pt, ifaceFileDef *iff, FILE *fp) if (iff->next_alt->type == mappedtype_iface) prcode(fp, ".mtd_base"); - else if (pluginPyTQt3(pt) || pluginPyQt4(pt)) + else if (pluginPyTQt(pt) || pluginPyQt4(pt)) prcode(fp, ".super.ctd_base"); else prcode(fp, ".ctd_base"); @@ -5703,7 +5703,7 @@ static void generateShadowCode(sipSpec *pt, moduleDef *mod, classDef *cd, "\n" "const TQMetaObject *sip%C::metaObject() const\n" "{\n" -" return sip_%s_qt_metaobject(sipPySelf,sipType_%C);\n" +" return sip_%s_tqt_metaobject(sipPySelf,sipType_%C);\n" "}\n" , classFTQCName(cd) , mod->name, classFTQCName(cd)); @@ -5715,14 +5715,14 @@ static void generateShadowCode(sipSpec *pt, moduleDef *mod, classDef *cd, " _id = %S::qt_metacall(_c,_id,_a);\n" "\n" " if (_id >= 0)\n" -" _id = sip_%s_qt_metacall(sipPySelf,sipType_%C,_c,_id,_a);\n" +" _id = sip_%s_tqt_metacall(sipPySelf,sipType_%C,_c,_id,_a);\n" "\n" " return _id;\n" "}\n" "\n" "void *sip%C::qt_metacast(const char *_clname)\n" "{\n" -" return (sip_%s_qt_metacast && sip_%s_qt_metacast(sipPySelf,sipType_%C,_clname)) ? this : %S::qt_metacast(_clname);\n" +" return (sip_%s_tqt_metacast && sip_%s_tqt_metacast(sipPySelf,sipType_%C,_clname)) ? this : %S::qt_metacast(_clname);\n" "}\n" , classFTQCName(cd) , classFTQCName(cd) @@ -5762,7 +5762,7 @@ static void generateShadowCode(sipSpec *pt, moduleDef *mod, classDef *cd, generateProtectedDefinitions(cd,fp); /* Generate the emitters if needed. */ - if (pluginPyTQt3(pt)) + if (pluginPyTQt(pt)) generateEmitters(cd, fp); } @@ -5804,7 +5804,7 @@ static void generateEmitters(classDef *cd, FILE *fp) prcode(fp, "\n" -"static pyqt3QtSignal signals_%C[] = {\n" +"static pytqtTQtSignal signals_%C[] = {\n" ,classFTQCName(cd)); noIntro = FALSE; @@ -7344,7 +7344,7 @@ static void generateTupleBuilder(signatureDef *sd,FILE *fp) case fake_void_type: case rxcon_type: case rxdis_type: - case qobject_type: + case tqobject_type: fmt = "D"; break; @@ -7404,7 +7404,7 @@ static void generateTupleBuilder(signatureDef *sd,FILE *fp) if (ad->atype == mapped_type || ad->atype == class_type || ad->atype == rxcon_type || ad->atype == rxdis_type || - ad->atype == qobject_type || ad->atype == fake_void_type) + ad->atype == tqobject_type || ad->atype == fake_void_type) { int copy = copyConstRefArg(ad); @@ -7654,8 +7654,8 @@ static void generateClassAPI(classDef *cd, sipSpec *pt, FILE *fp) if (pluginPyQt4(pt)) type_prefix = "pyqt4"; - else if (pluginPyTQt3(pt)) - type_prefix = "pyqt3"; + else if (pluginPyTQt(pt)) + type_prefix = "pytqt"; else type_prefix = "sip"; @@ -7813,8 +7813,8 @@ static void generateShadowClassDeclaration(sipSpec *pt,classDef *cd,FILE *fp) { prcode(fp, "\n" -" int qt_metacall(TQMetaObject::Call,int,void **);\n" -" void *qt_metacast(const char *);\n" +" int tqt_metacall(TQMetaObject::Call,int,void **);\n" +" void *tqt_metacast(const char *);\n" ); if (!noPyQt4TQMetaObject(cd)) @@ -7832,7 +7832,7 @@ static void generateShadowClassDeclaration(sipSpec *pt,classDef *cd,FILE *fp) generateProtectedDeclarations(cd,fp); /* The public wrapper around each signal emitter. */ - if (pluginPyTQt3(pt)) + if (pluginPyTQt(pt)) { visibleList *vl; @@ -8319,7 +8319,7 @@ static void generateNamedBaseType(ifaceFileDef *scope, argDef *ad, char *name, case pycallable_type: case pyslice_type: case pytype_type: - case qobject_type: + case tqobject_type: case ellipsis_type: prcode(fp, "PyObject *"); break; @@ -8756,9 +8756,9 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) type_prefix = "pyqt4"; embedded = TRUE; } - else if (pluginPyTQt3(pt)) + else if (pluginPyTQt(pt)) { - type_prefix = "pyqt3"; + type_prefix = "pytqt"; embedded = TRUE; } else @@ -9096,7 +9096,7 @@ static void generateTypeDefinition(sipSpec *pt, classDef *cd, FILE *fp) "},\n" ); - if (pluginPyTQt3(pt)) + if (pluginPyTQt(pt)) { if (hasSigSlots(cd)) prcode(fp, @@ -11799,7 +11799,7 @@ static int generateArgParser(signatureDef *sd, classDef *c_scope, fmt = (isAllowNone(ad) ? "H" : "F"); break; - case qobject_type: + case tqobject_type: fmt = "R"; break; diff --git a/sipgen/lexer.l b/sipgen/lexer.l index 3e61972..91032cc 100644 --- a/sipgen/lexer.l +++ b/sipgen/lexer.l @@ -130,7 +130,7 @@ SIP_RXOBJ_CON {return TK_SIPRXCON;} SIP_RXOBJ_DIS {return TK_SIPRXDIS;} SIP_SLOT_CON {return TK_SIPSLOTCON;} SIP_SLOT_DIS {return TK_SIPSLOTDIS;} -SIP_QOBJECT {return TK_TQOBJECT;} +SIP_TQOBJECT {return TK_TQOBJECT;} \.\.\. {return TK_ELLIPSIS;} diff --git a/sipgen/parser.y b/sipgen/parser.y index 249079c..da83b35 100644 --- a/sipgen/parser.y +++ b/sipgen/parser.y @@ -1153,7 +1153,7 @@ prepycode: TK_PREPYCODE codeblock { /* * This is a no-op and is retained for compatibility * until the last use of it (by SIP-TQt v3) can be removed - * from PyQt. + * from PyTQt. */ } ; @@ -2356,7 +2356,7 @@ argvalue: TK_SIPSIGNAL optname optflags optassign { currentSpec -> sigslots = TRUE; } | TK_TQOBJECT optname optflags { - $$.atype = qobject_type; + $$.atype = tqobject_type; $$.argflags = 0; $$.nrderefs = 0; $$.name = cacheName(currentSpec, $2); @@ -2875,7 +2875,7 @@ static moduleDef *allocModule() newmod->version = -1; newmod->encoding = no_type; - newmod->qobjclass = -1; + newmod->tqobjclass = -1; newmod->nrvirthandlers = -1; newmod->next_key = 1; @@ -5005,7 +5005,7 @@ static void newFunction(sipSpec *pt, moduleDef *mod, classDef *c_scope, if (isvirt) { - if (isSignal(od) && pluginPyTQt3(pt)) + if (isSignal(od) && pluginPyTQt(pt)) yyerror("Virtual signals aren't supported"); setIsVirtual(od); @@ -6060,11 +6060,11 @@ static const char *getDocValue(optFlags *optflgs) /* - * Return TRUE if the PyQt3 plugin was specified. + * Return TRUE if the PyTQt plugin was specified. */ -int pluginPyTQt3(sipSpec *pt) +int pluginPyTQt(sipSpec *pt) { - return stringFind(pt->plugins, "PyQt3"); + return stringFind(pt->plugins, "PyTQt"); } diff --git a/sipgen/sip.h b/sipgen/sip.h index af3f8fa..5e4a79e 100644 --- a/sipgen/sip.h +++ b/sipgen/sip.h @@ -524,7 +524,7 @@ typedef enum { pydict_type, pycallable_type, pyslice_type, - qobject_type, + tqobject_type, function_type, pytype_type, ellipsis_type, @@ -723,7 +723,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; /* TQObject class, -1 if none. */ + int tqobjclass; /* TQObject class, -1 if none. */ struct _memberDef *othfuncs; /* List of other functions. */ struct _overDef *overs; /* Global overloads. */ argType encoding; /* The default string encoding. */ @@ -1139,7 +1139,7 @@ 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 pluginPyTQt3(sipSpec *pt); +int pluginPyTQt(sipSpec *pt); int pluginPyQt4(sipSpec *pt); void yywarning(char *); nameDef *cacheName(sipSpec *pt, const char *name); diff --git a/sipgen/transform.c b/sipgen/transform.c index c6d204d..d88a7f0 100644 --- a/sipgen/transform.c +++ b/sipgen/transform.c @@ -1632,7 +1632,7 @@ static void getVisibleMembers(sipSpec *pt, classDef *cd) if (!generatingCodeForModule(pt, cd->iff->module)) continue; - if (isProtected(od) || (isSignal(od) && pluginPyTQt3(pt))) + if (isProtected(od) || (isSignal(od) && pluginPyTQt(pt))) setIsUsedName(md->pyname); /* Make we have any API name. */ @@ -2101,7 +2101,7 @@ static int supportedType(classDef *cd,overDef *od,argDef *ad,int outputs) case rxdis_type: case slotcon_type: case slotdis_type: - case qobject_type: + case tqobject_type: case ellipsis_type: /* These can only appear in argument lists without * or &. */ @@ -3406,7 +3406,7 @@ static void createSortedNumberedTypesTable(sipSpec *pt, moduleDef *mod) /* If we find a class called TQObject, assume it's TQt. */ if (strcmp(ad->name->text, TQOBJECT_OBJECT_NAME_STRING) == 0) - mod->qobjclass = i; + mod->tqobjclass = i; break; |