diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 18:31:12 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 18:31:12 +0000 |
commit | 0a80cfd57d271dd44221467efb426675fa470356 (patch) | |
tree | 6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/modules/perlcore | |
parent | 3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff) | |
download | kvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip |
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/modules/perlcore')
-rw-r--r-- | src/modules/perlcore/KVIrc.xs | 18 | ||||
-rw-r--r-- | src/modules/perlcore/libkviperlcore.cpp | 58 | ||||
-rw-r--r-- | src/modules/perlcore/perlcoreinterface.h | 16 | ||||
-rw-r--r-- | src/modules/perlcore/ppport.h | 6 | ||||
-rw-r--r-- | src/modules/perlcore/xs.inc | 18 |
5 files changed, 58 insertions, 58 deletions
diff --git a/src/modules/perlcore/KVIrc.xs b/src/modules/perlcore/KVIrc.xs index 37b040cf..72ee5fd3 100644 --- a/src/modules/perlcore/KVIrc.xs +++ b/src/modules/perlcore/KVIrc.xs @@ -15,7 +15,7 @@ void echo(text,colorset = 0,windowid = 0) } else { pWnd = g_pCurrentKvsContext->window(); } - pWnd->outputNoFmt(colorset,QString::fromUtf8(text)); + pWnd->outputNoFmt(colorset,TQString::fromUtf8(text)); } void say(text,windowid = 0) @@ -32,7 +32,7 @@ void say(text,windowid = 0) } else { pWnd = g_pCurrentKvsContext->window(); } - QString tmp = QString::fromUtf8(text); + TQString tmp = TQString::fromUtf8(text); KviUserInput::parse(tmp,pWnd); } @@ -46,17 +46,17 @@ void internalWarning(text) char * text CODE: if(!g_bExecuteQuiet) - g_lWarningList.append(QString(text)); + g_lWarningList.append(TQString(text)); char * getLocal(varname) char * varname CODE: - QString tmp; + TQString tmp; KviStr hack; if(g_pCurrentKvsContext) { - KviKvsVariant * pVar = g_pCurrentKvsContext->localVariables()->find(varname); + KviKvsVariant * pVar = g_pCurrentKvsContext->localVariables()->tqfind(varname); if(pVar) { pVar->asString(tmp); @@ -85,11 +85,11 @@ void setLocal(varname,value) char * getGlobal(varname) char * varname CODE: - QString tmp; + TQString tmp; KviStr hack; if(g_pCurrentKvsContext) { - KviKvsVariant * pVar = g_pCurrentKvsContext->globalVariables()->find(varname); + KviKvsVariant * pVar = g_pCurrentKvsContext->globalVariables()->tqfind(varname); if(pVar) { pVar->asString(tmp); @@ -122,9 +122,9 @@ char * eval(code) if(g_pCurrentKvsContext && code) { KviKvsVariant ret; - if(KviKvsScript::run(QString::fromUtf8(code),g_pCurrentKvsContext->window(),0,&ret)) + if(KviKvsScript::run(TQString::fromUtf8(code),g_pCurrentKvsContext->window(),0,&ret)) { - QString tmp; + TQString tmp; ret.asString(tmp); g_szLastReturnValue = tmp; } else { diff --git a/src/modules/perlcore/libkviperlcore.cpp b/src/modules/perlcore/libkviperlcore.cpp index a9196219..4325ccda 100644 --- a/src/modules/perlcore/libkviperlcore.cpp +++ b/src/modules/perlcore/libkviperlcore.cpp @@ -72,7 +72,7 @@ static KviKvsRunTimeContext * g_pCurrentKvsContext = 0; static bool g_bExecuteQuiet = false; static KviStr g_szLastReturnValue(""); - static QStringList g_lWarningList; + static TQStringList g_lWarningList; #include "xs.inc" #endif // COMPILE_PERL_SUPPORT @@ -92,21 +92,21 @@ class KviPerlInterpreter { public: - KviPerlInterpreter(const QString &szContextName); + KviPerlInterpreter(const TQString &szContextName); ~KviPerlInterpreter(); protected: - QString m_szContextName; + TQString m_szContextName; PerlInterpreter * m_pInterpreter; public: bool init(); // if this fails then well.. :D void done(); - bool execute(const QString &szCode,QStringList &args,QString &szRetVal,QString &szError,QStringList &lWarnings); - const QString & contextName(){ return m_szContextName; }; + bool execute(const TQString &szCode,TQStringList &args,TQString &szRetVal,TQString &szError,TQStringList &lWarnings); + const TQString & contextName(){ return m_szContextName; }; protected: - QString svToQString(SV * sv); + TQString svToTQString(SV * sv); }; -KviPerlInterpreter::KviPerlInterpreter(const QString &szContextName) +KviPerlInterpreter::KviPerlInterpreter(const TQString &szContextName) { m_szContextName = szContextName; m_pInterpreter = 0; @@ -156,7 +156,7 @@ bool KviPerlInterpreter::init() perl_construct(m_pInterpreter); char * daArgs[] = { "yo", "-e", "0", "-w" }; perl_parse(m_pInterpreter,xs_init,4,daArgs,NULL); - QString szInitCode; + TQString szInitCode; // this part of the code seems to be unnecessary // even if it is created by the perl make process... @@ -169,7 +169,7 @@ bool KviPerlInterpreter::init() // declaration could be dropped as well... // I just haven't tried :D - KviQString::sprintf( + KviTQString::sprintf( szInitCode, "{\n" \ "package KVIrc;\n" \ @@ -202,9 +202,9 @@ void KviPerlInterpreter::done() m_pInterpreter = 0; } -QString KviPerlInterpreter::svToQString(SV * sv) +TQString KviPerlInterpreter::svToTQString(SV * sv) { - QString ret = ""; + TQString ret = ""; if(!sv)return ret; STRLEN len; char * ptr = SvPV(sv,len); @@ -213,11 +213,11 @@ QString KviPerlInterpreter::svToQString(SV * sv) } bool KviPerlInterpreter::execute( - const QString &szCode, - QStringList &args, - QString &szRetVal, - QString &szError, - QStringList &lWarnings) + const TQString &szCode, + TQStringList &args, + TQString &szRetVal, + TQString &szError, + TQStringList &lWarnings) { if(!m_pInterpreter) { @@ -227,7 +227,7 @@ bool KviPerlInterpreter::execute( g_lWarningList.clear(); - KviQCString szUtf8 = szCode.utf8(); + KviTQCString szUtf8 = szCode.utf8(); PERL_SET_CONTEXT(m_pInterpreter); // clear the _ array @@ -244,9 +244,9 @@ bool KviPerlInterpreter::execute( // set the args in the _ arry av_unshift(pArgs,(I32)args.count()); int idx = 0; - for(QStringList::Iterator it = args.begin();it != args.end();++it) + for(TQStringList::Iterator it = args.begin();it != args.end();++it) { - QString tmp = *it; + TQString tmp = *it; const char * val = tmp.utf8().data(); if(val) { @@ -275,7 +275,7 @@ bool KviPerlInterpreter::execute( if(pRet) { if(SvOK(pRet)) - szRetVal = svToQString(pRet); + szRetVal = svToTQString(pRet); } if(!g_lWarningList.isEmpty()) @@ -287,7 +287,7 @@ bool KviPerlInterpreter::execute( { if(SvOK(pRet)) { - szError = svToQString(pRet); + szError = svToTQString(pRet); if(!szError.isEmpty())return false; } } @@ -295,11 +295,11 @@ bool KviPerlInterpreter::execute( return true; } -static KviPointerHashTable<QString,KviPerlInterpreter> * g_pInterpreters = 0; +static KviPointerHashTable<TQString,KviPerlInterpreter> * g_pInterpreters = 0; -static KviPerlInterpreter * perlcore_get_interpreter(const QString &szContextName) +static KviPerlInterpreter * perlcore_get_interpreter(const TQString &szContextName) { - KviPerlInterpreter * i = g_pInterpreters->find(szContextName); + KviPerlInterpreter * i = g_pInterpreters->tqfind(szContextName); if(i)return i; i = new KviPerlInterpreter(szContextName); if(!i->init()) @@ -307,13 +307,13 @@ static KviPerlInterpreter * perlcore_get_interpreter(const QString &szContextNam delete i; return 0; } - g_pInterpreters->replace(szContextName,i); + g_pInterpreters->tqreplace(szContextName,i); return i; } -static void perlcore_destroy_interpreter(const QString &szContextName) +static void perlcore_destroy_interpreter(const TQString &szContextName) { - KviPerlInterpreter * i = g_pInterpreters->find(szContextName); + KviPerlInterpreter * i = g_pInterpreters->tqfind(szContextName); if(!i)return; g_pInterpreters->remove(szContextName); i->done(); @@ -322,7 +322,7 @@ static void perlcore_destroy_interpreter(const QString &szContextName) static void perlcore_destroy_all_interpreters() { - KviPointerHashTableIterator<QString,KviPerlInterpreter> it(*g_pInterpreters); + KviPointerHashTableIterator<TQString,KviPerlInterpreter> it(*g_pInterpreters); while(it.current()) { @@ -376,7 +376,7 @@ static bool perlcore_module_ctrl(KviModule * m,const char * cmd,void * param) static bool perlcore_module_init(KviModule * m) { #ifdef COMPILE_PERL_SUPPORT - g_pInterpreters = new KviPointerHashTable<QString,KviPerlInterpreter>(17,false); + g_pInterpreters = new KviPointerHashTable<TQString,KviPerlInterpreter>(17,false); g_pInterpreters->setAutoDelete(false); return true; #else // !COMPILE_PERL_SUPPORT diff --git a/src/modules/perlcore/perlcoreinterface.h b/src/modules/perlcore/perlcoreinterface.h index a7ceb1fc..0e26f2b4 100644 --- a/src/modules/perlcore/perlcoreinterface.h +++ b/src/modules/perlcore/perlcoreinterface.h @@ -29,7 +29,7 @@ #include "kvi_qstring.h" #include "kvi_kvs_runtimecontext.h" -#include <qstringlist.h> +#include <tqstringlist.h> #define KVI_PERLCORECTRLCOMMAND_EXECUTE "execute" @@ -38,13 +38,13 @@ typedef struct _KviPerlCoreCtrlCommand_execute { unsigned int uSize; KviKvsRunTimeContext * pKvsContext; - QString szContext; - QString szCode; + TQString szContext; + TQString szCode; bool bExitOk; - QString szRetVal; - QString szError; - QStringList lWarnings; - QStringList lArgs; + TQString szRetVal; + TQString szError; + TQStringList lWarnings; + TQStringList lArgs; bool bQuiet; } KviPerlCoreCtrlCommand_execute; @@ -53,7 +53,7 @@ typedef struct _KviPerlCoreCtrlCommand_execute typedef struct _KviPerlCoreCtrlCommand_destroy { unsigned int uSize; - QString szContext; + TQString szContext; } KviPerlCoreCtrlCommand_destroy; #endif // !_PERLCOREINTERFACE_H_ diff --git a/src/modules/perlcore/ppport.h b/src/modules/perlcore/ppport.h index 2a802132..86d03bce 100644 --- a/src/modules/perlcore/ppport.h +++ b/src/modules/perlcore/ppport.h @@ -81,11 +81,11 @@ /* #!/usr/bin/perl @ARGV = ("*.xs") if !@ARGV; -%badmacros = %funcs = %macros = (); $replace = 0; +%badmacros = %funcs = %macros = (); $tqreplace = 0; foreach (<DATA>) { $funcs{$1} = 1 if /Provide:\s+(\S+)/; $macros{$1} = 1 if /^#\s*define\s+([a-zA-Z0-9_]+)/; - $replace = $1 if /Replace:\s+(\d+)/; + $tqreplace = $1 if /Replace:\s+(\d+)/; $badmacros{$2}=$1 if $replace and /^#\s*define\s+([a-zA-Z0-9_]+).*?\s+([a-zA-Z0-9_]+)/; $badmacros{$1}=$2 if /Replace (\S+) with (\S+)/; } @@ -404,7 +404,7 @@ SV *sv; * * Code that uses these macros is responsible for the following: * 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts" - * 2. Declare a typedef named my_cxt_t that is a structure that contains + * 2. Declare a typedef named my_cxt_t that is a structure that tqcontains * all the data that needs to be interpreter-local. * 3. Use the START_MY_CXT macro after the declaration of my_cxt_t. * 4. Use the MY_CXT_INIT macro such that it is called exactly once diff --git a/src/modules/perlcore/xs.inc b/src/modules/perlcore/xs.inc index 5c31cb19..092e9369 100644 --- a/src/modules/perlcore/xs.inc +++ b/src/modules/perlcore/xs.inc @@ -41,7 +41,7 @@ XS(XS_KVIrc_echo) } else { pWnd = g_pCurrentKvsContext->window(); } - pWnd->outputNoFmt(colorset,QString::fromUtf8(text)); + pWnd->outputNoFmt(colorset,TQString::fromUtf8(text)); } #line 47 "KVIrc.c" } @@ -74,7 +74,7 @@ XS(XS_KVIrc_say) } else { pWnd = g_pCurrentKvsContext->window(); } - QString tmp = QString::fromUtf8(text); + TQString tmp = TQString::fromUtf8(text); KviUserInput::parse(tmp,pWnd); } #line 81 "KVIrc.c" @@ -108,7 +108,7 @@ XS(XS_KVIrc_internalWarning) char * text = (char *)SvPV_nolen(ST(0)); #line 48 "KVIrc.xs" if(!g_bExecuteQuiet) - g_lWarningList.append(QString(text)); + g_lWarningList.append(TQString(text)); #line 113 "KVIrc.c" } XSRETURN_EMPTY; @@ -125,11 +125,11 @@ XS(XS_KVIrc_getLocal) char * RETVAL; dXSTARG; #line 55 "KVIrc.xs" - QString tmp; + TQString tmp; KviStr hack; if(g_pCurrentKvsContext) { - KviKvsVariant * pVar = g_pCurrentKvsContext->localVariables()->find(varname); + KviKvsVariant * pVar = g_pCurrentKvsContext->localVariables()->tqfind(varname); if(pVar) { pVar->asString(tmp); @@ -179,11 +179,11 @@ XS(XS_KVIrc_getGlobal) char * RETVAL; dXSTARG; #line 88 "KVIrc.xs" - QString tmp; + TQString tmp; KviStr hack; if(g_pCurrentKvsContext) { - KviKvsVariant * pVar = g_pCurrentKvsContext->globalVariables()->find(varname); + KviKvsVariant * pVar = g_pCurrentKvsContext->globalVariables()->tqfind(varname); if(pVar) { pVar->asString(tmp); @@ -236,9 +236,9 @@ XS(XS_KVIrc_eval) if(g_pCurrentKvsContext && code) { KviKvsVariant ret; - if(KviKvsScript::run(QString::fromUtf8(code),g_pCurrentKvsContext->window(),0,&ret)) + if(KviKvsScript::run(TQString::fromUtf8(code),g_pCurrentKvsContext->window(),0,&ret)) { - QString tmp; + TQString tmp; ret.asString(tmp); g_szLastReturnValue = tmp; } else { |