summaryrefslogtreecommitdiffstats
path: root/lib/kross/api
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kross/api
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kross/api')
-rw-r--r--lib/kross/api/callable.cpp52
-rw-r--r--lib/kross/api/callable.h32
-rw-r--r--lib/kross/api/class.h14
-rw-r--r--lib/kross/api/dict.cpp14
-rw-r--r--lib/kross/api/dict.h14
-rw-r--r--lib/kross/api/event.h56
-rw-r--r--lib/kross/api/eventaction.cpp8
-rw-r--r--lib/kross/api/eventaction.h10
-rw-r--r--lib/kross/api/eventscript.cpp8
-rw-r--r--lib/kross/api/eventscript.h10
-rw-r--r--lib/kross/api/eventsignal.cpp24
-rw-r--r--lib/kross/api/eventsignal.h28
-rw-r--r--lib/kross/api/eventslot.cpp172
-rw-r--r--lib/kross/api/eventslot.h54
-rw-r--r--lib/kross/api/exception.cpp20
-rw-r--r--lib/kross/api/exception.h20
-rw-r--r--lib/kross/api/function.h2
-rw-r--r--lib/kross/api/interpreter.cpp22
-rw-r--r--lib/kross/api/interpreter.h42
-rw-r--r--lib/kross/api/list.cpp20
-rw-r--r--lib/kross/api/list.h42
-rw-r--r--lib/kross/api/module.h10
-rw-r--r--lib/kross/api/object.cpp14
-rw-r--r--lib/kross/api/object.h22
-rw-r--r--lib/kross/api/proxy.h10
-rw-r--r--lib/kross/api/qtobject.cpp116
-rw-r--r--lib/kross/api/qtobject.h50
-rw-r--r--lib/kross/api/script.h12
-rw-r--r--lib/kross/api/value.h4
-rw-r--r--lib/kross/api/variant.cpp110
-rw-r--r--lib/kross/api/variant.h82
31 files changed, 547 insertions, 547 deletions
diff --git a/lib/kross/api/callable.cpp b/lib/kross/api/callable.cpp
index 261a1bf0..a7a394ba 100644
--- a/lib/kross/api/callable.cpp
+++ b/lib/kross/api/callable.cpp
@@ -25,7 +25,7 @@
using namespace Kross::Api;
-Callable::Callable(const QString& name)
+Callable::Callable(const TQString& name)
: Object()
, m_name(name)
{
@@ -35,38 +35,38 @@ Callable::~Callable()
{
}
-const QString Callable::getName() const
+const TQString Callable::getName() const
{
return m_name;
}
-const QString Callable::getClassName() const
+const TQString Callable::getClassName() const
{
return "Kross::Api::Callable";
}
-bool Callable::hasChild(const QString& name) const
+bool Callable::hasChild(const TQString& name) const
{
- return m_children.contains(name);
+ return m_tqchildren.tqcontains(name);
}
-Object::Ptr Callable::getChild(const QString& name) const
+Object::Ptr Callable::getChild(const TQString& name) const
{
- return m_children[name];
+ return m_tqchildren[name];
}
-QMap<QString, Object::Ptr> Callable::getChildren() const
+TQMap<TQString, Object::Ptr> Callable::getChildren() const
{
- return m_children;
+ return m_tqchildren;
}
-bool Callable::addChild(const QString& name, Object* object)
+bool Callable::addChild(const TQString& name, Object* object)
{
#ifdef KROSS_API_OBJECT_ADDCHILD_DEBUG
- krossdebug( QString("Kross::Api::Callable::addChild() object.name='%1' object.classname='%2'")
- .arg(name).arg(object->getClassName()) );
+ krossdebug( TQString("Kross::Api::Callable::addChild() object.name='%1' object.classname='%2'")
+ .tqarg(name).tqarg(object->getClassName()) );
#endif
- m_children.replace(name, Object::Ptr(object));
+ m_tqchildren.tqreplace(name, Object::Ptr(object));
return true;
}
@@ -75,12 +75,12 @@ bool Callable::addChild(Callable* object)
return addChild(object->getName(), object);
}
-void Callable::removeChild(const QString& name)
+void Callable::removeChild(const TQString& name)
{
#ifdef KROSS_API_OBJECT_REMCHILD_DEBUG
- krossdebug( QString("Kross::Api::Callable::removeChild() name='%1'").arg(name) );
+ krossdebug( TQString("Kross::Api::Callable::removeChild() name='%1'").tqarg(name) );
#endif
- m_children.remove(name);
+ m_tqchildren.remove(name);
}
void Callable::removeAllChildren()
@@ -88,13 +88,13 @@ void Callable::removeAllChildren()
#ifdef KROSS_API_OBJECT_REMCHILD_DEBUG
krossdebug( "Kross::Api::Callable::removeAllChildren()" );
#endif
- m_children.clear();
+ m_tqchildren.clear();
}
-Object::Ptr Callable::call(const QString& name, List::Ptr args)
+Object::Ptr Callable::call(const TQString& name, List::Ptr args)
{
#ifdef KROSS_API_CALLABLE_CALL_DEBUG
- krossdebug( QString("Kross::Api::Callable::call() name=%1 getName()=%2 arguments=%3").arg(name).arg(getName()).arg(args ? args->toString() : QString("")) );
+ krossdebug( TQString("Kross::Api::Callable::call() name=%1 getName()=%2 arguments=%3").tqarg(name).tqarg(getName()).tqarg(args ? args->toString() : TQString("")) );
#endif
if(name.isEmpty()) // return a self-reference if no functionname is defined.
@@ -108,10 +108,10 @@ Object::Ptr Callable::call(const QString& name, List::Ptr args)
}
if(name == "get") {
- QString s = Variant::toString(args->item(0));
+ TQString s = Variant::toString(args->item(0));
Object::Ptr obj = getChild(s);
if(! obj)
- throw Exception::Ptr( new Exception(QString("The object '%1' has no child object '%2'").arg(getName()).arg(s)) );
+ throw Exception::Ptr( new Exception(TQString("The object '%1' has no child object '%2'").tqarg(getName()).tqarg(s)) );
return obj;
}
else if(name == "has") {
@@ -122,10 +122,10 @@ Object::Ptr Callable::call(const QString& name, List::Ptr args)
return Object::call(Variant::toString(args->item(0)), args);
}
else if(name == "list") {
- QStringList list;
- QMap<QString, Object::Ptr> children = getChildren();
- QMap<QString, Object::Ptr>::Iterator it( children.begin() );
- for(; it != children.end(); ++it)
+ TQStringList list;
+ TQMap<TQString, Object::Ptr> tqchildren = getChildren();
+ TQMap<TQString, Object::Ptr>::Iterator it( tqchildren.begin() );
+ for(; it != tqchildren.end(); ++it)
list.append( it.key() );
return new Variant(list);
}
@@ -134,6 +134,6 @@ Object::Ptr Callable::call(const QString& name, List::Ptr args)
}
// If there exists no such object return NULL.
- krossdebug( QString("Object '%1' has no callable object named '%2'.").arg(getName()).arg(name) );
+ krossdebug( TQString("Object '%1' has no callable object named '%2'.").tqarg(getName()).tqarg(name) );
return 0;
}
diff --git a/lib/kross/api/callable.h b/lib/kross/api/callable.h
index 4d25bd91..63edb067 100644
--- a/lib/kross/api/callable.h
+++ b/lib/kross/api/callable.h
@@ -24,8 +24,8 @@
#include "list.h"
//#include "exception.h"
-#include <qstring.h>
-#include <qvaluelist.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
#include <ksharedptr.h>
namespace Kross { namespace Api {
@@ -51,7 +51,7 @@ namespace Kross { namespace Api {
* \param name The name this callable object has and
* it is reachable as via \a getChild() .
*/
- Callable(const QString& name);
+ Callable(const TQString& name);
/**
* Destructor.
@@ -63,7 +63,7 @@ namespace Kross { namespace Api {
* has a name which is used e.g. on \a addChild to be able
* to identify the object itself.
*/
- const QString getName() const;
+ const TQString getName() const;
/**
* Return the class name. This could be something
@@ -72,14 +72,14 @@ namespace Kross { namespace Api {
*
* \return The name of this class.
*/
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/**
* Returns if the defined child is avaible.
*
* \return true if child exists else false.
*/
- bool hasChild(const QString& name) const;
+ bool hasChild(const TQString& name) const;
/**
* Return the defined child or NULL if there is
@@ -89,14 +89,14 @@ namespace Kross { namespace Api {
* \return The Object matching to the defined
* name or NULL if there is no such Object.
*/
- Object::Ptr getChild(const QString& name) const;
+ Object::Ptr getChild(const TQString& name) const;
/**
- * Return all children.
+ * Return all tqchildren.
*
- * \return A \a ObjectMap of children this Object has.
+ * \return A \a ObjectMap of tqchildren this Object has.
*/
- QMap<QString, Object::Ptr> getChildren() const;
+ TQMap<TQString, Object::Ptr> getChildren() const;
/**
* Add a new child. Replaces a possible already existing
@@ -107,7 +107,7 @@ namespace Kross { namespace Api {
* \return true if the Object was added successfully
* else false.
*/
- bool addChild(const QString& name, Object* object);
+ bool addChild(const TQString& name, Object* object);
/**
* Same as the \a addChild method above but for callable
@@ -122,23 +122,23 @@ namespace Kross { namespace Api {
* If there doesn't exists an Object with
* such name just nothing will be done.
*/
- void removeChild(const QString& name);
+ void removeChild(const TQString& name);
/**
- * Remove all children.
+ * Remove all tqchildren.
*/
void removeAllChildren();
/**
* Call the object.
*/
- virtual Object::Ptr call(const QString& name, List::Ptr arguments);
+ virtual Object::Ptr call(const TQString& name, List::Ptr arguments);
private:
/// Name this callable object has.
- QString m_name;
+ TQString m_name;
/// A list of childobjects.
- QMap<QString, Object::Ptr> m_children;
+ TQMap<TQString, Object::Ptr> m_tqchildren;
};
}}
diff --git a/lib/kross/api/class.h b/lib/kross/api/class.h
index afcfe425..de1d898c 100644
--- a/lib/kross/api/class.h
+++ b/lib/kross/api/class.h
@@ -20,10 +20,10 @@
#ifndef KROSS_API_CLASS_H
#define KROSS_API_CLASS_H
-#include <qstring.h>
-//#include <qvaluelist.h>
-//#include <qmap.h>
-#include <qobject.h>
+#include <tqstring.h>
+//#include <tqvaluelist.h>
+//#include <tqmap.h>
+#include <tqobject.h>
//#include "../main/krossconfig.h"
#include "object.h"
@@ -55,7 +55,7 @@ namespace Kross { namespace Api {
*
* \param name The name this class has.
*/
- Class(const QString& name)
+ Class(const TQString& name)
: Event<T>(name)
{
}
@@ -74,9 +74,9 @@ namespace Kross { namespace Api {
//operator Ptr () { return (T*)this; }
/*
- virtual Object::Ptr call(const QString& name, List::Ptr arguments)
+ virtual Object::Ptr call(const TQString& name, List::Ptr arguments)
{
- krossdebug( QString("Class::call(%1)").arg(name) );
+ krossdebug( TQString("Class::call(%1)").tqarg(name) );
return Event<T>::call(name, arguments);
}
*/
diff --git a/lib/kross/api/dict.cpp b/lib/kross/api/dict.cpp
index b9fa5ddc..7084c199 100644
--- a/lib/kross/api/dict.cpp
+++ b/lib/kross/api/dict.cpp
@@ -22,8 +22,8 @@
using namespace Kross::Api;
-Dict::Dict(const QMap<QString, Object::Ptr> value)
- : Value< List, QMap<QString, Object::Ptr> >(value)
+Dict::Dict(const TQMap<TQString, Object::Ptr> value)
+ : Value< List, TQMap<TQString, Object::Ptr> >(value)
{
}
@@ -31,16 +31,16 @@ Dict::~Dict()
{
}
-const QString Dict::getClassName() const
+const TQString Dict::getClassName() const
{
return "Kross::Api::Dict";
}
-const QString Dict::toString()
+const TQString Dict::toString()
{
- QString s = "[";
- QMap<QString, Object::Ptr> list = getValue();
- for(QMap<QString, Object::Ptr>::Iterator it = list.begin(); it != list.end(); ++it)
+ TQString s = "[";
+ TQMap<TQString, Object::Ptr> list = getValue();
+ for(TQMap<TQString, Object::Ptr>::Iterator it = list.begin(); it != list.end(); ++it)
s += "'" + it.key() + "' = '" + it.data()->toString() + "', ";
return (s.endsWith(", ") ? s.left(s.length() - 2) : s) + "]";
}
diff --git a/lib/kross/api/dict.h b/lib/kross/api/dict.h
index 773f36ac..80619448 100644
--- a/lib/kross/api/dict.h
+++ b/lib/kross/api/dict.h
@@ -20,8 +20,8 @@
#ifndef KROSS_API_DICT_H
#define KROSS_API_DICT_H
-#include <qstring.h>
-#include <qmap.h>
+#include <tqstring.h>
+#include <tqmap.h>
#include "object.h"
#include "value.h"
@@ -32,9 +32,9 @@ namespace Kross { namespace Api {
* The Dict class implementates \a Value to handle
* key=value base dictonaries/maps.
*/
- class Dict : public Value< List, QMap<QString, Object::Ptr> >
+ class Dict : public Value< List, TQMap<TQString, Object::Ptr> >
{
- friend class Value< List, QMap<QString, Object::Ptr> >;
+ friend class Value< List, TQMap<TQString, Object::Ptr> >;
public:
/**
@@ -44,7 +44,7 @@ namespace Kross { namespace Api {
* via there string-identifier that is in this
* \a Dict intialy.
*/
- explicit Dict(const QMap<QString, Object::Ptr> value);
+ explicit Dict(const TQMap<TQString, Object::Ptr> value);
/**
* Destructor.
@@ -52,14 +52,14 @@ namespace Kross { namespace Api {
virtual ~Dict();
/// \see Kross::Api::Object::getClassName()
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/**
* \return a string representation of the whole dictonary.
*
* \see Kross::Api::Object::toString()
*/
- virtual const QString toString();
+ virtual const TQString toString();
};
diff --git a/lib/kross/api/event.h b/lib/kross/api/event.h
index 2df5a331..e378052b 100644
--- a/lib/kross/api/event.h
+++ b/lib/kross/api/event.h
@@ -29,9 +29,9 @@
#include "proxy.h"
#include "variant.h"
-#include <qstring.h>
-#include <qvaluelist.h>
-#include <qmap.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
+#include <tqmap.h>
namespace Kross { namespace Api {
@@ -39,7 +39,7 @@ namespace Kross { namespace Api {
* Template class for all kinds of callable events. An
* event is the abstract base for callable objects like
* methodfunctions in \a Class instances or \a EventSlot
- * and \a EventSignal to access Qt signals and slots.
+ * and \a EventSignal to access TQt signals and slots.
*/
template<class T>
class Event : public Callable
@@ -55,7 +55,7 @@ namespace Kross { namespace Api {
* List of memberfunctions. Each function is accessible
* by the functionname.
*/
- QMap<QString, Function* > m_functions;
+ TQMap<TQString, Function* > m_functions;
public:
@@ -64,7 +64,7 @@ namespace Kross { namespace Api {
*
* \param name The name this \a Event has.
*/
- Event(const QString& name)
+ Event(const TQString& name)
: Callable(name)
{
}
@@ -74,8 +74,8 @@ namespace Kross { namespace Api {
*/
virtual ~Event()
{
- QMapConstIterator<QString, Function* > endit = m_functions.constEnd();
- for(QMapConstIterator<QString, Function* > it = m_functions.constBegin(); it != endit; ++it)
+ TQMapConstIterator<TQString, Function* > endit = m_functions.constEnd();
+ for(TQMapConstIterator<TQString, Function* > it = m_functions.constBegin(); it != endit; ++it)
delete it.data();
}
@@ -95,9 +95,9 @@ namespace Kross { namespace Api {
*
* \todo Remove this method as soon as there is no code using it
*/
- inline void addFunction(const QString& name, FunctionPtr function)
+ inline void addFunction(const TQString& name, FunctionPtr function)
{
- m_functions.replace(name, new Function0<T>(static_cast<T*>(this), function));
+ m_functions.tqreplace(name, new Function0<T>(static_cast<T*>(this), function));
}
/**
@@ -112,9 +112,9 @@ namespace Kross { namespace Api {
* owner of the \a Function instance and will take
* care of deleting it if this \a Event got deleted.
*/
- inline void addFunction(const QString& name, Function* function)
+ inline void addFunction(const TQString& name, Function* function)
{
- m_functions.replace(name, function);
+ m_functions.tqreplace(name, function);
}
/**
@@ -122,9 +122,9 @@ namespace Kross { namespace Api {
* to this \a Event instance.
*/
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class ARG3OBJ, class ARG4OBJ, class INSTANCE, typename METHOD>
- inline void addFunction4(const QString& name, INSTANCE* instance, METHOD method, ARG1OBJ* arg1 = 0, ARG2OBJ* arg2 = 0, ARG3OBJ* arg3 = 0, ARG4OBJ* arg4 = 0)
+ inline void addFunction4(const TQString& name, INSTANCE* instance, METHOD method, ARG1OBJ* arg1 = 0, ARG2OBJ* arg2 = 0, ARG3OBJ* arg3 = 0, ARG4OBJ* arg4 = 0)
{
- m_functions.replace(name,
+ m_functions.tqreplace(name,
new Kross::Api::ProxyFunction<INSTANCE, METHOD, RETURNOBJ, ARG1OBJ, ARG2OBJ, ARG3OBJ, ARG4OBJ>
(instance, method, arg1, arg2, arg3, arg4)
);
@@ -132,9 +132,9 @@ namespace Kross { namespace Api {
/// Same as above with three arguments.
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class ARG3OBJ, class INSTANCE, typename METHOD>
- inline void addFunction3(const QString& name, INSTANCE* instance, METHOD method, ARG1OBJ* arg1 = 0, ARG2OBJ* arg2 = 0, ARG3OBJ* arg3 = 0)
+ inline void addFunction3(const TQString& name, INSTANCE* instance, METHOD method, ARG1OBJ* arg1 = 0, ARG2OBJ* arg2 = 0, ARG3OBJ* arg3 = 0)
{
- m_functions.replace(name,
+ m_functions.tqreplace(name,
new Kross::Api::ProxyFunction<INSTANCE, METHOD, RETURNOBJ, ARG1OBJ, ARG2OBJ, ARG3OBJ>
(instance, method, arg1, arg2, arg3)
);
@@ -142,9 +142,9 @@ namespace Kross { namespace Api {
/// Same as above with two arguments.
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class INSTANCE, typename METHOD>
- inline void addFunction2(const QString& name, INSTANCE* instance, METHOD method, ARG1OBJ* arg1 = 0, ARG2OBJ* arg2 = 0)
+ inline void addFunction2(const TQString& name, INSTANCE* instance, METHOD method, ARG1OBJ* arg1 = 0, ARG2OBJ* arg2 = 0)
{
- m_functions.replace(name,
+ m_functions.tqreplace(name,
new Kross::Api::ProxyFunction<INSTANCE, METHOD, RETURNOBJ, ARG1OBJ, ARG2OBJ>
(instance, method, arg1, arg2)
);
@@ -152,9 +152,9 @@ namespace Kross { namespace Api {
/// Same as above, but with one argument.
template<class RETURNOBJ, class ARG1OBJ, class INSTANCE, typename METHOD>
- inline void addFunction1(const QString& name, INSTANCE* instance, METHOD method, ARG1OBJ* arg1 = 0)
+ inline void addFunction1(const TQString& name, INSTANCE* instance, METHOD method, ARG1OBJ* arg1 = 0)
{
- m_functions.replace(name,
+ m_functions.tqreplace(name,
new Kross::Api::ProxyFunction<INSTANCE, METHOD, RETURNOBJ, ARG1OBJ>
(instance, method, arg1)
);
@@ -162,9 +162,9 @@ namespace Kross { namespace Api {
/// Same as above with no arguments.
template<class RETURNOBJ, class INSTANCE, typename METHOD>
- inline void addFunction0(const QString& name, INSTANCE* instance, METHOD method)
+ inline void addFunction0(const TQString& name, INSTANCE* instance, METHOD method)
{
- m_functions.replace(name,
+ m_functions.tqreplace(name,
new Kross::Api::ProxyFunction<INSTANCE, METHOD, RETURNOBJ>
(instance, method)
);
@@ -175,9 +175,9 @@ namespace Kross { namespace Api {
* \param name the function name
* \return true if the function is available in this \a Callable
*/
- bool isAFunction(const QString & name) const
+ bool isAFunction(const TQString & name) const
{
- return m_functions.contains(name);
+ return m_functions.tqcontains(name);
}
/**
@@ -190,7 +190,7 @@ namespace Kross { namespace Api {
* \param name The functionname. Each function this
* Object holds should have a different
* name cause they are access by they name.
- * If name is QString::null or empty, a
+ * If name is TQString() or empty, a
* self-reference to this instance is
* returned.
* \param arguments The list of arguments.
@@ -198,16 +198,16 @@ namespace Kross { namespace Api {
* or NULL if there doesn't exists such a
* function with defined name.
*/
- virtual Object::Ptr call(const QString& name, List::Ptr arguments)
+ virtual Object::Ptr call(const TQString& name, List::Ptr arguments)
{
#ifdef KROSS_API_EVENT_CALL_DEBUG
- krossdebug( QString("Event::call() name='%1' getName()='%2'").arg(name).arg(getName()) );
+ krossdebug( TQString("Event::call() name='%1' getName()='%2'").tqarg(name).tqarg(getName()) );
#endif
Function* function = m_functions[name];
if(function) {
#ifdef KROSS_API_EVENT_CALL_DEBUG
- krossdebug( QString("Event::call() name='%1' is a builtin function.").arg(name) );
+ krossdebug( TQString("Event::call() name='%1' is a builtin function.").tqarg(name) );
#endif
return function->call(arguments);
}
diff --git a/lib/kross/api/eventaction.cpp b/lib/kross/api/eventaction.cpp
index fffaec5c..4210fb0e 100644
--- a/lib/kross/api/eventaction.cpp
+++ b/lib/kross/api/eventaction.cpp
@@ -20,13 +20,13 @@
#include "eventaction.h"
#include "variant.h"
-//#include <qobject.h>
+//#include <tqobject.h>
//#include <kaction.h>
using namespace Kross::Api;
-EventAction::EventAction(const QString& name, KAction* action)
- : Event<EventAction>(name.isEmpty() ? action->name() : name)
+EventAction::EventAction(const TQString& name, KAction* action)
+ : Event<EventAction>(name.isEmpty() ? TQString(action->name()) : name)
, m_action(action)
{
addFunction("getText", &EventAction::getText);
@@ -42,7 +42,7 @@ EventAction::~EventAction()
{
}
-const QString EventAction::getClassName() const
+const TQString EventAction::getClassName() const
{
return "Kross::Api::EventAction";
}
diff --git a/lib/kross/api/eventaction.h b/lib/kross/api/eventaction.h
index 8f09c116..659240fa 100644
--- a/lib/kross/api/eventaction.h
+++ b/lib/kross/api/eventaction.h
@@ -20,8 +20,8 @@
#ifndef KROSS_API_EVENTACTION_H
#define KROSS_API_EVENTACTION_H
-#include <qstring.h>
-//#include <qobject.h>
+#include <tqstring.h>
+//#include <tqobject.h>
#include <kaction.h>
#include <ksharedptr.h>
@@ -50,7 +50,7 @@ namespace Kross { namespace Api {
/**
* Constructor.
*/
- EventAction(const QString& name, KAction* action);
+ EventAction(const TQString& name, KAction* action);
/**
* Destructor.
@@ -58,10 +58,10 @@ namespace Kross { namespace Api {
virtual ~EventAction();
/// \see Kross::Api::Object::getClassName()
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/// \see Kross::Api::Event::call()
- //virtual Object::Ptr call(const QString& name, KSharedPtr<List> arguments);
+ //virtual Object::Ptr call(const TQString& name, KSharedPtr<List> arguments);
private:
KAction* m_action;
diff --git a/lib/kross/api/eventscript.cpp b/lib/kross/api/eventscript.cpp
index 39ceb59d..43c4c1cb 100644
--- a/lib/kross/api/eventscript.cpp
+++ b/lib/kross/api/eventscript.cpp
@@ -24,7 +24,7 @@
using namespace Kross::Api;
-EventScript::EventScript(const QString& name)
+EventScript::EventScript(const TQString& name)
: Event<EventScript>(name)
{
}
@@ -33,14 +33,14 @@ EventScript::~EventScript()
{
}
-const QString EventScript::getClassName() const
+const TQString EventScript::getClassName() const
{
return "Kross::Api::EventScript";
}
-Object::Ptr EventScript::call(const QString& name, KSharedPtr<List> arguments)
+Object::Ptr EventScript::call(const TQString& name, KSharedPtr<List> arguments)
{
- krossdebug( QString("EventScript::call() name=%1 arguments=%2").arg(name).arg(arguments->toString()) );
+ krossdebug( TQString("EventScript::call() name=%1 arguments=%2").tqarg(name).tqarg(arguments->toString()) );
//TODO
return 0;
}
diff --git a/lib/kross/api/eventscript.h b/lib/kross/api/eventscript.h
index 8ef9b7eb..0f62ddfc 100644
--- a/lib/kross/api/eventscript.h
+++ b/lib/kross/api/eventscript.h
@@ -20,8 +20,8 @@
#ifndef KROSS_API_EVENTSCRIPT_H
#define KROSS_API_EVENTSCRIPT_H
-#include <qstring.h>
-#include <qobject.h>
+#include <tqstring.h>
+#include <tqobject.h>
#include "event.h"
@@ -43,16 +43,16 @@ namespace Kross { namespace Api {
/**
* Constructor.
*/
- EventScript(const QString& name);
+ EventScript(const TQString& name);
/**
* Destructor.
*/
virtual ~EventScript();
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
- virtual Object::Ptr call(const QString& name, KSharedPtr<List> arguments);
+ virtual Object::Ptr call(const TQString& name, KSharedPtr<List> arguments);
private:
//ScriptContainer* m_scriptcontainer;
diff --git a/lib/kross/api/eventsignal.cpp b/lib/kross/api/eventsignal.cpp
index 455ca61f..c3e94620 100644
--- a/lib/kross/api/eventsignal.cpp
+++ b/lib/kross/api/eventsignal.cpp
@@ -22,15 +22,15 @@
#include "variant.h"
#include "qtobject.h"
-#include <qmetaobject.h>
-#include <private/qucom_p.h> // for the Qt QUObject API.
+#include <tqmetaobject.h>
+#include <tqucom_p.h> // for the TQt TQUObject API.
using namespace Kross::Api;
-EventSignal::EventSignal(const QString& name, QObject* sender, QCString signal)
+EventSignal::EventSignal(const TQString& name, TQObject* sender, TQCString signal)
: Event<EventSignal>(name)
, m_sender(sender)
- , m_signal(signal) //QObject::normalizeSignalSlot(signal)
+ , m_signal(signal) //TQObject::normalizeSignalSlot(signal)
{
}
@@ -38,29 +38,29 @@ EventSignal::~EventSignal()
{
}
-const QString EventSignal::getClassName() const
+const TQString EventSignal::getClassName() const
{
return "Kross::Api::EventSignal";
}
-Object::Ptr EventSignal::call(const QString& /*name*/, KSharedPtr<List> arguments)
+Object::Ptr EventSignal::call(const TQString& /*name*/, KSharedPtr<List> arguments)
{
#ifdef KROSS_API_EVENTSIGNAL_CALL_DEBUG
- krossdebug( QString("EventSignal::call() m_signal=%1 arguments=%2").arg(m_signal).arg(arguments->toString()) );
+ krossdebug( TQString("EventSignal::call() m_signal=%1 arguments=%2").tqarg(m_signal).tqarg(arguments->toString()) );
#endif
- QString n = m_signal;
+ TQString n = m_signal;
if(n.startsWith("2")) // Remove prefix of SIGNAL-macros
n.remove(0,1);
- int signalid = m_sender->metaObject()->findSignal(n.latin1(), false);
+ int signalid = m_sender->tqmetaObject()->tqfindSignal(n.latin1(), false);
if(signalid < 0)
- throw new Exception(QString("No such signal '%1'.").arg(n));
+ throw new Exception(TQString("No such signal '%1'.").tqarg(n));
- QUObject* uo = QtObject::toQUObject(n, arguments);
+ TQUObject* uo = QtObject::toTQUObject(n, arguments);
m_sender->qt_emit(signalid, uo); // emit the signal
delete [] uo;
- return new Variant( QVariant(true,0) );
+ return new Variant( TQVariant(true,0) );
}
diff --git a/lib/kross/api/eventsignal.h b/lib/kross/api/eventsignal.h
index aea58b12..6117014e 100644
--- a/lib/kross/api/eventsignal.h
+++ b/lib/kross/api/eventsignal.h
@@ -20,13 +20,13 @@
#ifndef KROSS_API_EVENTSIGNAL_H
#define KROSS_API_EVENTSIGNAL_H
-//#include <qstring.h>
-//#include <qvaluelist.h>
-//#include <qmap.h>
-//#include <qvariant.h>
-//#include <qsignalmapper.h>
-//#include <qguardedptr.h>
-#include <qobject.h>
+//#include <tqstring.h>
+//#include <tqvaluelist.h>
+//#include <tqmap.h>
+//#include <tqvariant.h>
+//#include <tqsignalmapper.h>
+//#include <tqguardedptr.h>
+#include <tqobject.h>
#include <ksharedptr.h>
#include "event.h"
@@ -34,7 +34,7 @@
namespace Kross { namespace Api {
/**
- * Each Qt signal and slot connection between a QObject
+ * Each TQt signal and slot connection between a TQObject
* instance and a functionname is represented with
* a EventSignal and handled by \a EventManager.
*/
@@ -50,27 +50,27 @@ namespace Kross { namespace Api {
/**
* Constructor.
*/
- EventSignal(const QString& name, QObject* sender, QCString signal);
+ EventSignal(const TQString& name, TQObject* sender, TQCString signal);
/**
* Destructor.
*/
virtual ~EventSignal();
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
- virtual Object::Ptr call(const QString& name, KSharedPtr<List> arguments);
+ virtual Object::Ptr call(const TQString& name, KSharedPtr<List> arguments);
/*
signals:
void callback();
- void callback(const QString&);
+ void callback(const TQString&);
void callback(int);
void callback(bool);
*/
private:
- QObject* m_sender;
- QCString m_signal;
+ TQObject* m_sender;
+ TQCString m_signal;
};
}}
diff --git a/lib/kross/api/eventslot.cpp b/lib/kross/api/eventslot.cpp
index df70c9c8..fed92ea0 100644
--- a/lib/kross/api/eventslot.cpp
+++ b/lib/kross/api/eventslot.cpp
@@ -22,15 +22,15 @@
#include "variant.h"
#include "qtobject.h"
-#include <qmetaobject.h>
-#include <private/qucom_p.h> // for the Qt QUObject API.
+#include <tqmetaobject.h>
+#include <tqucom_p.h> // for the TQt TQUObject API.
using namespace Kross::Api;
-EventSlot::EventSlot(const QString& name, QObject* receiver, QCString slot)
+EventSlot::EventSlot(const TQString& name, TQObject* receiver, TQCString slot)
: Event<EventSlot>(name)
, m_receiver(receiver)
- , m_slot(slot) //QObject::normalizeSignalSlot(slot)
+ , m_slot(slot) //TQObject::normalizeSignalSlot(slot)
{
}
@@ -38,75 +38,75 @@ EventSlot::~EventSlot()
{
}
-const QString EventSlot::getClassName() const
+const TQString EventSlot::getClassName() const
{
return "Kross::Api::EventSlot";
}
-Object::Ptr EventSlot::call(const QString& /*name*/, List::Ptr arguments)
+Object::Ptr EventSlot::call(const TQString& /*name*/, List::Ptr arguments)
{
#ifdef KROSS_API_EVENTSLOT_CALL_DEBUG
- krossdebug( QString("EventSlot::call() m_slot=%1 arguments=%2").arg(m_slot).arg(arguments->toString()) );
+ krossdebug( TQString("EventSlot::call() m_slot=%1 arguments=%2").tqarg(m_slot).tqarg(arguments->toString()) );
#endif
- QString n = m_slot; //TODO name; //Variant::toString(args->item(0));
+ TQString n = m_slot; //TODO name; //Variant::toString(args->item(0));
if(n.startsWith("1")) // Remove prefix of SLOT-macros
n.remove(0,1);
- int slotid = m_receiver->metaObject()->findSlot(n.latin1(), false);
+ int slotid = m_receiver->tqmetaObject()->tqfindSlot(n.latin1(), false);
if(slotid < 0)
- throw Exception::Ptr( new Exception(QString("No such slot '%1'.").arg(n)) );
+ throw Exception::Ptr( new Exception(TQString("No such slot '%1'.").tqarg(n)) );
- QUObject* uo = QtObject::toQUObject(n, arguments);
+ TQUObject* uo = QtObject::toTQUObject(n, arguments);
m_receiver->qt_invoke(slotid, uo); // invoke the slot
delete [] uo;
- return new Variant( QVariant(true,0) );
+ return new Variant( TQVariant(true,0) );
}
/*
-QCString EventSlot::getSlot(const QCString& signal)
+TQCString EventSlot::getSlot(const TQCString& signal)
{
- QString signature = QString(signal).mid(1);
- int startpos = signature.find("(");
- int endpos = signature.findRev(")");
+ TQString signature = TQString(signal).mid(1);
+ int startpos = signature.tqfind("(");
+ int endpos = signature.tqfindRev(")");
if(startpos < 0 || startpos > endpos) {
- krosswarning( QString("EventSlot::getSlot(%1) Invalid signal.").arg(signal) );
- return QCString();
+ krosswarning( TQString("EventSlot::getSlot(%1) Invalid signal.").tqarg(signal) );
+ return TQCString();
}
- QString signalname = signature.left(startpos);
- QString params = signature.mid(startpos + 1, endpos - startpos - 1);
- //QStringList paramlist = QStringList::split(",", params);
- QCString slot = QString("callback(" + params + ")").latin1(); //normalizeSignalSlot();
+ TQString signalname = signature.left(startpos);
+ TQString params = signature.mid(startpos + 1, endpos - startpos - 1);
+ //TQStringList paramlist = TQStringList::split(",", params);
+ TQCString slot = TQString("callback(" + params + ")").latin1(); //normalizeSignalSlot();
- QMetaObject* mo = metaObject();
+ TQMetaObject* mo = tqmetaObject();
int slotid = mo->findSlot(slot, false);
if(slotid < 0) {
- krossdebug( QString("EventSlot::getSlot(%1) No such slot '%2' avaiable.").arg(signal).arg(slot) );
- return QCString();
+ krossdebug( TQString("EventSlot::getSlot(%1) No such slot '%2' avaiable.").tqarg(signal).tqarg(slot) );
+ return TQCString();
}
- const QMetaData* md = mo->slot(slotid, false);
- if(md->access != QMetaData::Public) {
- krossdebug( QString("EventSlot::getSlot(%1) The slot '%2' is not public.").arg(signal).arg(slot) );
- return QCString();
+ const TQMetaData* md = mo->slot(slotid, false);
+ if(md->access != TQMetaData::Public) {
+ krossdebug( TQString("EventSlot::getSlot(%1) The slot '%2' is not public.").tqarg(signal).tqarg(slot) );
+ return TQCString();
}
-//QMember* member = md->member;
-//const QUMethod *method = md->method;
+//TQMember* member = md->member;
+//const TQUMethod *method = md->method;
- krossdebug( QString("signal=%1 slot=%2 slotid=%3 params=%4 mdname=%5")
- .arg(signal).arg(slot).arg(slotid).arg(params).arg(md->name) );
- return QCString("1" + slot); // Emulate the SLOT(...) macro by adding as first char a "1".
+ krossdebug( TQString("signal=%1 slot=%2 slotid=%3 params=%4 mdname=%5")
+ .tqarg(signal).tqarg(slot).tqarg(slotid).tqarg(params).tqarg(md->name) );
+ return TQCString("1" + slot); // Emulate the TQT_SLOT(...) macro by adding as first char a "1".
}
-bool EventSlot::connect(EventManager* eventmanager, QObject* senderobj, const QCString& signal, QString function, const QCString& slot)
+bool EventSlot::connect(EventManager* eventmanager, TQObject* senderobj, const TQCString& signal, TQString function, const TQCString& slot)
{
if(m_sender && ! disconnect())
return false;
- const QCString& myslot = slot.isEmpty() ? getSlot(signal) : slot;
+ const TQCString& myslot = slot.isEmpty() ? getSlot(signal) : slot;
if(! myslot)
return false;
@@ -114,18 +114,18 @@ bool EventSlot::connect(EventManager* eventmanager, QObject* senderobj, const QC
EventSlot* eventslot = create(eventmanager);
eventslot->connect(eventmanager, senderobj, signal, function, slot);
m_slots.append(eventslot);
- krossdebug( QString("EventSlot::connect(%1, %2, %3) added child EventSlot !!!").arg(senderobj->name()).arg(signal).arg(function) );
+ krossdebug( TQString("EventSlot::connect(%1, %2, %3) added child EventSlot !!!").tqarg(senderobj->name()).tqarg(signal).tqarg(function) );
}
else {
m_sender = senderobj;
m_signal = signal;
m_function = function;
m_slot = myslot;
- if(! QObject::connect((QObject*)senderobj, signal, this, myslot)) {
- krossdebug( QString("EventSlot::connect(%1, %2, %3) failed.").arg(senderobj->name()).arg(signal).arg(function) );
+ if(! TQObject::connect((TQObject*)senderobj, signal, this, myslot)) {
+ krossdebug( TQString("EventSlot::connect(%1, %2, %3) failed.").tqarg(senderobj->name()).tqarg(signal).tqarg(function) );
return false;
}
- krossdebug( QString("EventSlot::connect(%1, %2, %3) successfully connected.").arg(senderobj->name()).arg(signal).arg(function) );
+ krossdebug( TQString("EventSlot::connect(%1, %2, %3) successfully connected.").tqarg(senderobj->name()).tqarg(signal).tqarg(function) );
}
return true;
}
@@ -133,22 +133,22 @@ bool EventSlot::connect(EventManager* eventmanager, QObject* senderobj, const QC
bool EventSlot::disconnect()
{
if(! m_sender) return false;
- QObject::disconnect((QObject*)m_sender, m_signal, this, m_slot);
+ TQObject::disconnect((TQObject*)m_sender, m_signal, this, m_slot);
m_sender = 0;
m_signal = 0;
m_slot = 0;
- m_function = QString::null;
+ m_function = TQString();
return true;
}
-void EventSlot::call(const QVariant& variant)
+void EventSlot::call(const TQVariant& variant)
{
- krossdebug( QString("EventSlot::call() sender='%1' signal='%2' function='%3'")
- .arg(m_sender->name()).arg(m_signal).arg(m_function) );
+ krossdebug( TQString("EventSlot::call() sender='%1' signal='%2' function='%3'")
+ .tqarg(m_sender->name()).tqarg(m_signal).tqarg(m_function) );
Kross::Api::List* arglist = 0;
- QValueList<Kross::Api::Object*> args;
+ TQValueList<Kross::Api::Object*> args;
if(variant.isValid()) {
args.append(Kross::Api::Variant::create(variant));
arglist = Kross::Api::List::create(args);
@@ -159,64 +159,64 @@ void EventSlot::call(const QVariant& variant)
}
catch(Exception& e) {
//TODO add hadError(), getError() and setError()
- krossdebug( QString("EXCEPTION in EventSlot::call('%1') type='%2' description='%3'").arg(variant.toString()).arg(e.type()).arg(e.description()) );
+ krossdebug( TQString("EXCEPTION in EventSlot::call('%1') type='%2' description='%3'").tqarg(variant.toString()).tqarg(e.type()).tqarg(e.description()) );
}
}
void EventSlot::callback() {
- call(QVariant()); }
+ call(TQVariant()); }
void EventSlot::callback(short s) {
- call(QVariant(s)); }
+ call(TQVariant(s)); }
void EventSlot::callback(int i) {
- call(QVariant(i)); }
+ call(TQVariant(i)); }
void EventSlot::callback(int i1, int i2) {
- call(QVariant( QValueList<QVariant>() << i1 << i2 )); }
+ call(TQVariant( TQValueList<TQVariant>() << i1 << i2 )); }
void EventSlot::callback(int i1, int i2, int i3) {
- call(QVariant( QValueList<QVariant>() << i1 << i2 << i3 )); }
+ call(TQVariant( TQValueList<TQVariant>() << i1 << i2 << i3 )); }
void EventSlot::callback(int i1, int i2, int i3, int i4) {
- call(QVariant( QValueList<QVariant>() << i1 << i2 << i3 << i4 )); }
+ call(TQVariant( TQValueList<TQVariant>() << i1 << i2 << i3 << i4 )); }
void EventSlot::callback(int i1, int i2, int i3, int i4, int i5) {
- call(QVariant( QValueList<QVariant>() << i1 << i2 << i3 << i4 << i5 )); }
+ call(TQVariant( TQValueList<TQVariant>() << i1 << i2 << i3 << i4 << i5 )); }
void EventSlot::callback(int i1, int i2, int i3, int i4, bool b) {
- call(QVariant( QValueList<QVariant>() << i1 << i2 << i3 << i4 << b )); }
+ call(TQVariant( TQValueList<TQVariant>() << i1 << i2 << i3 << i4 << b )); }
void EventSlot::callback(int i1, bool b) {
- call(QVariant( QValueList<QVariant>() << i1 << b )); }
+ call(TQVariant( TQValueList<TQVariant>() << i1 << b )); }
void EventSlot::callback(int i1, int i2, bool b) {
- call(QVariant( QValueList<QVariant>() << i1 << i2 << b )); }
-void EventSlot::callback(int i1, int i2, const QString& s) {
- call(QVariant( QValueList<QVariant>() << i1 << i2 << s )); }
+ call(TQVariant( TQValueList<TQVariant>() << i1 << i2 << b )); }
+void EventSlot::callback(int i1, int i2, const TQString& s) {
+ call(TQVariant( TQValueList<TQVariant>() << i1 << i2 << s )); }
void EventSlot::callback(uint i) {
- call(QVariant(i)); }
+ call(TQVariant(i)); }
void EventSlot::callback(long l) {
- call(QVariant((Q_LLONG)l)); }
+ call(TQVariant((TQ_LLONG)l)); }
void EventSlot::callback(ulong l) {
- call(QVariant((Q_ULLONG)l)); }
+ call(TQVariant((TQ_ULLONG)l)); }
void EventSlot::callback(double d) {
- call(QVariant(d)); }
+ call(TQVariant(d)); }
void EventSlot::callback(const char* c) {
- call(QVariant(c)); }
+ call(TQVariant(c)); }
void EventSlot::callback(bool b) {
- call(QVariant(b)); }
-void EventSlot::callback(const QString& s) {
- call(QVariant(s)); }
-void EventSlot::callback(const QString& s, int i) {
- call(QVariant( QValueList<QVariant>() << s << i )); }
-void EventSlot::callback(const QString& s, int i1, int i2) {
- call(QVariant( QValueList<QVariant>() << s << i1 << i2 )); }
-void EventSlot::callback(const QString& s, uint i) {
- call(QVariant( QValueList<QVariant>() << s << i )); }
-void EventSlot::callback(const QString& s, bool b) {
- call(QVariant( QValueList<QVariant>() << s << b )); }
-void EventSlot::callback(const QString& s, bool b1, bool b2) {
- call(QVariant( QValueList<QVariant>() << s << b1 << b2 )); }
-void EventSlot::callback(const QString& s, bool b, int i) {
- call(QVariant( QValueList<QVariant>() << s << b << i )); }
-void EventSlot::callback(const QString& s1, const QString& s2) {
- call(QVariant( QValueList<QVariant>() << s1 << s2 )); }
-void EventSlot::callback(const QString& s1, const QString& s2, const QString& s3) {
- call(QVariant( QValueList<QVariant>() << s1 << s2 << s3 )); }
-void EventSlot::callback(const QStringList& sl) {
- call(QVariant(sl)); }
-void EventSlot::callback(const QVariant& variant) {
+ call(TQVariant(b)); }
+void EventSlot::callback(const TQString& s) {
+ call(TQVariant(s)); }
+void EventSlot::callback(const TQString& s, int i) {
+ call(TQVariant( TQValueList<TQVariant>() << s << i )); }
+void EventSlot::callback(const TQString& s, int i1, int i2) {
+ call(TQVariant( TQValueList<TQVariant>() << s << i1 << i2 )); }
+void EventSlot::callback(const TQString& s, uint i) {
+ call(TQVariant( TQValueList<TQVariant>() << s << i )); }
+void EventSlot::callback(const TQString& s, bool b) {
+ call(TQVariant( TQValueList<TQVariant>() << s << b )); }
+void EventSlot::callback(const TQString& s, bool b1, bool b2) {
+ call(TQVariant( TQValueList<TQVariant>() << s << b1 << b2 )); }
+void EventSlot::callback(const TQString& s, bool b, int i) {
+ call(TQVariant( TQValueList<TQVariant>() << s << b << i )); }
+void EventSlot::callback(const TQString& s1, const TQString& s2) {
+ call(TQVariant( TQValueList<TQVariant>() << s1 << s2 )); }
+void EventSlot::callback(const TQString& s1, const TQString& s2, const TQString& s3) {
+ call(TQVariant( TQValueList<TQVariant>() << s1 << s2 << s3 )); }
+void EventSlot::callback(const TQStringList& sl) {
+ call(TQVariant(sl)); }
+void EventSlot::callback(const TQVariant& variant) {
call(variant); }
*/
diff --git a/lib/kross/api/eventslot.h b/lib/kross/api/eventslot.h
index 8f564103..f9736fd0 100644
--- a/lib/kross/api/eventslot.h
+++ b/lib/kross/api/eventslot.h
@@ -20,8 +20,8 @@
#ifndef KROSS_API_EVENTSLOT_H
#define KROSS_API_EVENTSLOT_H
-#include <qstring.h>
-#include <qobject.h>
+#include <tqstring.h>
+#include <tqobject.h>
#include <ksharedptr.h>
#include "event.h"
@@ -29,7 +29,7 @@
namespace Kross { namespace Api {
/**
- * Each Qt signal and slot connection between a QObject
+ * Each TQt signal and slot connection between a TQObject
* instance and a functionname is represented with
* a EventSlot and handled by the \a EventManager.
*/
@@ -47,12 +47,12 @@ namespace Kross { namespace Api {
*
* \param name The name of the EventSlot. The EventSlot
* will be accessible by that unique name via
- * it's parent.
+ * it's tqparent.
* \param receiver The receiver of the event.
* \param slot The slot of the receiver which this
* EventSlot points to.
*/
- EventSlot(const QString& name, QObject* receiver, QCString slot);
+ EventSlot(const TQString& name, TQObject* receiver, TQCString slot);
/**
* Destructor.
@@ -60,21 +60,21 @@ namespace Kross { namespace Api {
virtual ~EventSlot();
/// \see Kross::Api::Object::getClassName()
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/// \see Kross::Api::Event::call()
- virtual Object::Ptr call(const QString& name, KSharedPtr<List> arguments);
+ virtual Object::Ptr call(const TQString& name, KSharedPtr<List> arguments);
/*
private:
EventManager* m_eventmanager;
- QGuardedPtr<QObject> m_sender;
- QCString m_signal;
- QCString m_slot;
- QString m_function;
- QValueList<EventSlot*> m_slots;
+ TQGuardedPtr<TQObject> m_sender;
+ TQCString m_signal;
+ TQCString m_slot;
+ TQString m_function;
+ TQValueList<EventSlot*> m_slots;
protected:
- void call(const QVariant&);
+ void call(const TQVariant&);
public slots:
// Stupid signals and slots. To get the passed
// arguments we need to have all cases of slots
@@ -89,32 +89,32 @@ namespace Kross { namespace Api {
void callback(int, int, int, int, bool);
void callback(int, bool);
void callback(int, int, bool);
- void callback(int, int, const QString&);
+ void callback(int, int, const TQString&);
void callback(uint);
void callback(long);
void callback(ulong);
void callback(double);
void callback(const char*);
void callback(bool);
- void callback(const QString&);
- void callback(const QString&, int);
- void callback(const QString&, int, int);
- void callback(const QString&, uint);
- void callback(const QString&, bool);
- void callback(const QString&, bool, bool);
- void callback(const QString&, bool, int);
- void callback(const QString&, const QString&);
- void callback(const QString&, const QString&, const QString&);
- void callback(const QStringList&);
- void callback(const QVariant&);
+ void callback(const TQString&);
+ void callback(const TQString&, int);
+ void callback(const TQString&, int, int);
+ void callback(const TQString&, uint);
+ void callback(const TQString&, bool);
+ void callback(const TQString&, bool, bool);
+ void callback(const TQString&, bool, int);
+ void callback(const TQString&, const TQString&);
+ void callback(const TQString&, const TQString&, const TQString&);
+ void callback(const TQStringList&);
+ void callback(const TQVariant&);
// The following both slots are more generic to
// handle Kross::Api::Object instances.
//void callback(Kross::Api::Object*);
//void callback(Kross::Api::List*);
*/
private:
- QObject* m_receiver;
- QCString m_slot;
+ TQObject* m_receiver;
+ TQCString m_slot;
};
}}
diff --git a/lib/kross/api/exception.cpp b/lib/kross/api/exception.cpp
index a54bae88..c6a0198f 100644
--- a/lib/kross/api/exception.cpp
+++ b/lib/kross/api/exception.cpp
@@ -20,46 +20,46 @@
#include "object.h"
#include "exception.h"
-//#include <qstring.h>
+//#include <tqstring.h>
//#include <ksharedptr.h>
using namespace Kross::Api;
-Exception::Exception(const QString& error, long lineno)
+Exception::Exception(const TQString& error, long lineno)
: Object()
, m_error(error)
, m_lineno(lineno)
{
- krosswarning( QString("Kross::Api::Exception error='%1' lineno='%3'").arg(m_error).arg(m_lineno) );
+ krosswarning( TQString("Kross::Api::Exception error='%1' lineno='%3'").tqarg(m_error).tqarg(m_lineno) );
}
Exception::~Exception()
{
}
-const QString Exception::getClassName() const
+const TQString Exception::getClassName() const
{
return "Kross::Api::Exception";
}
-const QString Exception::toString()
+const TQString Exception::toString()
{
return (m_lineno != -1)
- ? QString("Exception at line %1: %2").arg(m_lineno).arg(m_error)
- : QString("Exception: %1").arg(m_error);
+ ? TQString("Exception at line %1: %2").tqarg(m_lineno).tqarg(m_error)
+ : TQString("Exception: %1").tqarg(m_error);
}
-const QString Exception::getError() const
+const TQString Exception::getError() const
{
return m_error;
}
-const QString Exception::getTrace() const
+const TQString Exception::getTrace() const
{
return m_trace;
}
-void Exception::setTrace(const QString& tracemessage)
+void Exception::setTrace(const TQString& tracemessage)
{
m_trace = tracemessage;
}
diff --git a/lib/kross/api/exception.h b/lib/kross/api/exception.h
index 6ee9597b..b0699bfb 100644
--- a/lib/kross/api/exception.h
+++ b/lib/kross/api/exception.h
@@ -22,7 +22,7 @@
#include "object.h"
-#include <qstring.h>
+#include <tqstring.h>
#include <ksharedptr.h>
namespace Kross { namespace Api {
@@ -51,7 +51,7 @@ namespace Kross { namespace Api {
* \param lineno The liner number in the scripting
* code where this exception got thrown.
*/
- Exception(const QString& error, long lineno = -1);
+ Exception(const TQString& error, long lineno = -1);
/**
* Destructor.
@@ -59,26 +59,26 @@ namespace Kross { namespace Api {
virtual ~Exception();
/// \see Kross::Api::Object::getClassName()
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/// \see Kross::Api::Object::toString()
- virtual const QString toString();
+ virtual const TQString toString();
/**
* \return the error message.
*/
- const QString getError() const;
+ const TQString getError() const;
/**
- * \return a more detailed tracemessage or QString::null if
+ * \return a more detailed tracemessage or TQString() if
* there is no trace avaiable.
*/
- const QString getTrace() const;
+ const TQString getTrace() const;
/**
* Set a more detailed tracemessage.
*/
- void setTrace(const QString& tracemessage);
+ void setTrace(const TQString& tracemessage);
/**
* \return the line number in the scripting code
@@ -89,9 +89,9 @@ namespace Kross { namespace Api {
private:
/// The error message.
- QString m_error;
+ TQString m_error;
/// The trace message.
- QString m_trace;
+ TQString m_trace;
/// The line number where the exception got thrown
long m_lineno;
};
diff --git a/lib/kross/api/function.h b/lib/kross/api/function.h
index 6b75752a..edfab094 100644
--- a/lib/kross/api/function.h
+++ b/lib/kross/api/function.h
@@ -24,7 +24,7 @@
#include "object.h"
#include "list.h"
-#include <qstring.h>
+#include <tqstring.h>
namespace Kross { namespace Api {
diff --git a/lib/kross/api/interpreter.cpp b/lib/kross/api/interpreter.cpp
index 439063cd..c6796e1f 100644
--- a/lib/kross/api/interpreter.cpp
+++ b/lib/kross/api/interpreter.cpp
@@ -35,7 +35,7 @@ using namespace Kross::Api;
* InterpreterInfo
*/
-InterpreterInfo::InterpreterInfo(const QString& interpretername, const QString& library, const QString& wildcard, QStringList mimetypes, Option::Map options)
+InterpreterInfo::InterpreterInfo(const TQString& interpretername, const TQString& library, const TQString& wildcard, TQStringList mimetypes, Option::Map options)
: m_interpretername(interpretername)
, m_library(library)
, m_wildcard(wildcard)
@@ -54,32 +54,32 @@ InterpreterInfo::~InterpreterInfo()
m_interpreter = 0;
}
-const QString InterpreterInfo::getInterpretername()
+const TQString InterpreterInfo::getInterpretername()
{
return m_interpretername;
}
-const QString InterpreterInfo::getWildcard()
+const TQString InterpreterInfo::getWildcard()
{
return m_wildcard;
}
-const QStringList InterpreterInfo::getMimeTypes()
+const TQStringList InterpreterInfo::getMimeTypes()
{
return m_mimetypes;
}
-bool InterpreterInfo::hasOption(const QString& key)
+bool InterpreterInfo::hasOption(const TQString& key)
{
- return m_options.contains(key);
+ return m_options.tqcontains(key);
}
-InterpreterInfo::Option* InterpreterInfo::getOption(const QString name)
+InterpreterInfo::Option* InterpreterInfo::getOption(const TQString name)
{
return m_options[name];
}
-const QVariant InterpreterInfo::getOptionValue(const QString name, QVariant defaultvalue)
+const TQVariant InterpreterInfo::getOptionValue(const TQString name, TQVariant defaultvalue)
{
Option* o = m_options[name];
return o ? o->value : defaultvalue;
@@ -95,7 +95,7 @@ Interpreter* InterpreterInfo::getInterpreter()
if(m_interpreter) // buffered
return m_interpreter;
- krossdebug( QString("Loading the interpreter library for %1").arg(m_interpretername) );
+ krossdebug( TQString("Loading the interpreter library for %1").tqarg(m_interpretername) );
// Load the krosspython library.
KLibLoader *libloader = KLibLoader::self();
@@ -104,10 +104,10 @@ Interpreter* InterpreterInfo::getInterpreter()
if(! library) {
/*
setException(
- new Exception( QString("Could not load library \"%1\" for the \"%2\" interpreter.").arg(m_library).arg(m_interpretername) )
+ new Exception( TQString("Could not load library \"%1\" for the \"%2\" interpreter.").tqarg(m_library).tqarg(m_interpretername) )
);
*/
- krosswarning( QString("Could not load library \"%1\" for the \"%2\" interpreter.").arg(m_library).arg(m_interpretername) );
+ krosswarning( TQString("Could not load library \"%1\" for the \"%2\" interpreter.").tqarg(m_library).tqarg(m_interpretername) );
return 0;
}
diff --git a/lib/kross/api/interpreter.h b/lib/kross/api/interpreter.h
index 5c73c303..443585e3 100644
--- a/lib/kross/api/interpreter.h
+++ b/lib/kross/api/interpreter.h
@@ -20,8 +20,8 @@
#ifndef KROSS_API_INTERPRETER_H
#define KROSS_API_INTERPRETER_H
-#include <qstring.h>
-#include <qmap.h>
+#include <tqstring.h>
+#include <tqmap.h>
#include "object.h"
@@ -53,7 +53,7 @@ namespace Kross { namespace Api {
/**
* Map of options.
*/
- typedef QMap<QString, Option*> Map;
+ typedef TQMap<TQString, Option*> Map;
/**
* Constructor.
@@ -61,25 +61,25 @@ namespace Kross { namespace Api {
* \param name The name the option has. This is the
* displayed title and isn't used internaly.
* \param comment A comment that describes the option.
- * \param value The QVariant value this option has.
+ * \param value The TQVariant value this option has.
*/
- Option(const QString& name, const QString& comment, const QVariant& value)
+ Option(const TQString& name, const TQString& comment, const TQVariant& value)
: name(name), comment(comment), value(value) {}
/// The short name of the option.
- QString name;
+ TQString name;
/// A description of the option.
- QString comment;
+ TQString comment;
/// The value the option has.
- QVariant value;
+ TQVariant value;
};
/**
* Constructor.
*/
- InterpreterInfo(const QString& interpretername, const QString& library, const QString& wildcard, QStringList mimetypes, Option::Map options);
+ InterpreterInfo(const TQString& interpretername, const TQString& library, const TQString& wildcard, TQStringList mimetypes, Option::Map options);
/**
* Destructor.
@@ -89,40 +89,40 @@ namespace Kross { namespace Api {
/**
* \return the name of the interpreter. For example "python" or "kjs".
*/
- const QString getInterpretername();
+ const TQString getInterpretername();
/**
* \return the file-wildcard used to determinate by this interpreter
* used scriptingfiles. Those filter will be used e.g. with
- * KGlobal::dirs()->findAllResources() as filtermask. For example
+ * KGlobal::dirs()->findAllResources() as filtertqmask. For example
* python just defines it as "*py".
*/
- const QString getWildcard();
+ const TQString getWildcard();
/**
* List of mimetypes this interpreter supports.
*
- * \return QStringList with mimetypes like
+ * \return TQStringList with mimetypes like
* "application/x-javascript".
*/
- const QStringList getMimeTypes();
+ const TQStringList getMimeTypes();
/**
* \return true if an \a Option with that \p key exists else false.
*/
- bool hasOption(const QString& key);
+ bool hasOption(const TQString& key);
/**
* \return the option defined with \p name .
*/
- Option* getOption(const QString name);
+ Option* getOption(const TQString name);
/**
* \return the value of the option defined with \p name . If there
* doesn't exists an option with such a name, the \p defaultvalue
* is returned.
*/
- const QVariant getOptionValue(const QString name, QVariant defaultvalue = QVariant());
+ const TQVariant getOptionValue(const TQString name, TQVariant defaultvalue = TQVariant());
/**
* \return a map of options.
@@ -137,13 +137,13 @@ namespace Kross { namespace Api {
private:
/// The name the interpreter has. Could be something like "python" or "kjs".
- QString m_interpretername;
+ TQString m_interpretername;
/// The name of the library to load for the interpreter.
- QString m_library;
+ TQString m_library;
/// The file wildcard used to determinate extensions.
- QString m_wildcard;
+ TQString m_wildcard;
/// List of mimetypes this interpreter supports.
- QStringList m_mimetypes;
+ TQStringList m_mimetypes;
/// A \a Option::Map with options.
Option::Map m_options;
/// The \a Interpreter instance.
diff --git a/lib/kross/api/list.cpp b/lib/kross/api/list.cpp
index ad901e5e..3d894116 100644
--- a/lib/kross/api/list.cpp
+++ b/lib/kross/api/list.cpp
@@ -22,8 +22,8 @@
using namespace Kross::Api;
-List::List(QValueList<Object::Ptr> value)
- : Value< List, QValueList<Object::Ptr> >(value)
+List::List(TQValueList<Object::Ptr> value)
+ : Value< List, TQValueList<Object::Ptr> >(value)
{
}
@@ -31,28 +31,28 @@ List::~List()
{
}
-const QString List::getClassName() const
+const TQString List::getClassName() const
{
return "Kross::Api::List";
}
-const QString List::toString()
+const TQString List::toString()
{
- QString s = "[";
- QValueList<Object::Ptr> list = getValue();
- for(QValueList<Object::Ptr>::Iterator it = list.begin(); it != list.end(); ++it)
+ TQString s = "[";
+ TQValueList<Object::Ptr> list = getValue();
+ for(TQValueList<Object::Ptr>::Iterator it = list.begin(); it != list.end(); ++it)
s += "'" + (*it)->toString() + "', ";
return (s.endsWith(", ") ? s.left(s.length() - 2) : s) + "]";
}
Object::Ptr List::item(uint idx, Object* defaultobject)
{
- QValueList<Object::Ptr>& list = getValue();
+ TQValueList<Object::Ptr>& list = getValue();
if(idx >= list.count()) {
if(defaultobject)
return defaultobject;
- krossdebug( QString("List::item index=%1 is out of bounds. Raising TypeException.").arg(idx) );
- throw Exception::Ptr( new Exception(QString("List-index %1 out of bounds.").arg(idx)) );
+ krossdebug( TQString("List::item index=%1 is out of bounds. Raising TypeException.").tqarg(idx) );
+ throw Exception::Ptr( new Exception(TQString("List-index %1 out of bounds.").tqarg(idx)) );
}
return list[idx];
}
diff --git a/lib/kross/api/list.h b/lib/kross/api/list.h
index d74246a0..2620c688 100644
--- a/lib/kross/api/list.h
+++ b/lib/kross/api/list.h
@@ -20,9 +20,9 @@
#ifndef KROSS_API_LIST_H
#define KROSS_API_LIST_H
-#include <qstring.h>
-#include <qvaluelist.h>
-#include <qintdict.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
+#include <tqintdict.h>
#include "object.h"
#include "value.h"
@@ -33,9 +33,9 @@ namespace Kross { namespace Api {
* The List class implementates \a Value to handle
* lists and collections.
*/
- class List : public Value< List, QValueList<Object::Ptr> >
+ class List : public Value< List, TQValueList<Object::Ptr> >
{
- friend class Value< List, QValueList<Object::Ptr> >;
+ friend class Value< List, TQValueList<Object::Ptr> >;
public:
/**
@@ -44,10 +44,10 @@ namespace Kross { namespace Api {
typedef KSharedPtr<List> Ptr;
/*
- operator QStringList () {
- //QValueList<Object::Ptr> getValue()
+ operator TQStringList () {
+ //TQValueList<Object::Ptr> getValue()
krossdebug("999999999999 ...........................");
- return QStringList();
+ return TQStringList();
}
*/
@@ -57,7 +57,7 @@ namespace Kross { namespace Api {
* \param value The list of \a Object instances this
* list has initialy.
*/
- List(QValueList<Object::Ptr> value = QValueList<Object::Ptr>());
+ List(TQValueList<Object::Ptr> value = TQValueList<Object::Ptr>());
/**
* Destructor.
@@ -67,21 +67,21 @@ namespace Kross { namespace Api {
/**
* See \see Kross::Api::Object::getClassName()
*/
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/**
* \return a string representation of the whole list.
*
* \see Kross::Api::Object::toString()
*/
- virtual const QString toString();
+ virtual const TQString toString();
/**
* Return the \a Object with defined index from the
- * QValueList this list holds.
+ * TQValueList this list holds.
*
* \throw TypeException If index is out of bounds.
- * \param idx The QValueList-index.
+ * \param idx The TQValueList-index.
* \param defaultobject The default \a Object which should
* be used if there exists no item with such an
* index. This \a Object instance will be returned
@@ -92,7 +92,7 @@ namespace Kross { namespace Api {
Object::Ptr item(uint idx, Object* defaultobject = 0);
/**
- * Return the number of items in the QValueList this
+ * Return the number of items in the TQValueList this
* list holds.
*
* \return The number of items.
@@ -120,20 +120,20 @@ namespace Kross { namespace Api {
{
public:
ListT() : List() {}
- ListT(QValueList<OBJECT> values) : List(values) {}
+ ListT(TQValueList<OBJECT> values) : List(values) {}
template< typename TYPE >
- ListT(QValueList<TYPE> values) : List()
+ ListT(TQValueList<TYPE> values) : List()
{
- QValueListIterator<TYPE> it(values.begin()), end(values.end());
+ TQValueListIterator<TYPE> it(values.begin()), end(values.end());
for(; it != end; ++it)
this->append( new OBJECT(*it) );
}
template< typename TYPE >
- ListT(QIntDict<TYPE> values) : List()
+ ListT(TQIntDict<TYPE> values) : List()
{
- QIntDictIterator<TYPE> it( values );
+ TQIntDictIterator<TYPE> it( values );
TYPE *t;
while( (t = it.current()) != 0 ) {
this->append( new OBJECT(t) );
@@ -142,9 +142,9 @@ namespace Kross { namespace Api {
}
template< typename TYPE >
- ListT(const QPtrList<TYPE> values) : List()
+ ListT(const TQPtrList<TYPE> values) : List()
{
- QPtrListIterator<TYPE> it(values);
+ TQPtrListIterator<TYPE> it(values);
TYPE *t;
while( (t = it.current()) != 0 ) {
this->append( new OBJECT(t) );
diff --git a/lib/kross/api/module.h b/lib/kross/api/module.h
index 127609e0..3e58305a 100644
--- a/lib/kross/api/module.h
+++ b/lib/kross/api/module.h
@@ -20,7 +20,7 @@
#ifndef KROSS_API_MODULE_H
#define KROSS_API_MODULE_H
-#include <qstring.h>
+#include <tqstring.h>
#include "class.h"
@@ -48,10 +48,10 @@ namespace Kross { namespace Api {
* the application using Kross identifies
* modules with there names.
*/
- explicit Module(const QString& name)
+ explicit Module(const TQString& name)
: Class<Module>(name)
{
- krossdebug( QString("Kross::Api::Module %1 created").arg(name) );
+ krossdebug( TQString("Kross::Api::Module %1 created").tqarg(name) );
}
/**
@@ -59,14 +59,14 @@ namespace Kross { namespace Api {
*/
virtual ~Module()
{
- krossdebug( QString("Kross::Api::Module %1 destroyed").arg(getName()) );
+ krossdebug( TQString("Kross::Api::Module %1 destroyed").tqarg(getName()) );
}
/**
* Method to load from \a Kross::Api::Object inherited classes
* this module implements from within other modules.
*/
- virtual Kross::Api::Object::Ptr get(const QString& /*name*/, void* /*pointer*/ = 0)
+ virtual Kross::Api::Object::Ptr get(const TQString& /*name*/, void* /*pointer*/ = 0)
{
return 0;
}
diff --git a/lib/kross/api/object.cpp b/lib/kross/api/object.cpp
index ff2e2fbd..06ec55d5 100644
--- a/lib/kross/api/object.cpp
+++ b/lib/kross/api/object.cpp
@@ -30,34 +30,34 @@ Object::Object()
: KShared()
{
#ifdef KROSS_API_OBJECT_CTOR_DEBUG
- krossdebug( QString("Kross::Api::Object::Constructor() name='%1' refcount='%2'").arg(m_name).arg(_KShared_count()) );
+ krossdebug( TQString("Kross::Api::Object::Constructor() name='%1' refcount='%2'").tqarg(m_name).tqarg(_KShared_count()) );
#endif
}
Object::~Object()
{
#ifdef KROSS_API_OBJECT_DTOR_DEBUG
- krossdebug( QString("Kross::Api::Object::Destructor() name='%1' refcount='%2'").arg(m_name).arg(_KShared_count()) );
+ krossdebug( TQString("Kross::Api::Object::Destructor() name='%1' refcount='%2'").tqarg(m_name).tqarg(_KShared_count()) );
#endif
//removeAllChildren(); // not needed cause we use KShared to handle ref-couting and freeing.
}
-const QString Object::toString()
+const TQString Object::toString()
{
- return QString("%1").arg(getClassName());
+ return TQString("%1").tqarg(getClassName());
}
-Object::Ptr Object::call(const QString& name, List::Ptr arguments)
+Object::Ptr Object::call(const TQString& name, List::Ptr arguments)
{
Q_UNUSED(arguments);
#ifdef KROSS_API_OBJECT_CALL_DEBUG
- krossdebug( QString("Kross::Api::Object::call(%1) name=%2 class=%3").arg(name).arg(getName()).arg(getClassName()) );
+ krossdebug( TQString("Kross::Api::Object::call(%1) name=%2 class=%3").tqarg(name).tqarg(getName()).tqarg(getClassName()) );
#endif
if(name.isEmpty()) // return a self-reference if no functionname is defined.
return this;
- throw Exception::Ptr( new Exception(QString("No callable object named '%2'").arg(name)) );
+ throw Exception::Ptr( new Exception(TQString("No callable object named '%2'").tqarg(name)) );
}
diff --git a/lib/kross/api/object.h b/lib/kross/api/object.h
index 3c86ca4b..87bd2132 100644
--- a/lib/kross/api/object.h
+++ b/lib/kross/api/object.h
@@ -20,11 +20,11 @@
#ifndef KROSS_API_OBJECT_H
#define KROSS_API_OBJECT_H
-#include <qstring.h>
-#include <qvaluelist.h>
-#include <qmap.h>
-#include <qvariant.h>
-//#include <qobject.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
+#include <tqmap.h>
+#include <tqvariant.h>
+//#include <tqobject.h>
#include <ksharedptr.h>
#include "../main/krossconfig.h"
@@ -40,7 +40,7 @@ namespace Kross { namespace Api {
*
* The Object class is used as base class to provide
* common functionality. It's similar to what we know
- * in Python as PyObject or in Qt as QObject.
+ * in Python as PyObject or in TQt as TQObject.
*
* Inherited from e.g. \a Value, \a Module and \a Class .
*
@@ -73,14 +73,14 @@ namespace Kross { namespace Api {
*
* \return The name of this class.
*/
- virtual const QString getClassName() const = 0;
+ virtual const TQString getClassName() const = 0;
/**
* \return a string representation of the object or
* it's content. This method is mainly used for
* debugging and testing purposes.
*/
- virtual const QString toString();
+ virtual const TQString toString();
/**
* Pass a call to the object and evaluated it recursive
@@ -99,14 +99,14 @@ namespace Kross { namespace Api {
* \return The call-result as \a Object::Ptr instance or
* NULL if the call has no result.
*/
- virtual Object::Ptr call(const QString& name, KSharedPtr<List> arguments);
+ virtual Object::Ptr call(const TQString& name, KSharedPtr<List> arguments);
/**
* Return a list of supported callable objects.
*
* \return List of supported calls.
*/
- virtual QStringList getCalls() { return QStringList(); }
+ virtual TQStringList getCalls() { return TQStringList(); }
//FIXME replace function with getChildren() functionality ?
/**
@@ -142,7 +142,7 @@ template<class T> inline T* Object::fromObject(Object::Ptr object)
{
T* t = (T*) object.data();
if(! t)
- throw KSharedPtr<Exception>( new Exception(QString("Object \"%1\" invalid.").arg(object ? object->getClassName() : "")) );
+ throw KSharedPtr<Exception>( new Exception(TQString("Object \"%1\" invalid.").tqarg(object ? object->getClassName() : "")) );
return t;
}
diff --git a/lib/kross/api/proxy.h b/lib/kross/api/proxy.h
index f25a4845..a7d37380 100644
--- a/lib/kross/api/proxy.h
+++ b/lib/kross/api/proxy.h
@@ -25,7 +25,7 @@
#include "variant.h"
#include "list.h"
-#include <qstring.h>
+#include <tqstring.h>
namespace Kross { namespace Api {
@@ -71,21 +71,21 @@ namespace Kross { namespace Api {
* // The class which should be published.
* class MyClass : public Kross::Api::Class<MyClass> {
* public:
- * MyClass(const QString& name) : Kross::Api::Class<MyClass>(name) {
+ * MyClass(const TQString& name) : Kross::Api::Class<MyClass>(name) {
* // publish the function myfunc, so that scripting-code is able
* // to call that method.
* this->addProxyFunction <
* Kross::Api::Variant, // the uint returnvalue is handled with Variant.
- * Kross::Api::Variant, // the QString argument is handled with Variant too.
+ * Kross::Api::Variant, // the TQString argument is handled with Variant too.
* MyClass // the MyClass* is handled implicit by our class.
* > ( "myfuncname", // the name the function should be published as.
* this, // pointer to the class-instance which has the method.
* &TestPluginObject::myfunc ); // pointer to the method itself.
* }
* virtual ~MyClass() {}
- * virtual const QString getClassName() const { return "MyClass"; }
+ * virtual const TQString getClassName() const { return "MyClass"; }
* private:
- * uint myfunc(const QCString&, MyClass* myotherclass) {
+ * uint myfunc(const TQCString&, MyClass* myotherclass) {
* // This method will be published to the scripting backend. So, scripting
* // code is able to call this method.
* }
diff --git a/lib/kross/api/qtobject.cpp b/lib/kross/api/qtobject.cpp
index c6eb082a..2aa8f408 100644
--- a/lib/kross/api/qtobject.cpp
+++ b/lib/kross/api/qtobject.cpp
@@ -26,35 +26,35 @@
#include "eventslot.h"
#include "eventsignal.h"
-#include <qobject.h>
-#include <qsignal.h>
-//#include <qglobal.h>
-//#include <qobjectdefs.h>
-#include <qmetaobject.h>
-#include <private/qucom_p.h> // for the Qt QUObject API.
+#include <tqobject.h>
+#include <tqsignal.h>
+//#include <tqglobal.h>
+//#include <tqobjectdefs.h>
+#include <tqmetaobject.h>
+#include <tqucom_p.h> // for the TQt TQUObject API.
using namespace Kross::Api;
-QtObject::QtObject(QObject* object, const QString& name)
- : Kross::Api::Class<QtObject>(name.isEmpty() ? object->name() : name)
+QtObject::QtObject(TQObject* object, const TQString& name)
+ : Kross::Api::Class<QtObject>(name.isEmpty() ? TQString(object->name()) : name)
, m_object(object)
{
- // Walk through the signals and slots the QObject has
+ // Walk through the signals and slots the TQObject has
// and attach them as events to this QtObject.
- QStrList slotnames = m_object->metaObject()->slotNames(false);
+ TQStrList slotnames = m_object->tqmetaObject()->slotNames(false);
for(char* c = slotnames.first(); c; c = slotnames.next()) {
- QCString s = c;
+ TQCString s = c;
addChild(s, new EventSlot(s, object, s) );
}
- QStrList signalnames = m_object->metaObject()->signalNames(false);
+ TQStrList signalnames = m_object->tqmetaObject()->signalNames(false);
for(char* c = signalnames.first(); c; c = signalnames.next()) {
- QCString s = c;
+ TQCString s = c;
addChild(s, new EventSignal(s, object, s) );
}
- // Add functions to wrap QObject methods into callable
+ // Add functions to wrap TQObject methods into callable
// Kross objects.
addFunction("propertyNames", &QtObject::propertyNames);
@@ -78,48 +78,48 @@ QtObject::~QtObject()
{
}
-const QString QtObject::getClassName() const
+const TQString QtObject::getClassName() const
{
return "Kross::Api::QtObject";
}
-QObject* QtObject::getObject()
+TQObject* QtObject::getObject()
{
return m_object;
}
-QUObject* QtObject::toQUObject(const QString& signature, List::Ptr arguments)
+TQUObject* QtObject::toTQUObject(const TQString& signature, List::Ptr arguments)
{
- int startpos = signature.find("(");
- int endpos = signature.findRev(")");
+ int startpos = signature.tqfind("(");
+ int endpos = signature.tqfindRev(")");
if(startpos < 0 || startpos > endpos)
- throw Exception::Ptr( new Exception(QString("Invalid Qt signal or slot signature '%1'").arg(signature)) );
+ throw Exception::Ptr( new Exception(TQString("Invalid TQt signal or slot signature '%1'").tqarg(signature)) );
- //QString sig = signature.left(startpos);
- QString params = signature.mid(startpos + 1, endpos - startpos - 1);
- QStringList paramlist = QStringList::split(",", params); // this will fail on something like myslot(QMap<QString,QString> arg), but we don't care jet.
+ //TQString sig = signature.left(startpos);
+ TQString params = signature.mid(startpos + 1, endpos - startpos - 1);
+ TQStringList paramlist = TQStringList::split(",", params); // this will fail on something like myslot(TQMap<TQString,TQString> arg), but we don't care jet.
uint paramcount = paramlist.size();
- // The first item in the QUObject-array is for the returnvalue
+ // The first item in the TQUObject-array is for the returnvalue
// while everything >=1 are the passed parameters.
- QUObject* uo = new QUObject[ paramcount + 1 ];
- uo[0] = QUObject(); // empty placeholder for the returnvalue.
+ TQUObject* uo = new TQUObject[ paramcount + 1 ];
+ uo[0] = TQUObject(); // empty placeholder for the returnvalue.
-//QString t;
+//TQString t;
//for(int j=0; j<argcount; j++) t += "'" + Variant::toString(arguments->item(j)) + "' ";
-//krossdebug( QString("1 ---------------------: (%1) %2").arg(argcount).arg(t) );
+//krossdebug( TQString("1 ---------------------: (%1) %2").tqarg(argcount).tqarg(t) );
// Fill parameters.
uint argcount = arguments ? arguments->count() : 0;
for(uint i = 0; i < paramcount; i++) {
- if(paramlist[i].find("QString") >= 0) {
- const QString s = (argcount > i) ? Variant::toString(arguments->item(i)) : QString::null;
- //krossdebug(QString("EventSlot::toQUObject s=%1").arg(s));
- static_QUType_QString.set( &(uo[i + 1]), s );
+ if(paramlist[i].tqfind(TQSTRING_OBJECT_NAME_STRING) >= 0) {
+ const TQString s = (argcount > i) ? Variant::toString(arguments->item(i)) : TQString();
+ //krossdebug(TQString("EventSlot::toTQUObject s=%1").tqarg(s));
+ static_TQUType_TQString.set( &(uo[i + 1]), s );
}
- //TODO handle int, long, char*, QStringList, etc.
+ //TODO handle int, long, char*, TQStringList, etc.
else {
- throw Exception::Ptr( new Exception(QString("Unknown Qt signal or slot argument '%1' in signature '%2'.").arg(paramlist[i]).arg(signature)) );
+ throw Exception::Ptr( new Exception(TQString("Unknown TQt signal or slot argument '%1' in signature '%2'.").tqarg(paramlist[i]).tqarg(signature)) );
}
}
@@ -129,19 +129,19 @@ QUObject* QtObject::toQUObject(const QString& signature, List::Ptr arguments)
Kross::Api::Object::Ptr QtObject::propertyNames(Kross::Api::List::Ptr)
{
return new Kross::Api::Variant(
- QStringList::fromStrList(m_object->metaObject()->propertyNames(false)));
+ TQStringList::fromStrList(m_object->tqmetaObject()->propertyNames(false)));
}
Kross::Api::Object::Ptr QtObject::hasProperty(Kross::Api::List::Ptr args)
{
return new Kross::Api::Variant(
- m_object->metaObject()->findProperty(Kross::Api::Variant::toString(args->item(0)).latin1(), false));
+ m_object->tqmetaObject()->tqfindProperty(Kross::Api::Variant::toString(args->item(0)).latin1(), false));
}
Kross::Api::Object::Ptr QtObject::getProperty(Kross::Api::List::Ptr args)
{
- QVariant variant = m_object->property(Kross::Api::Variant::toString(args->item(0)).latin1());
- if(variant.type() == QVariant::Invalid)
+ TQVariant variant = m_object->property(Kross::Api::Variant::toString(args->item(0)).latin1());
+ if(variant.type() == TQVariant::Invalid)
return 0;
return new Kross::Api::Variant(variant);
}
@@ -158,13 +158,13 @@ Kross::Api::Object::Ptr QtObject::setProperty(Kross::Api::List::Ptr args)
Kross::Api::Object::Ptr QtObject::slotNames(Kross::Api::List::Ptr)
{
return new Kross::Api::Variant(
- QStringList::fromStrList(m_object->metaObject()->slotNames(false)));
+ TQStringList::fromStrList(m_object->tqmetaObject()->slotNames(false)));
}
Kross::Api::Object::Ptr QtObject::hasSlot(Kross::Api::List::Ptr args)
{
return new Kross::Api::Variant(
- bool(m_object->metaObject()->slotNames(false).find(
+ bool(m_object->tqmetaObject()->slotNames(false).tqfind(
Kross::Api::Variant::toString(args->item(0)).latin1()
) != -1));
}
@@ -172,59 +172,59 @@ Kross::Api::Object::Ptr QtObject::hasSlot(Kross::Api::List::Ptr args)
Kross::Api::Object::Ptr QtObject::callSlot(Kross::Api::List::Ptr args)
{
//TODO just call the child event ?!
- QString name = Kross::Api::Variant::toString(args->item(0));
- int slotid = m_object->metaObject()->findSlot(name.latin1(), false);
+ TQString name = Kross::Api::Variant::toString(args->item(0));
+ int slotid = m_object->tqmetaObject()->tqfindSlot(name.latin1(), false);
if(slotid < 0)
- throw Exception::Ptr( new Exception(QString("No such slot '%1'.").arg(name)) );
+ throw Exception::Ptr( new Exception(TQString("No such slot '%1'.").tqarg(name)) );
- QUObject* uo = QtObject::toQUObject(name, args);
+ TQUObject* uo = QtObject::toTQUObject(name, args);
m_object->qt_invoke(slotid, uo);
delete [] uo;
- return new Variant( QVariant(true,0) );
+ return new Variant( TQVariant(true,0) );
}
Kross::Api::Object::Ptr QtObject::signalNames(Kross::Api::List::Ptr)
{
return new Kross::Api::Variant(
- QStringList::fromStrList(m_object->metaObject()->signalNames(false)));
+ TQStringList::fromStrList(m_object->tqmetaObject()->signalNames(false)));
}
Kross::Api::Object::Ptr QtObject::hasSignal(Kross::Api::List::Ptr args)
{
return new Kross::Api::Variant(
- bool(m_object->metaObject()->signalNames(false).find(
+ bool(m_object->tqmetaObject()->signalNames(false).tqfind(
Kross::Api::Variant::toString(args->item(0)).latin1()
) != -1));
}
Kross::Api::Object::Ptr QtObject::emitSignal(Kross::Api::List::Ptr args)
{
- QString name = Kross::Api::Variant::toString(args->item(0));
- int signalid = m_object->metaObject()->findSignal(name.latin1(), false);
+ TQString name = Kross::Api::Variant::toString(args->item(0));
+ int signalid = m_object->tqmetaObject()->tqfindSignal(name.latin1(), false);
if(signalid < 0)
- throw Exception::Ptr( new Exception(QString("No such signal '%1'.").arg(name)) );
- m_object->qt_invoke(signalid, 0); //TODO convert Kross::Api::List::Ptr => QUObject*
+ throw Exception::Ptr( new Exception(TQString("No such signal '%1'.").tqarg(name)) );
+ m_object->qt_invoke(signalid, 0); //TODO convert Kross::Api::List::Ptr => TQUObject*
return 0;
}
Kross::Api::Object::Ptr QtObject::connectSignal(Kross::Api::List::Ptr args)
{
- QString signalname = Kross::Api::Variant::toString(args->item(0));
- QString signalsignatur = QString("2%1").arg(signalname);
+ TQString signalname = Kross::Api::Variant::toString(args->item(0));
+ TQString signalsignatur = TQString("2%1").tqarg(signalname);
const char* signalsig = signalsignatur.latin1();
QtObject* obj = Kross::Api::Object::fromObject<Kross::Api::QtObject>(args->item(1));
- QObject* o = obj->getObject();
+ TQObject* o = obj->getObject();
if(! o)
- throw Exception::Ptr( new Exception(QString("No such QObject receiver in '%1'.").arg(obj->getName())) );
+ throw Exception::Ptr( new Exception(TQString("No such TQObject receiver in '%1'.").tqarg(obj->getName())) );
- QString slotname = Kross::Api::Variant::toString(args->item(2));
- QString slotsignatur = QString("1%1").arg(slotname);
+ TQString slotname = Kross::Api::Variant::toString(args->item(2));
+ TQString slotsignatur = TQString("1%1").tqarg(slotname);
const char* slotsig = slotsignatur.latin1();
return new Kross::Api::Variant(
- QObject::connect(m_object, signalsig, o, slotsig));
+ TQObject::connect(m_object, signalsig, o, slotsig));
}
Kross::Api::Object::Ptr QtObject::disconnectSignal(Kross::Api::List::Ptr)
diff --git a/lib/kross/api/qtobject.h b/lib/kross/api/qtobject.h
index 29f493a4..119a579e 100644
--- a/lib/kross/api/qtobject.h
+++ b/lib/kross/api/qtobject.h
@@ -17,16 +17,16 @@
* Boston, MA 02110-1301, USA.
***************************************************************************/
-#ifndef KROSS_API_QTOBJECT_H
-#define KROSS_API_QTOBJECT_H
+#ifndef KROSS_API_TQTOBJECT_H
+#define KROSS_API_TQTOBJECT_H
#include "class.h"
-#include <qstring.h>
-#include <qobject.h>
+#include <tqstring.h>
+#include <tqobject.h>
-// Forward-declaration of the builtin Qt QUObject struct.
-struct QUObject;
+// Forward-declaration of the builtin TQt TQUObject struct.
+struct TQUObject;
namespace Kross { namespace Api {
@@ -37,10 +37,10 @@ namespace Kross { namespace Api {
class ScriptContrainer;
/**
- * Class to wrap \a QObject or inherited instances.
+ * Class to wrap \a TQObject or inherited instances.
*
- * This class publishs all SIGNAL's, SLOT's and Q_PROPERTY's
- * the QObject has.
+ * This class publishs all SIGNAL's, SLOT's and TQ_PROPERTY's
+ * the TQObject has.
*/
class QtObject : public Kross::Api::Class<QtObject>
{
@@ -54,13 +54,13 @@ namespace Kross { namespace Api {
/**
* Constructor.
*
- * \param object The \a QObject instance this
+ * \param object The \a TQObject instance this
* class wraps.
* \param name The unique name this \a QtObject
* instance has. If not defined then the
- * \a QObject::name() will be used.
+ * \a TQObject::name() will be used.
*/
- QtObject(QObject* object, const QString& name = QString::null);
+ QtObject(TQObject* object, const TQString& name = TQString());
/**
* Destructor.
@@ -68,32 +68,32 @@ namespace Kross { namespace Api {
virtual ~QtObject();
/// \see Kross::Api::Object::getClassName()
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/**
- * Return the \a QObject instance this class wraps.
+ * Return the \a TQObject instance this class wraps.
*
- * \return The wrapped QObject.
+ * \return The wrapped TQObject.
*/
- QObject* getObject();
+ TQObject* getObject();
/**
- * Build a Qt QUObject struct out of the Qt signal or
+ * Build a TQt TQUObject struct out of the TQt signal or
* slot signature and the passed \a List arguments.
*
* \throw RuntimeException If the try to translate \p arguments
* failed.
- * \param signature The Qt signal or slot signature.
+ * \param signature The TQt signal or slot signature.
* \param arguments The optional \a List of arguments.
- * \return A QUObject array.
+ * \return A TQUObject array.
*/
- static QUObject* toQUObject(const QString& signature, List::Ptr arguments);
+ static TQUObject* toTQUObject(const TQString& signature, List::Ptr arguments);
private:
- /// The wrapped QObject.
- QObject* m_object;
+ /// The wrapped TQObject.
+ TQObject* m_object;
- // QProperty's
+ // TQProperty's
/// Return a list of property names.
Kross::Api::Object::Ptr propertyNames(Kross::Api::List::Ptr);
@@ -122,9 +122,9 @@ namespace Kross { namespace Api {
/// Emit a signal.
Kross::Api::Object::Ptr emitSignal(Kross::Api::List::Ptr);
- /// Connect signal with a QObject slot.
+ /// Connect signal with a TQObject slot.
Kross::Api::Object::Ptr connectSignal(Kross::Api::List::Ptr);
- /// Disconnect signal from QObject slot.
+ /// Disconnect signal from TQObject slot.
Kross::Api::Object::Ptr disconnectSignal(Kross::Api::List::Ptr);
};
diff --git a/lib/kross/api/script.h b/lib/kross/api/script.h
index 4f7d0c04..708e9058 100644
--- a/lib/kross/api/script.h
+++ b/lib/kross/api/script.h
@@ -20,8 +20,8 @@
#ifndef KROSS_API_SCRIPT_H
#define KROSS_API_SCRIPT_H
-#include <qstring.h>
-#include <qstringlist.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
#include "class.h"
@@ -97,7 +97,7 @@ namespace Kross { namespace Api {
* \return a list of callable functionnames this
* script spends.
*/
- virtual const QStringList& getFunctionNames() = 0;
+ virtual const TQStringList& getFunctionNames() = 0;
/**
* Call a function.
@@ -107,12 +107,12 @@ namespace Kross { namespace Api {
* \param args Optional arguments passed to the function.
* \return The result of the called function. Could be NULL.
*/
- virtual Kross::Api::Object::Ptr callFunction(const QString& name, Kross::Api::List::Ptr args) = 0;
+ virtual Kross::Api::Object::Ptr callFunction(const TQString& name, Kross::Api::List::Ptr args) = 0;
/**
* \return a list of classnames.
*/
- virtual const QStringList& getClassNames() = 0;
+ virtual const TQStringList& getClassNames() = 0;
/**
* Create and return a new class instance.
@@ -121,7 +121,7 @@ namespace Kross { namespace Api {
* \param name The name of the class to create a instance of.
* \return The new classinstance.
*/
- virtual Kross::Api::Object::Ptr classInstance(const QString& name) = 0;
+ virtual Kross::Api::Object::Ptr classInstance(const TQString& name) = 0;
protected:
/// The \a Interpreter used to create this Script instance.
diff --git a/lib/kross/api/value.h b/lib/kross/api/value.h
index 544d4a36..db3854be 100644
--- a/lib/kross/api/value.h
+++ b/lib/kross/api/value.h
@@ -20,8 +20,8 @@
#ifndef KROSS_API_VALUE_H
#define KROSS_API_VALUE_H
-#include <qstring.h>
-#include <qvariant.h>
+#include <tqstring.h>
+#include <tqvariant.h>
#include "object.h"
diff --git a/lib/kross/api/variant.cpp b/lib/kross/api/variant.cpp
index 92c0e3cb..e8d8bc1b 100644
--- a/lib/kross/api/variant.cpp
+++ b/lib/kross/api/variant.cpp
@@ -24,8 +24,8 @@
using namespace Kross::Api;
-Variant::Variant(const QVariant& value)
- : Value<Variant, QVariant>(value)
+Variant::Variant(const TQVariant& value)
+ : Value<Variant, TQVariant>(value)
{
}
@@ -33,38 +33,38 @@ Variant::~Variant()
{
}
-const QString Variant::getClassName() const
+const TQString Variant::getClassName() const
{
return "Kross::Api::Variant";
}
-const QString Variant::toString()
+const TQString Variant::toString()
{
return getValue().toString();
}
/*
-const QString Variant::getVariantType(Object::Ptr object)
+const TQString Variant::getVariantType(Object::Ptr object)
{
switch( toVariant(object).type() ) {
- case QVariant::CString:
- case QVariant::String:
+ case TQVariant::CString:
+ case TQVariant::String:
return "Kross::Api::Variant::String";
- case QVariant::Map:
+ case TQVariant::Map:
return "Kross::Api::Variant::Dict";
- case QVariant::StringList:
- case QVariant::List:
+ case TQVariant::StringList:
+ case TQVariant::List:
return "Kross::Api::Variant::List";
- case QVariant::Double:
+ case TQVariant::Double:
//return "Kross::Api::Variant::Double";
- case QVariant::UInt:
+ case TQVariant::UInt:
//return "Kross::Api::Variant::UInt"; // python isn't able to differ between int and uint :-(
- case QVariant::LongLong:
- case QVariant::ULongLong:
- case QVariant::Int:
+ case TQVariant::LongLong:
+ case TQVariant::ULongLong:
+ case TQVariant::Int:
return "Kross::Api::Variant::Integer";
- case QVariant::Bool:
+ case TQVariant::Bool:
return "Kross::Api::Variant::Bool";
default: //Date, Time, DateTime, ByteArray, BitArray, Rect, Size, Color, Invalid, etc.
return "Kross::Api::Variant";
@@ -72,97 +72,97 @@ const QString Variant::getVariantType(Object::Ptr object)
}
*/
-const QVariant& Variant::toVariant(Object::Ptr object)
+const TQVariant& Variant::toVariant(Object::Ptr object)
{
return Object::fromObject<Variant>( object.data() )->getValue();
}
-const QString Variant::toString(Object::Ptr object)
+const TQString Variant::toString(Object::Ptr object)
{
- const QVariant& variant = toVariant(object);
- if(! variant.canCast(QVariant::String))
- throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::String expected, but got %1.").arg(variant.typeName()).latin1()) );
+ const TQVariant& variant = toVariant(object);
+ if(! variant.canCast(TQVariant::String))
+ throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::String expected, but got %1.").tqarg(variant.typeName()).latin1()) );
return variant.toString();
}
int Variant::toInt(Object::Ptr object)
{
- const QVariant& variant = toVariant(object);
- if(! variant.canCast(QVariant::Int))
- throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::Int expected, but got %1.").arg(variant.typeName()).latin1()) );
+ const TQVariant& variant = toVariant(object);
+ if(! variant.canCast(TQVariant::Int))
+ throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::Int expected, but got %1.").tqarg(variant.typeName()).latin1()) );
return variant.toInt();
}
uint Variant::toUInt(Object::Ptr object)
{
- const QVariant& variant = toVariant(object);
- if(! variant.canCast(QVariant::UInt))
- throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::UInt expected, but got %1.").arg(variant.typeName()).latin1()) );
+ const TQVariant& variant = toVariant(object);
+ if(! variant.canCast(TQVariant::UInt))
+ throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::UInt expected, but got %1.").tqarg(variant.typeName()).latin1()) );
return variant.toUInt();
}
double Variant::toDouble(Object::Ptr object)
{
- const QVariant& variant = toVariant(object);
- if(! variant.canCast(QVariant::Double))
- throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::Double expected, but got %1.").arg(variant.typeName()).latin1()) );
+ const TQVariant& variant = toVariant(object);
+ if(! variant.canCast(TQVariant::Double))
+ throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::Double expected, but got %1.").tqarg(variant.typeName()).latin1()) );
return variant.toDouble();
}
-Q_LLONG Variant::toLLONG(Object::Ptr object)
+TQ_LLONG Variant::toLLONG(Object::Ptr object)
{
- const QVariant& variant = toVariant(object);
- if(! variant.canCast(QVariant::LongLong))
- throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::LLONG expected, but got %1.").arg(variant.typeName()).latin1()) );
+ const TQVariant& variant = toVariant(object);
+ if(! variant.canCast(TQVariant::LongLong))
+ throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::LLONG expected, but got %1.").tqarg(variant.typeName()).latin1()) );
return variant.toLongLong();
}
-Q_ULLONG Variant::toULLONG(Object::Ptr object)
+TQ_ULLONG Variant::toULLONG(Object::Ptr object)
{
- const QVariant& variant = toVariant(object);
- if(! variant.canCast(QVariant::ULongLong))
- throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::ULLONG expected, but got %1.").arg(variant.typeName()).latin1()) );
+ const TQVariant& variant = toVariant(object);
+ if(! variant.canCast(TQVariant::ULongLong))
+ throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::ULLONG expected, but got %1.").tqarg(variant.typeName()).latin1()) );
return variant.toULongLong();
}
bool Variant::toBool(Object::Ptr object)
{
- const QVariant& variant = toVariant(object);
- if(! variant.canCast(QVariant::Bool))
- throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::Bool expected, but got %1.").arg(variant.typeName()).latin1()) );
+ const TQVariant& variant = toVariant(object);
+ if(! variant.canCast(TQVariant::Bool))
+ throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::Bool expected, but got %1.").tqarg(variant.typeName()).latin1()) );
return variant.toBool();
}
-QStringList Variant::toStringList(Object::Ptr object)
+TQStringList Variant::toStringList(Object::Ptr object)
{
List* list = dynamic_cast< List* >( object.data() );
if(list) {
- QStringList l;
- QValueList<Object::Ptr> valuelist = list->getValue();
- QValueList<Object::Ptr>::Iterator it(valuelist.begin()), end(valuelist.end());
+ TQStringList l;
+ TQValueList<Object::Ptr> valuelist = list->getValue();
+ TQValueList<Object::Ptr>::Iterator it(valuelist.begin()), end(valuelist.end());
for(; it != end; ++it)
l.append( toString(*it) );
return l;
}
- const QVariant& variant = toVariant(object);
- if(! variant.canCast(QVariant::StringList))
- throw Exception::Ptr( new Exception(QString("Kross::Api::Variant::StringList expected, but got '%1'.").arg(variant.typeName()).latin1()) );
+ const TQVariant& variant = toVariant(object);
+ if(! variant.canCast(TQVariant::StringList))
+ throw Exception::Ptr( new Exception(TQString("Kross::Api::Variant::StringList expected, but got '%1'.").tqarg(variant.typeName()).latin1()) );
return variant.toStringList();
}
-QValueList<QVariant> Variant::toList(Object::Ptr object)
+TQValueList<TQVariant> Variant::toList(Object::Ptr object)
{
List* list = dynamic_cast< List* >( object.data() );
if(list) {
- QValueList<QVariant> l;
- QValueList<Object::Ptr> valuelist = list->getValue();
- QValueList<Object::Ptr>::Iterator it(valuelist.begin()), end(valuelist.end());
+ TQValueList<TQVariant> l;
+ TQValueList<Object::Ptr> valuelist = list->getValue();
+ TQValueList<Object::Ptr>::Iterator it(valuelist.begin()), end(valuelist.end());
for(; it != end; ++it)
l.append( toVariant(*it) );
return l;
}
- const QVariant& variant = toVariant(object);
- if(! variant.canCast(QVariant::List))
- throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::List expected, but got '%1'.").arg(variant.typeName()).latin1()) );
+ const TQVariant& variant = toVariant(object);
+ if(! variant.canCast(TQVariant::List))
+ throw Exception::Ptr( new Exception(i18n("Kross::Api::Variant::List expected, but got '%1'.").tqarg(variant.typeName()).latin1()) );
return variant.toList();
}
diff --git a/lib/kross/api/variant.h b/lib/kross/api/variant.h
index 020e6e51..65b4c4e8 100644
--- a/lib/kross/api/variant.h
+++ b/lib/kross/api/variant.h
@@ -20,8 +20,8 @@
#ifndef KROSS_API_VARIANT_H
#define KROSS_API_VARIANT_H
-#include <qstring.h>
-#include <qvariant.h>
+#include <tqstring.h>
+#include <tqvariant.h>
#include "object.h"
#include "value.h"
@@ -32,22 +32,22 @@ namespace Kross { namespace Api {
class List;
/**
- * Variant value to wrap a QVariant into a \a Kross::Api::Value
+ * Variant value to wrap a TQVariant into a \a Kross::Api::Value
* to enable primitive types like strings or numerics.
*/
- class Variant : public Value<Variant, QVariant>
+ class Variant : public Value<Variant, TQVariant>
{
- friend class Value<Variant, QVariant>;
+ friend class Value<Variant, TQVariant>;
public:
/**
* Constructor.
*
- * \param value The initial QVariant-value
+ * \param value The initial TQVariant-value
* this Variant-Object has.
* \param name The name this Value has.
*/
- Variant(const QVariant& value);
+ Variant(const TQVariant& value);
inline operator bool () { return getValue().toBool(); }
inline operator int () { return getValue().toInt(); }
@@ -55,32 +55,32 @@ namespace Kross { namespace Api {
inline operator double () { return getValue().toDouble(); }
inline operator const char* () { return getValue().toString().latin1(); }
- inline operator QString () { return getValue().toString(); }
- inline operator const QString () { return getValue().toString(); }
- inline operator const QString& () { return getValue().asString(); }
+ inline operator TQString () { return getValue().toString(); }
+ inline operator const TQString () { return getValue().toString(); }
+ inline operator const TQString& () { return getValue().asString(); }
- inline operator QCString () { return getValue().toCString(); }
- inline operator const QCString () { return getValue().toCString(); }
- inline operator const QCString& () { return getValue().asCString(); }
+ inline operator TQCString () { return getValue().toCString(); }
+ inline operator const TQCString () { return getValue().toCString(); }
+ inline operator const TQCString& () { return getValue().asCString(); }
- inline operator QVariant () { return getValue(); }
- inline operator const QVariant () { return getValue(); }
- inline operator const QVariant& () { return getValue(); }
+ inline operator TQVariant () { return getValue(); }
+ inline operator const TQVariant () { return getValue(); }
+ inline operator const TQVariant& () { return getValue(); }
/**
- * Operator to return a QStringList.
+ * Operator to return a TQStringList.
*
* We can not just use getValue().toStringList() here cause maybe
* this Kross::Api::Variant is a Kross::Api::List which could be
* internaly used for list of strings as well. So, we use the
* toStringList() function which will take care of translating a
- * Kross::Api::List to a QStringList if possible or to throw an
- * exception if the Kross::Api::List isn't a QStringList.
+ * Kross::Api::List to a TQStringList if possible or to throw an
+ * exception if the Kross::Api::List isn't a TQStringList.
*/
- inline operator QStringList () {
+ inline operator TQStringList () {
return toStringList(this);
}
- inline operator QValueList<QVariant> () {
+ inline operator TQValueList<TQVariant> () {
return toList(this);
}
@@ -90,34 +90,34 @@ namespace Kross { namespace Api {
virtual ~Variant();
/// \see Kross::Api::Object::getClassName()
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/**
* \return a string representation of the variant.
*
* \see Kross::Api::Object::toString()
*/
- virtual const QString toString();
+ virtual const TQString toString();
/**
* Try to convert the given \a Object into
- * a QVariant.
+ * a TQVariant.
*
* \throw TypeException If the convert failed.
* \param object The object to convert.
- * \return The to a QVariant converted object.
+ * \return The to a TQVariant converted object.
*/
- static const QVariant& toVariant(Object::Ptr object);
+ static const TQVariant& toVariant(Object::Ptr object);
/**
* Try to convert the given \a Object into
- * a QString.
+ * a TQString.
*
* \throw TypeException If the convert failed.
* \param object The object to convert.
- * \return The to a QString converted object.
+ * \return The to a TQString converted object.
*/
- static const QString toString(Object::Ptr object);
+ static const TQString toString(Object::Ptr object);
/**
* Try to convert the given \a Object into
@@ -151,23 +151,23 @@ namespace Kross { namespace Api {
/**
* Try to convert the given \a Object into
- * a Q_LLONG.
+ * a TQ_LLONG.
*
* \throw TypeException If the convert failed.
* \param object The object to convert.
- * \return The to a Q_LLONG converted object.
+ * \return The to a TQ_LLONG converted object.
*/
- static Q_LLONG toLLONG(Object::Ptr object);
+ static TQ_LLONG toLLONG(Object::Ptr object);
/**
* Try to convert the given \a Object into
- * a Q_ULLONG.
+ * a TQ_ULLONG.
*
* \throw TypeException If the convert failed.
* \param object The object to convert.
- * \return The to a Q_ULLONG converted object.
+ * \return The to a TQ_ULLONG converted object.
*/
- static Q_ULLONG toULLONG(Object::Ptr object);
+ static TQ_ULLONG toULLONG(Object::Ptr object);
/**
* Try to convert the given \a Object into
@@ -181,23 +181,23 @@ namespace Kross { namespace Api {
/**
* Try to convert the given \a Object into
- * a QStringList.
+ * a TQStringList.
*
* \throw TypeException If the convert failed.
* \param object The object to convert.
- * \return The to a QValueList converted object.
+ * \return The to a TQValueList converted object.
*/
- static QStringList toStringList(Object::Ptr object);
+ static TQStringList toStringList(Object::Ptr object);
/**
* Try to convert the given \a Object into
- * a QValueList of QVariant's.
+ * a TQValueList of TQVariant's.
*
* \throw TypeException If the convert failed.
* \param object The object to convert.
- * \return The to a QValueList converted object.
+ * \return The to a TQValueList converted object.
*/
- static QValueList<QVariant> toList(Object::Ptr object);
+ static TQValueList<TQVariant> toList(Object::Ptr object);
};