diff options
Diffstat (limited to 'kommander/plugin')
-rw-r--r-- | kommander/plugin/kommanderplugin.h | 23 | ||||
-rw-r--r-- | kommander/plugin/specialinformation.cpp | 58 | ||||
-rw-r--r-- | kommander/plugin/specialinformation.h | 10 | ||||
-rw-r--r-- | kommander/plugin/specials.h | 10 |
4 files changed, 51 insertions, 50 deletions
diff --git a/kommander/plugin/kommanderplugin.h b/kommander/plugin/kommanderplugin.h index d74abaa4..ae06fdc0 100644 --- a/kommander/plugin/kommanderplugin.h +++ b/kommander/plugin/kommanderplugin.h @@ -1,29 +1,29 @@ /**************************************************************************** - ** kommanderplugin.h - KommanderPlugin class definition created from QWidgetPlugin + ** kommanderplugin.h - KommanderPlugin class definition created from TQWidgetPlugin ** Copyright (C) 2001 Trolltech AS. All rights reserved. ** Copyright (C) 2003 Marc Britton ** - ** This file is part of the widgets module of the Qt GUI Toolkit. + ** This file is part of the widgets module of the TQt GUI Toolkit. ** ** This file may be distributed under the terms of the Q Public License ** as defined by Trolltech AS of Norway and appearing in the file - ** LICENSE.QPL included in the packaging of this file. + ** LICENSE.TQPL included in the packaging of this file. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** - ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition - ** licenses may use this file in accordance with the Qt Commercial License + ** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition + ** licenses may use this file in accordance with the TQt Commercial License ** Agreement provided with the Software. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for - ** information about Qt Commercial License Agreements. - ** See http://www.trolltech.com/qpl/ for QPL licensing information. + ** information about TQt Commercial License Agreements. + ** See http://www.trolltech.com/qpl/ for TQPL licensing information. ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are @@ -45,15 +45,16 @@ class TQIconSet; class KOMMANDER_EXPORT KommanderPlugin : public TQObject { Q_OBJECT + TQ_OBJECT public: KommanderPlugin(); ~KommanderPlugin(); - virtual void addWidget( const TQString &name, const TQString &group, const TQString &toolTip, TQIconSet *iconSet, const TQString &whatsThis = TQString::null, bool isContainer = false); + virtual void addWidget( const TQString &name, const TQString &group, const TQString &toolTip, TQIconSet *iconSet, const TQString &whatsThis = TQString(), bool isContainer = false); virtual void removeWidget( const TQString &name ); virtual TQStringList widgets() const; - virtual TQWidget *create( const TQString &key, TQWidget *parent = 0, const char *name = 0 ) = 0; + virtual TQWidget *create( const TQString &key, TQWidget *tqparent = 0, const char *name = 0 ) = 0; virtual TQString group( const TQString &key ) const; virtual TQString toolTip( const TQString &key ) const; virtual TQString whatsThis( const TQString &key ) const; @@ -75,7 +76,7 @@ class KOMMANDER_EXPORT KommanderPlugin : public TQObject * @param maxArgs maximum number of accepted arguments * @return true if registration was successful */ - static bool registerFunction(int id, const TQString& function, const TQString description = TQString::null, + static bool registerFunction(int id, const TQString& function, const TQString description = TQString(), int minArgs = -1, int maxArgs = -1); @@ -84,7 +85,7 @@ private: struct WidgetInfo { WidgetInfo() { } - WidgetInfo( const TQString &g, const TQString &t, TQIconSet *i, const TQString &w = TQString::null, bool c = false) + WidgetInfo( const TQString &g, const TQString &t, TQIconSet *i, const TQString &w = TQString(), bool c = false) : group( g ), toolTip( t ), iconSet(i), whatsThis( w ), isContainer( c ) {} diff --git a/kommander/plugin/specialinformation.cpp b/kommander/plugin/specialinformation.cpp index d6ed318b..bbfe308e 100644 --- a/kommander/plugin/specialinformation.cpp +++ b/kommander/plugin/specialinformation.cpp @@ -22,8 +22,8 @@ SpecialFunction::SpecialFunction(const TQString& name, const TQString& descripti int minArgs, int maxArgs) { m_parserTypes = AllParsers; - int lbracket = name.find('('); - int rbracket = name.find(')'); + int lbracket = name.tqfind('('); + int rbracket = name.tqfind(')'); m_function = (lbracket != -1) ? name.left(lbracket) : name; m_description = description; if (lbracket != -1 && rbracket != -1) @@ -44,8 +44,8 @@ SpecialFunction::SpecialFunction(ParserType p, const TQString& name, const TQStr int minArgs, int maxArgs) { m_parserTypes = p; - int lbracket = name.find('('); - int rbracket = name.find(')'); + int lbracket = name.tqfind('('); + int rbracket = name.tqfind(')'); m_function = (lbracket != -1) ? name.left(lbracket) : name; m_description = description; if (lbracket != -1 && rbracket != -1) @@ -71,15 +71,15 @@ TQString SpecialFunction::prototype(uint prototypeFlags) const TQStringList params; for (uint i=start; i<m_types.count(); i++) if (prototypeFlags & ShowArgumentNames) - params.append(TQString("%1 %2").arg(m_types[i]).arg(m_args[i])); + params.append(TQString("%1 %2").tqarg(m_types[i]).tqarg(m_args[i])); else params.append(m_types[i]); if (!params.count()) return m_function; else if (prototypeFlags & NoSpaces) - return TQString("%1(%2)").arg(m_function).arg(params.join(",")); + return TQString("%1(%2)").tqarg(m_function).tqarg(params.join(",")); else - return TQString("%1(%2)").arg(m_function).arg(params.join(", ")); + return TQString("%1(%2)").tqarg(m_function).tqarg(params.join(", ")); } TQString SpecialFunction::argumentName(uint i) const @@ -107,9 +107,9 @@ int SpecialFunction::argumentCount() const int SpecialInformation::function(int group, const TQString& fname) { TQString f = fname.lower(); - if (m_functions.contains(group) && m_functions[group].contains(f)) + if (m_functions.tqcontains(group) && m_functions[group].tqcontains(f)) return m_functions[group][f]; - else if (m_aliases.contains(group) && m_aliases[group].contains(f)) + else if (m_aliases.tqcontains(group) && m_aliases[group].tqcontains(f)) return m_aliases[group][f]; return -1; } @@ -122,14 +122,14 @@ SpecialFunction SpecialInformation::functionObject(const TQString& gname, const int SpecialInformation::group(const TQString& gname) { - if (m_groups.contains(gname)) + if (m_groups.tqcontains(gname)) return m_groups[gname]; return -1; } bool SpecialInformation::isValid(int gname, int fname) { - return m_specials.contains(gname) && m_specials[gname].contains(fname); + return m_specials.tqcontains(gname) && m_specials[gname].tqcontains(fname); } bool SpecialInformation::isValid(const TQString& gname, const TQString& fname) @@ -139,7 +139,7 @@ bool SpecialInformation::isValid(const TQString& gname, const TQString& fname) bool SpecialInformation::isValid(int gname, int fname, SpecialFunction::ParserType p) { - return m_specials.contains(gname) && m_specials[gname].contains(fname) + return m_specials.tqcontains(gname) && m_specials[gname].tqcontains(fname) && m_specials[gname][fname].isSupported(p); } @@ -198,9 +198,9 @@ bool SpecialInformation::insert(int id, const TQString& function, const TQString { if (isValid(m_defaultGroup, id)) /* function already defined */ return false; - if (m_functions[m_defaultGroup].contains(function.lower())) + if (m_functions[m_defaultGroup].tqcontains(function.lower())) return false; /* function name already in use */ - if (m_aliases[m_defaultGroup].contains(function.lower())) + if (m_aliases[m_defaultGroup].tqcontains(function.lower())) return false; /* function name already in use */ SpecialFunction sf(pType, function, description, minArgs, maxArgs); m_specials[m_defaultGroup][id] = sf; @@ -224,9 +224,9 @@ bool SpecialInformation::insertAlias(int id, const TQString& alias) { if (!isValid(m_defaultGroup, id)) /* function doesn't exists */ return false; - if (m_functions[m_defaultGroup].contains(alias.lower())) + if (m_functions[m_defaultGroup].tqcontains(alias.lower())) return false; - if (m_aliases[m_defaultGroup].contains(alias.lower())) + if (m_aliases[m_defaultGroup].tqcontains(alias.lower())) return false; m_aliases[m_defaultGroup][alias] = id; return true; @@ -248,7 +248,7 @@ void SpecialInformation::insertGroup(int id, const TQString& name, const TQStrin TQString SpecialInformation::parserGroupName(const TQString& name) { - if (m_parserGroups.contains(name)) + if (m_parserGroups.tqcontains(name)) return m_parserGroups[name]; else return name; @@ -291,8 +291,8 @@ void SpecialInformation::registerSpecials() i18n("Returns text of a cell in a table."), 3); insert(DCOP::checked, "checked(TQString widget)", i18n("Returns 1 for checked boxes, 0 for unchecked."), 1); - insert(DCOP::children, "children(TQString widget, bool recursive)", - i18n("Returns the list of child widgets contained in the parent widget. Set the <i>recursive</i> parameter to <i>true</i> to include widgets contained by child widgets."), 2); + insert(DCOP::tqchildren, "tqchildren(TQString widget, bool recursive)", + i18n("Returns the list of child widgets contained in the tqparent widget. Set the <i>recursive</i> parameter to <i>true</i> to include widgets contained by child widgets."), 2); insert(DCOP::clear, "clear(TQString widget)", i18n("Removes all content from the widget."), 1); insertAlias(DCOP::clear, "clearList"); @@ -375,8 +375,8 @@ void SpecialInformation::registerSpecials() i18n("Returns type(class) of widget."), 1); insert(DCOP::setEditable, "setEditable(TQString widget, bool editable)", i18n("Makes the widget editable or read only, depending on the editable argument."), 2); - insertInternal(DCOP::geometry, "geometry(TQString widget)", - i18n("Return the widget's geometry as <i>x y w h</i>. This is useful for positioning a created widget."), 1); + insertInternal(DCOP::tqgeometry, "tqgeometry(TQString widget)", + i18n("Return the widget's tqgeometry as <i>x y w h</i>. This is useful for positioning a created widget."), 1); insertInternal(DCOP::hasFocus, "hasFocus(TQString widget)", i18n("Returns true if the widget has focus."), 1); insertInternal(DCOP::getBackgroundColor, "getBackgroundColor(TQString widget)", @@ -400,8 +400,8 @@ void SpecialInformation::registerSpecials() insert(Kommander::dcopid, "dcopid", i18n("Returns DCOP identifier of current process. This is shorthand for <i>kmdr-executor-@pid</i>."), 0); - insert(Kommander::parentPid, "parentPid", - i18n("Returns the pid of the parent Kommander window."), 0); + insert(Kommander::tqparentPid, "tqparentPid", + i18n("Returns the pid of the tqparent Kommander window."), 0); insert(Kommander::debug, "debug(TQString text)", i18n("Writes <i>text</i> on stderr."), 1); insert(Kommander::echo, "echo(TQString text)", @@ -440,8 +440,8 @@ void SpecialInformation::registerSpecials() i18n("Executes an external DCOP call."), 3, 9); insertMacro(Kommander::comment, "#", i18n("Adds a comment to EOL that Kommander will not parse"), 0); - insertInternal(Kommander::createWidget, "createWidget(TQString widgetName, TQString widgetType, TQString parent)", - i18n("Creates a new widget with the specified type and as the child of parent."), 3); + insertInternal(Kommander::createWidget, "createWidget(TQString widgetName, TQString widgetType, TQString tqparent)", + i18n("Creates a new widget with the specified type and as the child of tqparent."), 3); insertInternal(Kommander::widgetExists, "widgetExists(TQString widgetName)", i18n("Returns true if there is a widget with the passed name, false otherwise."), 1); insertInternal(Kommander::connect, "connect(TQString sender, TQString signal, TQString receiver, TQString slot)", @@ -524,11 +524,11 @@ void SpecialInformation::registerSpecials() insertGroup(Group::String, "String", "str"); insert(String::length, "length(TQString string)", i18n("Returns number of chars in the string."), 1); - insert(String::contains, "contains(TQString string, TQString substring)", + insert(String::tqcontains, "tqcontains(TQString string, TQString substring)", i18n("Checks if the the string contains the given substring."), 2); - insert(String::find, "find(TQString string, TQString sought, int index)", + insert(String::tqfind, "tqfind(TQString string, TQString sought, int index)", i18n("Returns the position of a substring in the string, or -1 if it is not found."), 2); - insert(String::findRev, "findRev(TQString string, TQString sought, int index)", + insert(String::tqfindRev, "tqfindRev(TQString string, TQString sought, int index)", i18n("Returns the position of a substring in the string, or -1 if it is not found. String is searched backwards"), 2); insertInternal(String::count, "count(TQString String, TQString substring)", i18n("Returns the count of a given substring in the given string."), 2); @@ -540,7 +540,7 @@ void SpecialInformation::registerSpecials() i18n("Returns <i>n</i> chars of the string, starting from <i>start</i>."), 3); insert(String::remove, "remove(TQString string, TQString substring)", i18n("Removes all occurrences of given substring."), 2); - insert(String::replace, "replace(TQString string, TQString substring, TQString replacement)", + insert(String::tqreplace, "tqreplace(TQString string, TQString substring, TQString replacement)", i18n("Replaces all occurrences of the given substring with the given replacement."), 3); insert(String::upper, "upper(TQString string)", i18n("Converts the string to uppercase."), 1); diff --git a/kommander/plugin/specialinformation.h b/kommander/plugin/specialinformation.h index fa898620..1ff00a6c 100644 --- a/kommander/plugin/specialinformation.h +++ b/kommander/plugin/specialinformation.h @@ -36,9 +36,9 @@ public: /* Flags describing which parser supports the function */ enum ParserType {MacroParser = 1, InternalParser = 2, AllParsers = 3}; SpecialFunction(const TQString& function, const TQString& description - = TQString::null, int minArgs = -1, int maxArgs = -1); + = TQString(), int minArgs = -1, int maxArgs = -1); SpecialFunction(ParserType p, const TQString& function, const TQString& description - = TQString::null, int minArgs = -1, int maxArgs = -1); + = TQString(), int minArgs = -1, int maxArgs = -1); SpecialFunction() {m_minArgs = m_maxArgs = 0;} /* minimum number of arguments */ int minArg() const {return m_minArgs;} @@ -90,13 +90,13 @@ public: static TQString description(int gname, int fname); static TQString prototype(int gname, int fname, uint prototypeFlags = 0); /* Insert function supported by all parsers */ - static bool insert(int id, const TQString& function, const TQString description = TQString::null, + static bool insert(int id, const TQString& function, const TQString description = TQString(), int minArgs = -1, int maxArgs = -1, SpecialFunction::ParserType = SpecialFunction::AllParsers); /* Insert function supported by (old) macro parser */ - static bool insertMacro(int id, const TQString& function, const TQString description = TQString::null, + static bool insertMacro(int id, const TQString& function, const TQString description = TQString(), int minArgs = -1, int maxArgs = -1); /* Insert function supported by (new) internal parser */ - static bool insertInternal(int id, const TQString& function, const TQString description = TQString::null, + static bool insertInternal(int id, const TQString& function, const TQString description = TQString(), int minArgs = -1, int maxArgs = -1); static bool insertAlias(int id, const TQString& alias); static void insertGroup(int id, const TQString& name, const TQString& parserName); diff --git a/kommander/plugin/specials.h b/kommander/plugin/specials.h index 2d46200a..f7db7b6d 100644 --- a/kommander/plugin/specials.h +++ b/kommander/plugin/specials.h @@ -28,19 +28,19 @@ namespace Group namespace DCOP { - enum {addUniqueItem, associatedText, cancel, cellText, clear, checked, children, columnCount, count, currentColumn, + enum {addUniqueItem, associatedText, cancel, cellText, clear, checked, tqchildren, columnCount, count, currentColumn, currentItem, currentRow, execute, findItem, global, insertColumn, insertItem, insertItems, insertRow, item, itemDepth, itemPath, removeColumn, removeItem, removeRow, selection, setAssociatedText, setChecked, setCellText, setCurrentItem, insertTab, setColumnCaption, setEnabled, setGlobal, setMaximum, setPixmap, setRowCaption, setSelection, setText, getBackgroundColor, setBackgroundColor, - setVisible, text, type, setCellWidget, cellWidget, setEditable, geometry, hasFocus, isModified}; + setVisible, text, type, setCellWidget, cellWidget, setEditable, tqgeometry, hasFocus, isModified}; } namespace Kommander { - enum {widgetText, selectedWidgetText, null, pid, dcopid, parentPid, debug, + enum {widgetText, selectedWidgetText, null, pid, dcopid, tqparentPid, debug, echo, env, exec, expr, global, i18n, dialog, readSetting, setGlobal, writeSetting, dcop, - switchBlock, execBegin, forBlock, forEachBlock, ifBlock, comment, createWidget, connect, disconnect, widgetExists, exit, Break, Continue, Return, execBackground, switchInternal}; //, focusWidget}; + switchBlock, execBegin, forBlock, forEachBlock, ifBlock, comment, createWidget, connect, disconnect, widgetExists, exit, Break, Continue, Return, execBackground, switchInternal}; //, tqfocusWidget}; } namespace Array @@ -55,7 +55,7 @@ namespace Matrix namespace String { - enum {length, contains, find, findRev, left, right, mid, remove, replace, upper, lower, + enum {length, tqcontains, tqfind, tqfindRev, left, right, mid, remove, tqreplace, upper, lower, compare, isEmpty, isNumber, section, args, toInt, toDouble, round, sort, trim, padLeft, padRight, count}; } |