diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2023-01-03 00:52:18 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2023-01-20 02:10:39 +0100 |
commit | 16434e5519f6224e231bc5f7202f0e495eda7bb7 (patch) | |
tree | d0a3bc5f18eb65f89c1e6238dcf579e6c9cb80ad /sip/tqt | |
parent | 1c362264d328c8886d33061ab992750741f7933a (diff) | |
download | pytqt-16434e5519f6224e231bc5f7202f0e495eda7bb7.tar.gz pytqt-16434e5519f6224e231bc5f7202f0e495eda7bb7.zip |
Do rename qt=>tqt on source files, directories and libraries.
Rename pyuic=>pytquic, pylupdate=>pytqlupdate.
Do rename qt=>tqt on constants and variables.
Do rename QT=>TQT on constants.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'sip/tqt')
174 files changed, 27253 insertions, 0 deletions
diff --git a/sip/tqt/copying.sip b/sip/tqt/copying.sip new file mode 100644 index 0000000..49b4531 --- /dev/null +++ b/sip/tqt/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyTQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%Copying +Copyright (c) 2007 + Riverbank Computing Limited <info@riverbankcomputing.co.uk> + +This file is part of PyTQt. + +This copy of PyTQt is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. + +You should have received a copy of the GNU General Public License along with +PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +%End + + +%OptionalInclude pytqt-internal.sip +%OptionalInclude pytqt-gpl.sip +%OptionalInclude pytqt-commercial.sip +%OptionalInclude pytqt-edu.sip +%OptionalInclude pytqt-eval.sip +%OptionalInclude pytqt-nc.sip +%OptionalInclude pytqt-tkc.sip diff --git a/sip/tqt/tqaccel.sip b/sip/tqt/tqaccel.sip new file mode 100644 index 0000000..a10a9b9 --- /dev/null +++ b/sip/tqt/tqaccel.sip @@ -0,0 +1,80 @@ +// This is the SIP interface definition for TQAccel. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQAccel</Title> +<Para> +<Literal>TQAccel</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQAccel : TQObject +{ +%TypeHeaderCode +#include <tqaccel.h> +%End + +public: + TQAccel(TQWidget * /TransferThis/,char * = 0); + TQAccel(TQWidget *,TQObject * /TransferThis/,char * = 0); + + bool isEnabled(); + void setEnabled(bool); + + uint count(); + + int insertItem(const TQKeySequence &,int = -1); + void removeItem(int); + void clear(); + + TQKeySequence key(int); + int findKey(const TQKeySequence &) const; + + bool isItemEnabled(int) const; + void setItemEnabled(int,bool); + + bool connectItem(int,SIP_RXOBJ_CON,SIP_SLOT_CON(int)); + bool disconnectItem(int,SIP_RXOBJ_DIS,SIP_SLOT_DIS(int)); + + void repairEventFilter(); + + void setWhatsThis(int,const TQString &); + TQString whatsThis(int) const; + void setIgnoreWhatsThis(bool); + bool ignoreWhatsThis() const; + + static TQKeySequence shortcutKey(const TQString &); + static TQString keyToString(TQKeySequence); + static TQKeySequence stringToKey(const TQString &); + +signals: + void activated(int); + void activatedAmbiguously(int); + +protected: + bool eventFilter(TQObject *,TQEvent *); + +private: + TQAccel(const TQAccel &); +}; diff --git a/sip/tqt/tqaction.sip b/sip/tqt/tqaction.sip new file mode 100644 index 0000000..f74ca72 --- /dev/null +++ b/sip/tqt/tqaction.sip @@ -0,0 +1,148 @@ +// This is the SIP interface definition for TQAction and TQActionGroup. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQAction (TQt v2.2+)</Title> +<Para> +<Literal>TQAction</Literal> is fully implemented. +</Para> + +</Sect2> +<Sect2><Title>TQActionGroup (TQt v2.2+)</Title> +<Para> +<Literal>TQActionGroup</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_ACTION) + +class TQAction : TQObject +{ +%TypeHeaderCode +#include <tqaction.h> +%End + +public: + TQAction(TQObject * /TransferThis/,const char * = 0); + TQAction(const TQString &,TQKeySequence,TQObject * /TransferThis/, + const char * = 0); + TQAction(const TQIconSet &,const TQString &,TQKeySequence, + TQObject * /TransferThis/,const char * = 0); + // Obsolete. + TQAction(const TQString &,const TQIconSet &,const TQString &,TQKeySequence, + TQObject * /TransferThis/,const char * = 0,bool = 0); + // Obsolete. + TQAction(const TQString &,const TQString &,TQKeySequence, + TQObject * /TransferThis/,const char * = 0,bool = 0); + // Obsolete. + TQAction(TQObject * /TransferThis/,const char *,bool); + + virtual void setIconSet(const TQIconSet &); + TQIconSet iconSet() const; + virtual void setText(const TQString &); + TQString text() const; + virtual void setMenuText(const TQString &); + TQString menuText() const; + virtual void setToolTip(const TQString &); + TQString toolTip() const; + virtual void setStatusTip(const TQString &); + TQString statusTip() const; + virtual void setWhatsThis(const TQString &); + TQString whatsThis() const; + virtual void setAccel(const TQKeySequence &); + TQKeySequence accel() const; + virtual void setToggleAction(bool); + bool isToggleAction() const; + bool isOn() const; + bool isEnabled() const; + bool isVisible() const; + virtual bool addTo(TQWidget *); + virtual bool removeFrom(TQWidget *); + +protected: + virtual void addedTo(TQWidget *,TQWidget *); + virtual void addedTo(int,TQPopupMenu *); + +public slots: + void activate(); + void toggle(); + virtual void setOn(bool); + virtual void setEnabled(bool); + void setDisabled(bool); + void setVisible(bool); + +signals: + void activated(); + void toggled(bool); + +private: + TQAction(const TQAction &); +}; + + +class TQActionGroup : TQAction +{ +%TypeHeaderCode +#include <tqaction.h> +%End + +public: + TQActionGroup(TQObject * /TransferThis/,const char * = 0); + // Obsolete. + TQActionGroup(TQObject * /TransferThis/,const char *,bool); + + void setExclusive(bool); + bool isExclusive() const; + void add(TQAction *); + void addSeparator(); + bool addTo(TQWidget *); + bool removeFrom(TQWidget *); + void setEnabled(bool); + void setToggleAction(bool); + void setOn(bool); + + void setUsesDropDown(bool); + bool usesDropDown() const; + + void setIconSet(const TQIconSet &); + void setText(const TQString &); + void setMenuText(const TQString &); + void setToolTip(const TQString &); + void setWhatsThis(const TQString &); + +protected: + void childEvent(TQChildEvent *); + virtual void addedTo(TQWidget *,TQWidget *,TQAction *); + virtual void addedTo(int,TQPopupMenu *,TQAction *); + virtual void addedTo(TQWidget *,TQWidget *); + virtual void addedTo(int,TQPopupMenu *); + +signals: + void selected(TQAction *); + +private: + TQActionGroup(const TQActionGroup &); +}; + +%End diff --git a/sip/tqt/tqapplication.sip b/sip/tqt/tqapplication.sip new file mode 100644 index 0000000..8875566 --- /dev/null +++ b/sip/tqt/tqapplication.sip @@ -0,0 +1,467 @@ +// This is the SIP interface definition for TQApplication. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQApplication</Title> +<FuncSynopsis> + <FuncDef><Function>TQApplication</Function></FuncDef> + <ParamDef>int &<Parameter>argc</Parameter></ParamDef> + <ParamDef>char **<Parameter>argv</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes one parameter which is a list of argument strings. Arguments +used by TQt are removed from the list. +</Para> + +<FuncSynopsis> + <FuncDef><Function>TQApplication</Function></FuncDef> + <ParamDef>int &<Parameter>argc</Parameter></ParamDef> + <ParamDef>char **<Parameter>argv</Parameter></ParamDef> + <ParamDef>bool <Parameter>GUIenabled</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes two parameters, the first of which is a list of argument strings. +Arguments used by TQt are removed from the list. +</Para> + +<FuncSynopsis> + <FuncDef><Function>TQApplication</Function></FuncDef> + <ParamDef>int &<Parameter>argc</Parameter></ParamDef> + <ParamDef>char **<Parameter>argv</Parameter></ParamDef> + <ParamDef>Type <Parameter>type</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes two parameters, the first of which is a list of argument strings. +Arguments used by TQt are removed from the list. (TQt v2.2+) +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>exec</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>exec_loop</Literal> in Python. +</Para> +</Sect2> +%End + +%ModuleHeaderCode +#include <tqapplication.h> +%End + +TQApplication *tqApp; + + +class TQApplication : TQObject +{ +%TypeHeaderCode +#include <tqapplication.h> +#include <tqwidgetlist.h> +%End + +public: + TQApplication(SIP_PYLIST) /PostHook=__pyTQtTQAppHook__/ [(int &,char **)]; +%MethodCode + // The Python interface is a list of argument strings that is + // modified. + + int argc; + char **argv; + + // Convert the list. + if ((argv = pyArgvToC(a0,argc)) == NULL) + sipIsErr = 1; + else + { + // Create it now the arguments are right. + static int nargc; + nargc = argc; + + Py_BEGIN_ALLOW_THREADS + sipCpp = new sipTQApplication(nargc,argv); + Py_END_ALLOW_THREADS + + // Now modify the original list. + updatePyArgv(a0,argc,argv); + } +%End + + TQApplication(SIP_PYLIST,bool) /PostHook=__pyTQtTQAppHook__/ [(int &,char **,bool)]; +%MethodCode + // The Python interface is a list of argument strings that is + // modified. + + int argc; + char **argv; + + // Convert the list. + if ((argv = pyArgvToC(a0,argc)) == NULL) + sipIsErr = 1; + else + { + // Create it now the arguments are right. + static int nargc; + nargc = argc; + + Py_BEGIN_ALLOW_THREADS + sipCpp = new sipTQApplication(nargc,argv,a1); + Py_END_ALLOW_THREADS + + // Now modify the original list. + updatePyArgv(a0,argc,argv); + } +%End + + enum Type { + Tty, + GuiClient, + GuiServer + }; + + TQApplication(SIP_PYLIST,Type /Constrained/) /PostHook=__pyTQtTQAppHook__/ [(int &,char **,Type)]; +%MethodCode + // The Python interface is a list of argument strings that is + // modified. + + int argc; + char **argv; + + // Convert the list. + if ((argv = pyArgvToC(a0,argc)) == NULL) + sipIsErr = 1; + else + { + // Create it now the arguments are right. + static int nargc; + nargc = argc; + + Py_BEGIN_ALLOW_THREADS + sipCpp = new sipTQApplication(nargc,argv,(TQApplication::Type)a1); + Py_END_ALLOW_THREADS + + // Now modify the original list. + updatePyArgv(a0,argc,argv); + } +%End + + ~TQApplication(); +%MethodCode + // Make sure all remaining top level widgets are not owned by + // Python. When a PyTQt script terminates we have no control + // over the order in which the TQApplication instance and the + // top level widgets are destroyed. If the former happens + // first then we get a seg. fault. We could take the approach + // of only pretending to delete the TQApplication instance, but + // TQt seems to allow an application to delete the TQApplication + // instance and then create another one. The approach we take + // is to transfer ownership of all top level widgets away from + // Python so that the C++ dtor is not called if they are + // destroyed after the TQApplication instance. This might be + // seen as a memory leak - but if we really are terminating + // then it doesn't matter, and if we are just deleting the + // TQApplication instance then (I think) we should have already + // deleted the top level widgets manually. In any event, the X + // server resources will be freed. + + TQWidgetList *tlw = TQApplication::topLevelWidgets(); + TQWidgetListIt it(*tlw); + TQWidget *w; + + while ((w = it.current()) != 0) + { + PyObject *sw; + + if ((sw = sipGetWrapper(w,sipClass_TQWidget)) != NULL) + sipTransferTo(sw,NULL); + + ++it; + } + + delete tlw; +%End + + int argc() const; + SIP_PYLIST argv() const; +%MethodCode + // The Python interface returns a list of strings. + + int argc = sipCpp -> argc(); + + if ((sipRes = PyList_New(argc)) == NULL) + sipIsErr = 1; + else + for (int a = 0; a < argc; ++a) + if (PyList_SetItem(sipRes,a,PyBytes_FromString(sipCpp -> argv()[a])) < 0) + { + Py_DECREF(sipRes); + sipIsErr = 1; + break; + } +%End + + Type type() const; + static TQStyle &style(); + static void setStyle(TQStyle * /Transfer/); + static TQStyle *setStyle(const TQString &); + + enum ColorSpec + { + NormalColor = 0, + CustomColor = 1, + ManyColor = 2 + }; + + static int colorSpec(); + static void setColorSpec(int); + static TQCursor *overrideCursor(); + static void setOverrideCursor(TQCursor &,bool = 0); + static void restoreOverrideCursor(); + static bool hasGlobalMouseTracking(); + static void setGlobalMouseTracking(bool); + static TQPalette palette(const TQWidget * = 0); + static void setPalette(TQPalette &,bool = 0,const char * = 0); + static TQFont font(const TQWidget * = 0); + static void setFont(const TQFont &,bool = 0,const char * = 0); + static TQFontMetrics fontMetrics(); + TQWidget *mainWidget() const; + virtual void setMainWidget(TQWidget *); + virtual void polish(TQWidget *); + static TQWidgetList *allWidgets(); + static TQWidgetList *topLevelWidgets(); + static TQDesktopWidget *desktop(); + static TQWidget *activePopupWidget(); + static TQWidget *activeModalWidget(); + static TQClipboard *clipboard(); + TQWidget *focusWidget() const; + TQWidget *activeWindow() const; + static TQWidget *widgetAt(int,int,bool = 0); + static TQWidget *widgetAt(const TQPoint &,bool = 0); + + static TQEventLoop *eventLoop(); + + int exec() /PyName=exec_loop, ReleaseGIL, + PreHook=__pyTQtPreEventLoopHook__, + PostHook=__pyTQtPostEventLoopHook__/; + void processEvents() /ReleaseGIL/; + void processEvents(int) /ReleaseGIL/; + void processOneEvent() /ReleaseGIL/; + bool hasPendingEvents(); + int enter_loop() /ReleaseGIL/; + void exit_loop(); + int loopLevel() const; + static void exit(int = 0); + static bool sendEvent(TQObject *,TQEvent *) /ReleaseGIL/; + static void postEvent(TQObject *,TQEvent * /Transfer/) /ReleaseGIL/; + static void sendPostedEvents(TQObject *,int) /ReleaseGIL/; + static void sendPostedEvents() /ReleaseGIL/; + static void removePostedEvents(TQObject *); + virtual bool notify(TQObject *,TQEvent *) /ReleaseGIL/; + static bool startingUp(); + static bool closingDown(); + static void flushX(); + static void flush(); + static void syncX(); + static void beep(); + void setDefaultCodec(TQTextCodec *); + TQTextCodec *defaultCodec() const; + void installTranslator(TQTranslator *); + void removeTranslator(TQTranslator *); + enum Encoding { + DefaultCodec, + UnicodeUTF8 + }; + + TQString translate(const char *,const char *,const char * = 0, + Encoding = DefaultCodec) const; + TQString applicationDirPath(); + TQString applicationFilePath(); + static void setDesktopSettingsAware(bool); + static bool desktopSettingsAware(); + static void setCursorFlashTime(int); + static int cursorFlashTime(); + static void setDoubleClickInterval(int); + static int doubleClickInterval(); + static void setWheelScrollLines(int); + static int wheelScrollLines(); + static void setGlobalStrut(const TQSize &); + static TQSize globalStrut(); + static void setLibraryPaths(const TQStringList &); + static TQStringList libraryPaths(); + static void addLibraryPath(const TQString &); + static void removeLibraryPath(const TQString &); + static void setStartDragTime(int); + static int startDragTime(); + static void setStartDragDistance(int); + static int startDragDistance(); + static void setReverseLayout(bool); + static bool reverseLayout(); + + static int horizontalAlignment(int); + static bool isEffectEnabled(TQt::UIEffect); + static void setEffectEnabled(TQt::UIEffect,bool = 1); + + + bool isSessionRestored() const; + TQString sessionId() const; + TQString sessionKey() const; + virtual void commitData(TQSessionManager &); + virtual void saveState(TQSessionManager &); + void wakeUpGuiThread(); +%If (TQt_THREAD_SUPPORT) + void lock() /ReleaseGIL/; + void unlock(bool = 1); + bool locked(); + bool tryLock(); +%End + +signals: + void lastWindowClosed(); + void aboutToQuit(); + void guiThreadAwake(); + +public slots: + void quit(); + void closeAllWindows(); + void aboutTQt(); + +protected: + bool event(TQEvent *); + +private: + TQApplication(const TQApplication &); + + +%TypeCode +#include <string.h> + + +// Convert a Python argv list to a conventional C argc count and argv array. +static char **pyArgvToC(PyObject *argvlist,int &argc) +{ + char **argv; + + argc = PyList_Size(argvlist); + + // Allocate space for two copies of the argument pointers, plus the + // terminating NULL. + if ((argv = (char **)sipMalloc(2 * (argc + 1) * sizeof (char *))) == NULL) + return NULL; + + // Convert the list. + for (int a = 0; a < argc; ++a) + { + PyObject *argObject = PyList_GET_ITEM(argvlist, a); + char *arg; + + if (PyUnicode_Check(argObject)) + { + arg = tqstrdup(sipString_AsUTF8String(&argObject)); + } + else if (PyBytes_Check(argObject)) + { + arg = tqstrdup(PyBytes_AS_STRING(argObject)); + } + else + { + return NULL; + } + + argv[a] = argv[a + argc + 1] = arg; + } + + argv[argc] = argv[argc + argc + 1] = NULL; + + return argv; +} + + +// Remove arguments from the Python argv list that have been removed from the +// C argv array. +static void updatePyArgv(PyObject *argvlist,int argc,char **argv) +{ + for (int a = 0, na = 0; a < argc; ++a) + { + // See if it was removed. + if (argv[na] == argv[a + argc + 1]) + ++na; + else + PyList_SetSlice(argvlist,na,na + 1,NULL); + } +} +%End + +}; + + +enum TQtMsgType { + TQtDebugMsg, + TQtWarningMsg, + TQtFatalMsg +}; + + +SIP_PYCALLABLE tqInstallMsgHandler(SIP_PYCALLABLE /AllowNone/); +%MethodCode + void (*old)(TQtMsgType, const char *); + + // Treat None as the default handler. + old = tqInstallMsgHandler((a0 != Py_None) ? pytqtMsgHandler : 0); + + // If we recognise the old handler, then return it. Otherwise return + // the default handler. This doesn't exactly mimic the TQt behaviour + // but it is probably close enough for the way it will be used. + sipRes = (old == pytqtMsgHandler) ? pytqtPyMsgHandler : Py_None; + Py_INCREF(sipRes); + + // Save the new Python handler. + Py_XDECREF(pytqtPyMsgHandler); + pytqtPyMsgHandler = a0; + Py_INCREF(pytqtPyMsgHandler); +%End + +%ModuleCode +// The user supplied Python handler. +static PyObject *pytqtPyMsgHandler = 0; + +// The C++ wrapper around the Python handler. +static void pytqtMsgHandler(TQtMsgType type, const char *msg) +{ + PyObject *res; + + SIP_BLOCK_THREADS + + res = sipCallMethod(0, pytqtPyMsgHandler, "Es", type, sipEnum_TQtMsgType, msg); + + Py_XDECREF(res); + + if (res != NULL && res != Py_None) + { + PyErr_SetString(PyExc_TypeError, "invalid result type from PyTQt message handler"); + res = NULL; + } + + if (res == NULL) + PyErr_Print(); + + SIP_UNBLOCK_THREADS +} +%End diff --git a/sip/tqt/tqassistantclient.sip b/sip/tqt/tqassistantclient.sip new file mode 100644 index 0000000..3815962 --- /dev/null +++ b/sip/tqt/tqassistantclient.sip @@ -0,0 +1,59 @@ +// This is the SIP interface definition for TQAssistantClient. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQAssistantClient (TQt v3.1+)</Title> +<Para> +<Literal>TQAssistantClient</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_ASSISTANTCLIENT) + +class TQAssistantClient : TQObject +{ +%TypeHeaderCode +#include <tqassistantclient.h> +%End + +public: + TQAssistantClient(const TQString &,TQObject * /TransferThis/ = 0, + const char * = 0); + + bool isOpen() const; + + void setArguments(const TQStringList &); + +public slots: + virtual void openAssistant() /ReleaseGIL/; + virtual void closeAssistant(); + virtual void showPage(const TQString &); + +signals: + void assistantOpened(); + void assistantClosed(); + void error(const TQString &); +}; + +%End diff --git a/sip/tqt/tqbitmap.sip b/sip/tqt/tqbitmap.sip new file mode 100644 index 0000000..3b499ba --- /dev/null +++ b/sip/tqt/tqbitmap.sip @@ -0,0 +1,48 @@ +// This is the SIP interface definition for TQBitmap. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQBitmap</Title> +<Para> +<Literal>TQBitmap</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQBitmap : TQPixmap +{ +%TypeHeaderCode +#include <tqbitmap.h> +%End + +public: + TQBitmap(); + TQBitmap(int,int,bool = 0,TQPixmap::Optimization = TQPixmap::DefaultOptim); + TQBitmap(const TQSize &,bool = 0,TQPixmap::Optimization = TQPixmap::DefaultOptim); + TQBitmap(int,int,uchar *,bool = 0); + TQBitmap(const TQSize &,uchar *,bool = 0); + TQBitmap(const TQBitmap &); + TQBitmap(const TQString &,const char * = 0); + + TQBitmap xForm(const TQWMatrix &) const; +}; diff --git a/sip/tqt/tqbrush.sip b/sip/tqt/tqbrush.sip new file mode 100644 index 0000000..44d8f91 --- /dev/null +++ b/sip/tqt/tqbrush.sip @@ -0,0 +1,55 @@ +// This is the SIP interface definition for TQBrush. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQBrush</Title> +<Para> +<Literal>TQBrush</Literal> is fully implemented, including the Python +<Literal>==</Literal> and <Literal>!=</Literal> operators. +</Para> +</Sect2> +%End + + +class TQBrush : TQt +{ +%TypeHeaderCode +#include <tqbrush.h> +%End + +public: + TQBrush(); + TQBrush(BrushStyle); + TQBrush(const TQColor &,BrushStyle = SolidPattern); + TQBrush(const TQColor &,const TQPixmap &); + TQBrush(const TQBrush &); + + BrushStyle style() const; + void setStyle(BrushStyle); + const TQColor &color() const; + void setColor(const TQColor &); + TQPixmap *pixmap() const; + void setPixmap(const TQPixmap &); + + bool operator==(const TQBrush &) const; + bool operator!=(const TQBrush &) const; +}; diff --git a/sip/tqt/tqbutton.sip b/sip/tqt/tqbutton.sip new file mode 100644 index 0000000..47c475f --- /dev/null +++ b/sip/tqt/tqbutton.sip @@ -0,0 +1,115 @@ +// This is the SIP interface definition for TQButton. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQButton</Title> +<Para> +<Literal>TQButton</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQButton : TQWidget +{ +%TypeHeaderCode +#include <tqbutton.h> +%End + +public: + TQButton(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + TQString text() const; + virtual void setText(const TQString &); + const TQPixmap *pixmap() const; + virtual void setPixmap(const TQPixmap &); + + TQKeySequence accel() const; + virtual void setAccel(const TQKeySequence &); + + bool isToggleButton() const; + + enum ToggleType + { + SingleShot, + Toggle, + Tristate + }; + + ToggleType toggleType() const; + + virtual void setDown(bool); + bool isDown() const; + + bool isOn() const; + + enum ToggleState + { + Off, + NoChange, + On + }; + + ToggleState state() const; + + bool autoRepeat() const; + virtual void setAutoRepeat(bool); + + bool isExclusiveToggle() const; + + TQButtonGroup *group() const; + +public slots: + void animateClick(); + void toggle(); + +signals: + void pressed(); + void released(); + void clicked(); + void toggled(bool); + void stateChanged(int); + +protected: + void setToggleButton(bool); + virtual void setToggleType(ToggleType); + void setOn(bool); + virtual void setState(ToggleState); + + virtual bool hitButton(const TQPoint &) const; + virtual void drawButton(TQPainter *); + virtual void drawButtonLabel(TQPainter *); + + void keyPressEvent(TQKeyEvent *); + void keyReleaseEvent(TQKeyEvent *); + void mousePressEvent(TQMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); + void mouseMoveEvent(TQMouseEvent *); + void paintEvent(TQPaintEvent *); + void focusInEvent(TQFocusEvent *); + void focusOutEvent(TQFocusEvent *); + + void enabledChange(bool); + +private: + TQButton(const TQButton &); +}; diff --git a/sip/tqt/tqbuttongroup.sip b/sip/tqt/tqbuttongroup.sip new file mode 100644 index 0000000..74fae53 --- /dev/null +++ b/sip/tqt/tqbuttongroup.sip @@ -0,0 +1,82 @@ +// This is the SIP interface definition for TQButtonGroup. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +%DefaultEncoding "UTF-8" + +%ExportedDoc +<Sect2><Title>TQButtonGroup</Title> +<Para> +<Literal>TQButtonGroup</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQButtonGroup : TQGroupBox +{ +%TypeHeaderCode +#include <tqbuttongroup.h> +%End + +public: + TQButtonGroup(TQWidget * /TransferThis/ = 0,const char * = 0); + TQButtonGroup(const TQString &,TQWidget * /TransferThis/ = 0, + const char * = 0); + TQButtonGroup(int,Orientation,TQWidget * /TransferThis/ = 0, + const char * = 0); + TQButtonGroup(int,Orientation,const TQString &, + TQWidget * /TransferThis/ = 0,const char * = 0); + + bool isExclusive() const; + bool isRadioButtonExclusive() const; + virtual void setExclusive(bool); + virtual void setRadioButtonExclusive(bool); + + int insert(TQButton *,int = -1); + void remove(TQButton *); + TQButton *find(int) const; + int id(TQButton *) const; + int count() const; + + virtual void setButton(int); + + virtual void moveFocus(int); + + TQButton *selected() const; + int selectedId() const; + +signals: + void pressed(int); + void released(int); + void clicked(int); + +protected slots: + void buttonPressed(); + void buttonReleased(); + void buttonClicked(); + void buttonToggled(bool); + +protected: + bool event(TQEvent *); + +private: + TQButtonGroup(const TQButtonGroup &); +}; diff --git a/sip/tqt/tqbytearray.sip b/sip/tqt/tqbytearray.sip new file mode 100644 index 0000000..f25ecd6 --- /dev/null +++ b/sip/tqt/tqbytearray.sip @@ -0,0 +1,244 @@ +// This is the SIP interface definition for TQByteArray. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQByteArray</Title> +<Para> +A Python string can be used whenever a <Literal>TQByteArray</Literal> can be +used. A <Literal>TQByteArray</Literal> can be converted to a Python string +using the Python <Literal>str()</Literal> function. +</Para> + +<FuncSynopsis> + <FuncDef>TQByteArray &<Function>assign</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>uint <Parameter>size</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>char &<Function>at</Function></FuncDef> + <ParamDef>uint <Parameter>i</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>contains</Function></FuncDef> + <ParamDef>const char &<Parameter>d</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>fill</Function></FuncDef> + <ParamDef>const char &<Parameter>d</Parameter></ParamDef> + <ParamDef>int <Parameter>size</Parameter> = -1</ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>find</Function></FuncDef> + <ParamDef>const char &<Parameter>d</Parameter></ParamDef> + <ParamDef>uint <Parameter>i</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>resetRawData</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>uint<Parameter>size</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>TQByteArray &<Function>setRawData</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>uint<Parameter>size</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +%End + + +class TQByteArray +{ +%TypeHeaderCode +#include <tqstring.h> +%End + +%TypeCode +// Convert a TQByteArray to a Python string or Py_None if there's +// no data +static PyObject* TQByteArray_To_String(TQByteArray *ba) +{ + // TQByteArrays aren't '\0' terminated so set the size + // explicitly. + char *data; + uint len; + + Py_BEGIN_ALLOW_THREADS + data = ba->data(); + len = ba->size(); + Py_END_ALLOW_THREADS + + if (data) + { + return PyUnicode_FromStringAndSize(data, len); + } + else + { + return Py_None; + } +} +%End + +public: + TQByteArray(); + TQByteArray(int); + TQByteArray(const TQByteArray &); + + SIP_PYOBJECT data() const; +%MethodCode + PyObject* res = TQByteArray_To_String(sipCpp); + + if (res == Py_None) + { + Py_INCREF(Py_None); + } + else if (res == NULL) + { + sipIsErr = 1; + } + else + { + sipRes = res; + } +%End + + // These are actually in TQMemArray, which isn't implemented so pretend + // they are here. + + uint nrefs() const; + bool isEmpty() const; + bool isNull() const; + bool resize(uint); + bool truncate(uint); +// bool fill(const char &,int = -1); + void detach(); + TQByteArray copy() const; + TQByteArray &assign(const TQByteArray &); +// TQByteArray &assign(const char *,uint); + TQByteArray &duplicate(const TQByteArray &); + TQByteArray &duplicate(const char *,uint); +// TQByteArray &setRawData(const char *,uint); +// void resetRawData(const char *,uint); +// int find(const char &,uint = 0) const; +// int contains(const char &) const; +// char &at(uint) const; + + SIP_PYOBJECT __str__(); +%MethodCode + PyObject* res = TQByteArray_To_String(sipCpp); + + if (res == Py_None) + { + sipRes = PyBytes_FromString(""); + } + else + { + sipRes = res; + } +%End + + +%ConvertToTypeCode + // Allow a Python string whenever a TQByteArray is expected. + + if (sipIsErr == NULL) + return (PyBytes_Check(sipPy) || + PyUnicode_Check(sipPy) || + sipCanConvertToInstance(sipPy,sipClass_TQByteArray,SIP_NO_CONVERTORS)); + + if (PyUnicode_Check(sipPy)) + { + Py_BEGIN_ALLOW_THREADS + TQByteArray *ba = new TQByteArray(); + +#if PY_VERSION_HEX >= 0x03030000 + ba -> duplicate((char *)PyUnicode_1BYTE_DATA(sipPy),PyUnicode_GET_SIZE(sipPy)); +#else + ba -> duplicate((char *)PyUnicode_AS_DATA(sipPy),PyUnicode_GET_SIZE(sipPy)); +#endif + *sipCppPtr = ba; + Py_END_ALLOW_THREADS + + return sipGetState(sipTransferObj); + } + else if (PyByteArray_Check(sipPy)) + { + Py_BEGIN_ALLOW_THREADS + TQByteArray *ba = new TQByteArray(); + + ba -> duplicate(PyByteArray_AS_STRING(sipPy),PyByteArray_GET_SIZE(sipPy)); + + *sipCppPtr = ba; + Py_END_ALLOW_THREADS + + return sipGetState(sipTransferObj); + } + else if (PyBytes_Check(sipPy)) + { + Py_BEGIN_ALLOW_THREADS + TQByteArray *ba = new TQByteArray(); + + ba -> duplicate(PyBytes_AS_STRING(sipPy),PyBytes_GET_SIZE(sipPy)); + + *sipCppPtr = ba; + Py_END_ALLOW_THREADS + + return sipGetState(sipTransferObj); + } + + *sipCppPtr = reinterpret_cast<TQByteArray *>(sipConvertToInstance(sipPy,sipClass_TQByteArray,sipTransferObj,SIP_NO_CONVERTORS,0,sipIsErr)); + + return 0; +%End +}; + + +TQByteArray tqCompress(const uchar * /Array/,int /ArraySize/); +TQByteArray tqCompress(const TQByteArray &); +TQByteArray tqUncompress(const uchar * /Array/,int /ArraySize/); +TQByteArray tqUncompress(const TQByteArray &); diff --git a/sip/tqt/tqcdestyle.sip b/sip/tqt/tqcdestyle.sip new file mode 100644 index 0000000..b11af4c --- /dev/null +++ b/sip/tqt/tqcdestyle.sip @@ -0,0 +1,55 @@ +// This is the SIP interface definition for TQCDEStyle. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQCDEStyle (TQt v2+)</Title> +<Para> +<Literal>TQCDEStyle</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_STYLE_CDE) + +class TQCDEStyle : TQMotifStyle +{ +%TypeHeaderCode +#include <tqcdestyle.h> +%End + +public: + TQCDEStyle(bool = 0); + + int pixelMetric(PixelMetric,const TQStyleControlElementData&,ControlElementFlags,const TQWidget * = 0) const; + + void drawControl(ControlElement,TQPainter *,const TQStyleControlElementData&,ControlElementFlags, + const TQRect &,const TQColorGroup &, + SFlags = Style_Default, + const TQStyleOption & = TQStyleOption(),const TQWidget *=0) const; + + void drawPrimitive(PrimitiveElement,TQPainter *,const TQStyleControlElementData&,ControlElementFlags,const TQRect &, + const TQColorGroup &,SFlags = Style_Default, + const TQStyleOption & = TQStyleOption()) const; +}; + +%End diff --git a/sip/tqt/tqcheckbox.sip b/sip/tqt/tqcheckbox.sip new file mode 100644 index 0000000..237a4b8 --- /dev/null +++ b/sip/tqt/tqcheckbox.sip @@ -0,0 +1,63 @@ +// This is the SIP interface definition for TQCheckBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQCheckBox</Title> +<Para> +<Literal>TQCheckBox</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQCheckBox : TQButton +{ +%TypeHeaderCode +#include <tqcheckbox.h> +%End + +public: + TQCheckBox(TQWidget * /TransferThis/,const char * = 0); + TQCheckBox(const TQString &,TQWidget * /TransferThis/,const char * = 0); + + bool isChecked() const; + + void setNoChange(); + + void setTristate(bool = 1); + bool isTristate() const; + + TQSize sizeHint() const; + +public slots: + void setChecked(bool); + +protected: + void resizeEvent(TQResizeEvent *); + void drawButton(TQPainter *); + void drawButtonLabel(TQPainter *); + void updateMask(); + bool hitButton(const TQPoint &) const; + +private: + TQCheckBox(const TQCheckBox &); +}; diff --git a/sip/tqt/tqclipboard.sip b/sip/tqt/tqclipboard.sip new file mode 100644 index 0000000..73057fa --- /dev/null +++ b/sip/tqt/tqclipboard.sip @@ -0,0 +1,132 @@ +// This is the SIP interface definition for TQClipboard. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQClipboard</Title> +<FuncSynopsis> + <FuncDef>void *<Function>data</Function> const</FuncDef> + <ParamDef>const char *<Parameter>format</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented (TQt v1.x). +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>setData</Function></FuncDef> + <ParamDef>const char *<Parameter>format</Parameter></ParamDef> + <ParamDef>void *<Parameter></Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented (TQt v1.x). +</Para> +</Sect2> +%End + + +%If (TQt_CLIPBOARD) + +class TQClipboard : TQObject +{ +%TypeHeaderCode +#include <tqclipboard.h> +%End + +private: + TQClipboard(TQObject * /TransferThis/ = 0,const char * = 0); + ~TQClipboard(); + +public: + enum Mode { + Clipboard, + Selection + }; + + void clear(Mode); + void clear(); + + bool supportsSelection() const; + bool ownsSelection() const; + bool ownsClipboard() const; + + void setSelectionMode(bool); + bool selectionModeEnabled() const; + + TQString text(Mode) const; + TQString text(TQCString &,Mode) const; + void setText(const TQString &,Mode); + +%If (TQt_MIMECLIPBOARD) + TQMimeSource *data(Mode) const; + void setData(TQMimeSource * /GetWrapper/,Mode); +%MethodCode + sipCpp->setData(a0, a1); + + // Transfer ownership to C++ and make sure the Python object + // stays alive by giving it a reference to itself. The cycle + // will be broken by TQMimeSource's virtual dtor. + sipTransferTo(a0Wrapper, a0Wrapper); +%End + + TQImage image(Mode) const; + TQPixmap pixmap(Mode) const; + void setImage(const TQImage &,Mode); + void setPixmap(const TQPixmap &,Mode); +%End + +%If (TQt_MIMECLIPBOARD) + TQMimeSource *data() const; + void setData(TQMimeSource * /GetWrapper/); +%MethodCode + sipCpp->setData(a0); + + // Transfer ownership to C++ and make sure the Python object + // stays alive by giving it a reference to itself. The cycle + // will be broken by TQMimeSource's virtual dtor. + sipTransferTo(a0Wrapper, a0Wrapper); +%End +%End + TQString text() const; + TQString text(TQCString &) const; + void setText(const TQString &); +%If (TQt_MIMECLIPBOARD) + TQImage image() const; + TQPixmap pixmap() const; + void setImage(const TQImage &); +%End + +%If (TQt_MIMECLIPBOARD) + void setPixmap(const TQPixmap &); +%End + +signals: + void selectionChanged(); + void dataChanged(); + +protected: + void connectNotify(const char *); + bool event(TQEvent *); + +private: + TQClipboard(const TQClipboard &); +}; + +%End diff --git a/sip/tqt/tqcolor.sip b/sip/tqt/tqcolor.sip new file mode 100644 index 0000000..8fb53d2 --- /dev/null +++ b/sip/tqt/tqcolor.sip @@ -0,0 +1,156 @@ +// This is the SIP interface definition for TQColor. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQColor</Title> +<Para> +The Python <Literal>==</Literal> and <Literal>!=</Literal> operators are +supported. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>getHsv</Function></FuncDef> + <ParamDef>int *<Parameter>h</Parameter></ParamDef> + <ParamDef>int *<Parameter>s</Parameter></ParamDef> + <ParamDef>int *<Parameter>v</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns the <Literal>h</Literal>, +<Literal>s</Literal> and <Literal>v</Literal> values as a tuple. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>getRgb</Function></FuncDef> + <ParamDef>int *<Parameter>r</Parameter></ParamDef> + <ParamDef>int *<Parameter>g</Parameter></ParamDef> + <ParamDef>int *<Parameter>b</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns the <Literal>r</Literal>, +<Literal>g</Literal> and <Literal>b</Literal> values as a tuple. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>hsv</Function></FuncDef> + <ParamDef>int *<Parameter>h</Parameter></ParamDef> + <ParamDef>int *<Parameter>s</Parameter></ParamDef> + <ParamDef>int *<Parameter>v</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns the <Literal>h</Literal>, +<Literal>s</Literal> and <Literal>v</Literal> values as a tuple. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>rgb</Function></FuncDef> + <ParamDef>int *<Parameter>r</Parameter></ParamDef> + <ParamDef>int *<Parameter>g</Parameter></ParamDef> + <ParamDef>int *<Parameter>b</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns the <Literal>r</Literal>, +<Literal>g</Literal> and <Literal>b</Literal> values as a tuple. +</Para> +</Sect2> +%End + + +%ModuleHeaderCode +#include <tqcolor.h> +%End + + +// Related functions. + +int tqRed(TQRgb); +int tqGreen(TQRgb); +int tqBlue(TQRgb); +TQRgb tqRgb(int,int,int); +int tqGray(int,int,int); +int tqGray(TQRgb); + +int tqAlpha(TQRgb); +TQRgb tqRgba(int,int,int,int); + + +class TQColor +{ +%TypeHeaderCode +#include <tqcolor.h> +%End + +public: + enum Spec { + Rgb, + Hsv + }; + + TQColor(); + TQColor(int,int,int); + TQColor(int,int,int,Spec); + TQColor(TQRgb,uint = 0xffffffff); + TQColor(const TQString &); + TQColor(const char *); + TQColor(const TQColor &); + + bool isValid() const; + bool isDirty() const; + TQString name() const; + void setNamedColor(const TQString &); + + TQRgb rgb() const; + void setRgb(int,int,int); + void setRgb(TQRgb); + void getRgb(int *,int *,int *) const; + + // Obsolete and is hidden anyway by the overload above. + //void rgb(int *,int *,int *) const; + + int red() const; + int green() const; + int blue() const; + + void setHsv(int,int,int); + + void getHsv(int *,int *,int *) const; + + // Obsolete. + void hsv(int *,int *,int *) const; + + TQColor light(int = 150) const; + TQColor dark(int = 200) const; + + bool operator==(const TQColor &) const; + bool operator!=(const TQColor &) const; + + uint alloc(); + uint pixel() const; + static int maxColors(); + static int numBitPlanes(); + static int enterAllocContext(); + static void leaveAllocContext(); + static int currentAllocContext(); + static void destroyAllocContext(int); + static void initialize(); + static void cleanup(); + static TQStringList colorNames(); +}; diff --git a/sip/tqt/tqcolordialog.sip b/sip/tqt/tqcolordialog.sip new file mode 100644 index 0000000..ff77210 --- /dev/null +++ b/sip/tqt/tqcolordialog.sip @@ -0,0 +1,64 @@ +// This is the SIP interface definition for TQColorDialog. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQColorDialog (TQt v2+)</Title> +<FuncSynopsis> + <FuncDef>static TQRgb <Function>getRgba</Function></FuncDef> + <ParamDef>TQRgb <Parameter>initial</Parameter></ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter></ParamDef> + <ParamDef>TQWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>initial</Literal>, <Literal>parent</Literal> and +<Literal>name</Literal> parameters and returns a tuple containing the +<Literal>TQRgb</Literal> result and the <Literal>ok</Literal> value. +</Para> +</Sect2> +%End + + +%If (TQt_COLORDIALOG) + +class TQColorDialog : TQDialog +{ +%TypeHeaderCode +#include <tqcolordialog.h> +%End + +public: + static TQColor getColor(const TQColor & = TQt::white,TQWidget * = 0, + const char * = 0) /ReleaseGIL/; + static TQRgb getRgba(TQRgb,bool * = 0,TQWidget * = 0,const char * = 0) /ReleaseGIL/; + static int customCount(); + static TQRgb customColor(int); + static void setCustomColor(int,TQRgb); + static void setStandardColor(int,TQRgb); + +private: + TQColorDialog(TQWidget * /TransferThis/ = 0,const char * = 0,bool = 0); + TQColorDialog(const TQColorDialog &); + ~TQColorDialog(); +}; + +%End diff --git a/sip/tqt/tqcolorgroup.sip b/sip/tqt/tqcolorgroup.sip new file mode 100644 index 0000000..8ab220b --- /dev/null +++ b/sip/tqt/tqcolorgroup.sip @@ -0,0 +1,89 @@ +// This is the SIP interface definition for TQColorGroup. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQColorGroup</Title> +<Para> +<Literal>TQColorGroup</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQColorGroup +{ +%TypeHeaderCode +#include <tqpalette.h> +%End + +public: + TQColorGroup(); + TQColorGroup(const TQColor &,const TQColor &,const TQColor &,const TQColor &, + const TQColor &,const TQColor &,const TQColor &); + TQColorGroup(const TQBrush &,const TQBrush &,const TQBrush &,const TQBrush &, + const TQBrush &,const TQBrush &,const TQBrush &,const TQBrush &, + const TQBrush &); + TQColorGroup(TQColorGroup&); + + enum ColorRole + { + Foreground, + Button, + Light, + Midlight, + Dark, + Mid, + Text, + BrightText, + ButtonText, + Base, + Background, + Shadow, + Highlight, + HighlightedText, + Link, + LinkVisited, + NColorRoles + }; + + const TQColor &color(ColorRole) const; + const TQBrush &brush(ColorRole) const; + void setColor(ColorRole,const TQColor &); + void setBrush(ColorRole,const TQBrush &); + + const TQColor &foreground() const; + const TQColor &button() const; + const TQColor &light() const; + const TQColor &dark() const; + const TQColor &mid() const; + const TQColor &text() const; + const TQColor &base() const; + const TQColor &background() const; + const TQColor &midlight() const; + const TQColor &brightText() const; + const TQColor &buttonText() const; + const TQColor &shadow() const; + const TQColor &highlight() const; + const TQColor &highlightedText() const; + const TQColor &link() const; + const TQColor &linkVisited() const; +}; diff --git a/sip/tqt/tqcombobox.sip b/sip/tqt/tqcombobox.sip new file mode 100644 index 0000000..cc878ed --- /dev/null +++ b/sip/tqt/tqcombobox.sip @@ -0,0 +1,148 @@ +// This is the SIP interface definition for TQComboBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQComboBox</Title> +<Para> +<Literal>TQComboBox</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQComboBox : TQWidget +{ +%TypeHeaderCode +#include <tqcombobox.h> +%End + +public: + TQComboBox(TQWidget * /TransferThis/ = 0,char * = 0); + TQComboBox(bool,TQWidget * /TransferThis/ = 0,char * = 0); + + int count() const; + + void insertStringList(TQStringList &,int = -1); + void insertStrList(const TQStrList *,int = -1); +// void insertStrList(const TQStrList &,int = -1); +// void insertStrList(const char **,int = -1,int = -1); + + void insertItem(const TQString &,int = -1); + void insertItem(const TQPixmap &,int = -1); + void insertItem(const TQPixmap &,const TQString &,int = -1); + + void removeItem(int); + + int currentItem() const; + virtual void setCurrentItem(int); + + TQString currentText() const; + virtual void setCurrentText(const TQString &); + + TQString text(int) const; + const TQPixmap *pixmap(int) const; + + void changeItem(const TQString &,int); + void changeItem(const TQPixmap &,int); + void changeItem(const TQPixmap &,const TQString &,int); + + bool autoResize() const; + virtual void setAutoResize(bool); + TQSize sizeHint() const; + + void setPalette(const TQPalette &); + void setFont(const TQFont &); + void setEnabled(bool); + + virtual void setSizeLimit(int); + int sizeLimit() const; + + virtual void setMaxCount(int); + int maxCount() const; + + enum Policy { + NoInsertion, + AtTop, + AtCurrent, + AtBottom, + AfterCurrent, + BeforeCurrent + }; + + virtual void setInsertionPolicy(Policy); + Policy insertionPolicy() const; + + virtual void setValidator(const TQValidator *); + const TQValidator *validator() const; + + virtual void setListBox(TQListBox *); + TQListBox *listBox() const; + + virtual void setLineEdit(TQLineEdit *); + TQLineEdit *lineEdit() const; + + virtual void setAutoCompletion(bool); + bool autoCompletion() const; + + bool eventFilter(TQObject *,TQEvent *); + + void setDuplicatesEnabled(bool); + bool duplicatesEnabled() const; + + bool editable() const; + void setEditable(bool); + + virtual void popup(); + + void hide(); + +public slots: + void clear(); + void clearValidator(); + void clearEdit(); + virtual void setEditText(const TQString &); + +signals: + void activated(int); + void highlighted(int); + void activated(const TQString &); + void highlighted(const TQString &); + void textChanged(const TQString &); + +protected: + void paintEvent(TQPaintEvent *); + void resizeEvent(TQResizeEvent *); + void mousePressEvent(TQMouseEvent *); + void mouseMoveEvent(TQMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); + void mouseDoubleClickEvent(TQMouseEvent *); + void keyPressEvent(TQKeyEvent *); + void focusInEvent(TQFocusEvent *); + void focusOutEvent(TQFocusEvent *); + void wheelEvent(TQWheelEvent *); + void styleChange(TQStyle &); + + void updateMask(); + +private: + TQComboBox(const TQComboBox &); +}; diff --git a/sip/tqt/tqcommonstyle.sip b/sip/tqt/tqcommonstyle.sip new file mode 100644 index 0000000..9eb4463 --- /dev/null +++ b/sip/tqt/tqcommonstyle.sip @@ -0,0 +1,105 @@ +// This is the SIP interface definition for TQCommonStyle. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQCommonStyle (TQt v2+)</Title> +<FuncSynopsis> + <FuncDef>virtual void <Function>getButtonShift</Function></FuncDef> + <ParamDef>int &<Parameter>x</Parameter></ParamDef> + <ParamDef>int &<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>x</Literal> and +<Literal>y</Literal> values. (TQt v2) +</Para> + +<FuncSynopsis> + <FuncDef>virtual void <Function>tabbarMetrics</Function></FuncDef> + <ParamDef>const TQTabBar *<Parameter>t</Parameter></ParamDef> + <ParamDef>int &<Parameter>hframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>vframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>overlap</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>t</Literal> parameter and returns a tuple of the +<Literal>hframe</Literal>, <Literal>vframe</Literal> and +<Literal>overlap</Literal> values. (TQt v2) +</Para> +</Sect2> +%End + + +class TQCommonStyle : TQStyle +{ +%TypeHeaderCode +#include <tqcommonstyle.h> +%End + +public: + TQCommonStyle(); + + void drawPrimitive(PrimitiveElement,TQPainter *,const TQStyleControlElementData&,ControlElementFlags,const TQRect &, + const TQColorGroup &,SFlags = Style_Default, + const TQStyleOption& = TQStyleOption()) const; + + void drawControl(ControlElement,TQPainter *,const TQStyleControlElementData&,ControlElementFlags, + const TQRect &,const TQColorGroup &, + SFlags = Style_Default, + const TQStyleOption & = TQStyleOption(), const TQWidget *=0) const; + + void drawControlMask(ControlElement,TQPainter *,const TQStyleControlElementData&,ControlElementFlags, + const TQRect &, + const TQStyleOption & = TQStyleOption(), const TQWidget *=0) const; + + TQRect subRect(SubRect,const TQStyleControlElementData&, const ControlElementFlags,const TQWidget *) const; + + void drawComplexControl(ComplexControl,TQPainter *,const TQStyleControlElementData&,ControlElementFlags, + const TQRect &,const TQColorGroup &, + SFlags = Style_Default,SCFlags = SC_All, + SCFlags = SC_None, + const TQStyleOption & = TQStyleOption(),const TQWidget *=0) const; + + void drawComplexControlMask(ComplexControl,TQPainter *,const TQStyleControlElementData&,const ControlElementFlags, + const TQRect &, + const TQStyleOption & = TQStyleOption(), const TQWidget *=0) const; + + TQRect querySubControlMetrics(ComplexControl,const TQStyleControlElementData&,ControlElementFlags,SubControl, + const TQStyleOption & = TQStyleOption(), const TQWidget *=0) const; + + SubControl querySubControl(ComplexControl,const TQStyleControlElementData&,ControlElementFlags, + const TQPoint &, + const TQStyleOption & = TQStyleOption(),const TQWidget *=0) const; + + int pixelMetric(PixelMetric,const TQStyleControlElementData&,ControlElementFlags,const TQWidget * = 0) const; + + TQSize sizeFromContents(ContentsType,const TQStyleControlElementData&,ControlElementFlags,const TQSize &, + const TQStyleOption & = TQStyleOption(),const TQWidget *=0) const; + + int styleHint(StyleHint,const TQStyleControlElementData&,ControlElementFlags,const TQStyleOption &, + TQStyleHintReturn *,const TQWidget *=0) const; + + TQPixmap stylePixmap(StylePixmap,const TQStyleControlElementData&,ControlElementFlags, + const TQStyleOption & = TQStyleOption(), const TQWidget * = 0) const; + +private: + TQCommonStyle(const TQCommonStyle &); +}; diff --git a/sip/tqt/tqcstring.sip b/sip/tqt/tqcstring.sip new file mode 100644 index 0000000..19387ae --- /dev/null +++ b/sip/tqt/tqcstring.sip @@ -0,0 +1,217 @@ +// This is the SIP interface definition for TQCString. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQCString (TQt v2+)</Title> +<Para> +A Python string can be used whenever a <Literal>TQCString</Literal> can be used. +A <Literal>TQCString</Literal> can be converted to a Python string using the +Python <Literal>str()</Literal> function. +</Para> + +<FuncSynopsis> + <FuncDef>TQCString &<Function>sprintf</Function></FuncDef> + <ParamDef>const char *<Parameter>format</Parameter></ParamDef> + <ParamDef>...</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>short <Function>toShort</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>short</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>ushort <Function>toUShort</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>ushort</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>toInt</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>int</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>uint <Function>toUInt</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>uint</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>long <Function>toLong</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>long</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>ulong <Function>toULong</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>ulong</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>float <Function>toFloat</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>float</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>double <Function>toDouble</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>double</Literal> result and the +<Literal>ok</Literal> value. +</Para> +</Sect2> +%End + + +class TQCString : TQByteArray +{ +%TypeHeaderCode +#include <tqcstring.h> +%End + +public: + TQCString(); + TQCString(int); + TQCString(const TQCString &); + TQCString(const char *); + TQCString(const char *,uint); + + bool isNull() const; + bool isEmpty() const; + uint length() const; + bool resize(uint); + bool truncate(uint); + bool fill(char,int = -1); + TQCString copy() const; +// TQCString &sprintf(const char *,...); +// int find(char,int = 0,bool = 1) const; + int find(const char *,int = 0,bool = 1) const; + int find(const TQRegExp &,int = 0) const; +// int findRev(char,int = -1,bool = 1) const; + int findRev(const char *,int = -1,bool = 1) const; + int findRev(const TQRegExp &,int = -1) const; +// int contains(char,bool = 1) const; + int contains(const char *,bool = 1) const; + int contains(const TQRegExp &) const; + TQCString left(uint) const; + TQCString right(uint) const; + TQCString mid(uint,uint = 0xffffffff) const; + TQCString leftJustify(uint,char = ' ',bool = 0) const; + TQCString rightJustify(uint,char = ' ',bool = 0) const; + TQCString lower() const; + TQCString upper() const; + TQCString stripWhiteSpace() const; + TQCString simplifyWhiteSpace() const; + TQCString &insert(uint,const char *); +// TQCString &insert(uint,char); + TQCString &append(const char *); + TQCString &prepend(const char *); + TQCString &remove(uint,uint); + TQCString &replace(uint,uint,const char *); + TQCString &replace(const TQRegExp &,const char *); +// TQCString &replace(char,const char *); + TQCString &replace(const char *,const char *); +// TQCString &replace(char,char); + + short toShort(bool * = 0) const; + ushort toUShort(bool * = 0) const; + int toInt(bool * = 0) const; + uint toUInt(bool * = 0) const; + long toLong(bool * = 0) const; + ulong toULong(bool * = 0) const; + float toFloat(bool * = 0) const; + double toDouble(bool * = 0) const; + + TQCString &setStr(const char *); +// TQCString &setNum(short); +// TQCString &setNum(ushort); + TQCString &setNum(int /Constrained/); +// TQCString &setNum(uint); +// TQCString &setNum(long); +// TQCString &setNum(ulong); +// TQCString &setNum(float,char = 'g',int = 6); + TQCString &setNum(double,char = 'g',int = 6); + bool setExpand(uint,char); + + SIP_PYOBJECT __str__(); +%MethodCode + const char *s; + + Py_BEGIN_ALLOW_THREADS + s = *sipCpp; + Py_END_ALLOW_THREADS + + if (s == NULL) + s = ""; + + sipRes = PyBytes_FromString(s); +%End + +%ConvertToTypeCode + // Allow a Python string whenever a TQCString is expected. + + if (sipIsErr == NULL) + return (PyBytes_Check(sipPy) || + sipCanConvertToInstance(sipPy,sipClass_TQCString,SIP_NO_CONVERTORS)); + + if (PyBytes_Check(sipPy)) + { + *sipCppPtr = new TQCString(PyBytes_AS_STRING(sipPy)); + + return sipGetState(sipTransferObj); + } + + *sipCppPtr = reinterpret_cast<TQCString *>(sipConvertToInstance(sipPy,sipClass_TQCString,sipTransferObj,SIP_NO_CONVERTORS,0,sipIsErr)); + + return 0; +%End +}; diff --git a/sip/tqt/tqcursor.sip b/sip/tqt/tqcursor.sip new file mode 100644 index 0000000..3a8d9ca --- /dev/null +++ b/sip/tqt/tqcursor.sip @@ -0,0 +1,69 @@ +// This is the SIP interface definition for TQCursor. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQCursor</Title> +<Para> +<Literal>TQCursor</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%ModuleHeaderCode +#include <tqcursor.h> +%End + + +class TQCursor : TQt +{ +%TypeHeaderCode +#include <tqcursor.h> +%End + +public: + TQCursor(); + TQCursor(int); + TQCursor(const TQBitmap &,const TQBitmap &,int = -1,int = -1); + TQCursor(const TQPixmap &,int = -1,int = -1); + TQCursor(const TQCursor &); + + int shape() const; + void setShape(int); + const TQBitmap *bitmap() const; + const TQBitmap *mask() const; + TQPoint hotSpot() const; + +%If (WS_X11) + HANDLE handle() const; + // This would have the same Python signature as TQCursor(int). + //TQCursor(HANDLE); +%End + static TQPoint pos(); + static void setPos(int,int); + static void setPos(const TQPoint &); + static void initialize(); + static void cleanup(); +%If (WS_X11) + static int x11Screen(); +%End +}; diff --git a/sip/tqt/tqdatastream.sip b/sip/tqt/tqdatastream.sip new file mode 100644 index 0000000..8a1479b --- /dev/null +++ b/sip/tqt/tqdatastream.sip @@ -0,0 +1,218 @@ +// This is the SIP interface definition for TQDataStream. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQDataStream</Title> +<FuncSynopsis> + <FuncDef>TQDataStream &<Function>readBytes</Function></FuncDef> + <ParamDef>const char *&<Parameter>s</Parameter></ParamDef> + <ParamDef>uint &<Parameter>l</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters. The <Literal>TQDataStream</Literal> result and the +data read are returned as a tuple. +</Para> + +<FuncSynopsis> + <FuncDef>TQDataStream &<Function>readRawBytes</Function></FuncDef> + <ParamDef>const char *<Parameter>s</Parameter></ParamDef> + <ParamDef>uint <Parameter>l</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>l</Literal> parameter. The +<Literal>TQDataStream</Literal> result and the data read are returned as a +tuple. +</Para> + +<FuncSynopsis> + <FuncDef>TQDataStream &<Function>writeBytes</Function></FuncDef> + <ParamDef>const char *<Parameter>s</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>s</Literal> and not passed as a +parameter. +</Para> + +<FuncSynopsis> + <FuncDef>TQDataStream &<Function>writeRawBytes</Function></FuncDef> + <ParamDef>const char *<Parameter>s</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>s</Literal> and not passed as a +parameter. +</Para> +</Sect2> +%End + + +class TQDataStream +{ +%TypeHeaderCode +#include <tqdatastream.h> +%End + +public: + TQDataStream(); + TQDataStream(TQIODevice *); + TQDataStream(TQByteArray,int); + + TQIODevice *device() const; + void setDevice(TQIODevice *); + void unsetDevice(); + bool atEnd() const; + bool eof() const; + + enum ByteOrder { + BigEndian, + LittleEndian + }; + + int byteOrder() const; + void setByteOrder(int); + bool isPrintableData() const; + void setPrintableData(bool); + int version() const; + void setVersion(int); + + SIP_PYTUPLE readBytes() /ReleaseGIL/; +%MethodCode + char *c; + uint l; + + Py_BEGIN_ALLOW_THREADS + sipCpp -> TQDataStream::readBytes(c,l); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr,"(Sa)",sipSelf,c,l); + + if (c) + delete[] c; +%End + + SIP_PYTUPLE readRawBytes(uint) /ReleaseGIL/; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipCpp -> TQDataStream::readRawBytes(buf,a0); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr,"(Sa)",sipSelf,buf,a0); + + sipFree((void *)buf); + } +%End + + TQDataStream &writeBytes(const char * /Array/, + uint /ArraySize/) /ReleaseGIL/; + TQDataStream &writeRawBytes(const char * /Array/, + uint /ArraySize/) /ReleaseGIL/; + + // These are taken from the corresponding class definitions. We limit + // them to TQt v3.0.0 and later just to avoid checking earlier versions. + + TQDataStream &operator<<(const TQBrush &); + TQDataStream &operator>>(TQBrush & /Constrained/); + + TQDataStream &operator<<(const TQColor &); + TQDataStream &operator>>(TQColor & /Constrained/); + + TQDataStream &operator<<(const TQByteArray &); + TQDataStream &operator>>(TQByteArray & /Constrained/); + + TQDataStream &operator<<(const TQCString &); + TQDataStream &operator>>(TQCString & /Constrained/); + + TQDataStream &operator<<(const TQCursor &); + TQDataStream &operator>>(TQCursor & /Constrained/); + + TQDataStream &operator<<(const TQDate &); + TQDataStream &operator>>(TQDate & /Constrained/); + + TQDataStream &operator<<(const TQTime &); + TQDataStream &operator>>(TQTime & /Constrained/); + + TQDataStream &operator<<(const TQDateTime &); + TQDataStream &operator>>(TQDateTime & /Constrained/); + + TQDataStream &operator<<(const TQFont &); + TQDataStream &operator>>(TQFont & /Constrained/); + + TQDataStream &operator<<(const TQImage &); + TQDataStream &operator>>(TQImage & /Constrained/); + + TQDataStream &operator<<(const TQKeySequence &); + TQDataStream &operator>>(TQKeySequence & /Constrained/); + + TQDataStream &operator<<(const TQColorGroup &); + TQDataStream &operator>>(TQColorGroup & /Constrained/); + + TQDataStream &operator<<(const TQPalette &); + TQDataStream &operator>>(TQPalette & /Constrained/); + + TQDataStream &operator<<(const TQPen &); + TQDataStream &operator>>(TQPen & /Constrained/); + + TQDataStream &operator<<(const TQPicture &); + TQDataStream &operator>>(TQPicture & /Constrained/); + + TQDataStream &operator<<(const TQPixmap &); + TQDataStream &operator>>(TQPixmap & /Constrained/); + + TQDataStream &operator<<(const TQPointArray &); + TQDataStream &operator>>(TQPointArray & /Constrained/); + + TQDataStream &operator<<(const TQPoint &); + TQDataStream &operator>>(TQPoint & /Constrained/); + + TQDataStream &operator<<(const TQRect &); + TQDataStream &operator>>(TQRect & /Constrained/); + + TQDataStream &operator<<(const TQRegion &); + TQDataStream &operator>>(TQRegion & /Constrained/); + + TQDataStream &operator<<(const TQSize &); + TQDataStream &operator>>(TQSize & /Constrained/); + + TQDataStream &operator<<(const TQString &); + TQDataStream &operator>>(TQString & /Constrained/); + + TQDataStream &operator<<(const TQStringList &); + TQDataStream &operator>>(TQStringList & /Constrained/); + + TQDataStream &operator<<(const TQVariant &); + TQDataStream &operator>>(TQVariant & /Constrained/); + + TQDataStream &operator<<(const TQWMatrix &); + TQDataStream &operator>>(TQWMatrix & /Constrained/); + TQDataStream &operator<<(const TQUuid &); + TQDataStream &operator>>(TQUuid & /Constrained/); + +private: + TQDataStream(const TQDataStream &); +}; diff --git a/sip/tqt/tqdatetime.sip b/sip/tqt/tqdatetime.sip new file mode 100644 index 0000000..3df731d --- /dev/null +++ b/sip/tqt/tqdatetime.sip @@ -0,0 +1,226 @@ +// This is the SIP interface definition for TQDate, TQDateTime and TQTime. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQDate</Title> +<Para> +The Python +<Literal>==</Literal>, <Literal>!=</Literal>, +<Literal><</Literal>, <Literal><=</Literal>, +<Literal>></Literal>, <Literal>>=</Literal> +and <Literal>__nonzero__</Literal> +operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>weekNumber</Function></FuncDef> + <ParamDef>int *<Parameter>yearNum</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns the week number and the year number as a +tuple. (TQt v3.1+) +</Para> +</Sect2> + +<Sect2><Title>TQDateTime</Title> +<Para> +<Literal>TQDateTime</Literal> is fully implemented, including the Python +<Literal>==</Literal>, <Literal>!=</Literal>, +<Literal><</Literal>, <Literal><=</Literal>, +<Literal>></Literal>, <Literal>>=</Literal> +and <Literal>__nonzero__</Literal> +operators. +</Para> +</Sect2> + +<Sect2><Title>TQTime</Title> +<Para> +<Literal>TQTime</Literal> is fully implemented, including the Python +<Literal>==</Literal>, <Literal>!=</Literal>, +<Literal><</Literal>, <Literal><=</Literal>, +<Literal>></Literal>, <Literal>>=</Literal> +and <Literal>__nonzero__</Literal> +operators. +</Para> +</Sect2> +%End + + +class TQDate +{ +%TypeHeaderCode +#include <tqdatetime.h> +%End + +public: + TQDate(); + TQDate(int,int,int); + + bool isNull() const; + bool isValid() const; + + int year() const; + int month() const; + int day() const; + int dayOfWeek() const; + int dayOfYear() const; + int daysInMonth() const; + int daysInYear() const; + + int weekNumber(int * = 0) const; + + static TQString shortMonthName(int); + static TQString shortDayName(int); + static TQString longMonthName(int); + static TQString longDayName(int); + + TQString toString(TQt::DateFormat = TQt::TextDate) const; + TQString toString(const TQString &) const; + bool setYMD(int,int,int); + TQDate addDays(int) const; + TQDate addMonths(int) const; + TQDate addYears(int) const; + int daysTo(const TQDate &) const; + + int __nonzero__() const; +%MethodCode + sipRes = !sipCpp -> isNull(); +%End + + bool operator==(const TQDate &) const; + bool operator!=(const TQDate &) const; + bool operator<(const TQDate &) const; + bool operator<=(const TQDate &) const; + bool operator>(const TQDate &) const; + bool operator>=(const TQDate &) const; + + static TQDate currentDate(); + static TQDate currentDate(TQt::TimeSpec); + static TQDate fromString(const TQString &,TQt::DateFormat = TQt::TextDate); + static bool isValid(int,int,int); + static bool leapYear(int); + + // These are defined in TQt3 but not documented. + //static uint gregorianToJulian(int,int,int); + //static void julianToGregorian(uint,int &,int &,int &); +}; + + +class TQTime +{ +%TypeHeaderCode +#include <tqdatetime.h> +%End + +public: + TQTime(); + TQTime(int,int,int = 0,int = 0); + + bool isNull() const; + bool isValid() const; + int hour() const; + int minute() const; + int second() const; + int msec() const; + + TQString toString(TQt::DateFormat = TQt::TextDate) const; + TQString toString(const TQString &) const; + + bool setHMS(int,int,int,int = 0); + + TQTime addSecs(int) const; + int secsTo(const TQTime &) const; + TQTime addMSecs(int) const; + int msecsTo(const TQTime &) const; + + int __nonzero__() const; +%MethodCode + sipRes = !sipCpp -> isNull(); +%End + + bool operator==(const TQTime &) const; + bool operator!=(const TQTime &) const; + bool operator<(const TQTime &) const; + bool operator<=(const TQTime &) const; + bool operator>(const TQTime &) const; + bool operator>=(const TQTime &) const; + + static TQTime currentTime(); + static TQTime currentTime(TQt::TimeSpec); + static TQTime fromString(const TQString &,TQt::DateFormat = TQt::TextDate); + static bool isValid(int,int,int,int = 0); + + void start(); + int restart(); + int elapsed() const; +}; + + +class TQDateTime +{ +%TypeHeaderCode +#include <tqdatetime.h> +%End + +public: + TQDateTime(); + TQDateTime(const TQDate &); + TQDateTime(const TQDate &,const TQTime &); + + bool isNull() const; + bool isValid() const; + + TQDate date() const; + TQTime time() const; + uint toTime_t() const; + void setDate(const TQDate &); + void setTime(const TQTime &); + void setTime_t(uint); + void setTime_t(uint,TQt::TimeSpec); + + TQString toString(TQt::DateFormat = TQt::TextDate) const; + TQString toString(const TQString &) const; + + TQDateTime addDays(int) const; + TQDateTime addMonths(int) const; + TQDateTime addYears(int) const; + TQDateTime addSecs(int) const; + int daysTo(const TQDateTime &) const; + int secsTo(const TQDateTime &) const; + + int __nonzero__() const; +%MethodCode + sipRes = !sipCpp -> isNull(); +%End + + bool operator==(const TQDateTime &) const; + bool operator!=(const TQDateTime &) const; + bool operator<(const TQDateTime &) const; + bool operator<=(const TQDateTime &) const; + bool operator>(const TQDateTime &) const; + bool operator>=(const TQDateTime &) const; + + static TQDateTime currentDateTime(); + static TQDateTime currentDateTime(TQt::TimeSpec); + static TQDateTime fromString(const TQString &, + TQt::DateFormat = TQt::TextDate); +}; diff --git a/sip/tqt/tqdatetimeedit.sip b/sip/tqt/tqdatetimeedit.sip new file mode 100644 index 0000000..c32fcef --- /dev/null +++ b/sip/tqt/tqdatetimeedit.sip @@ -0,0 +1,220 @@ +// This is the SIP interface definition for TQDateEdit, TQDateTimeEdit and +// TQTimeEdit. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQDateEdit (TQt v3+)</Title> +<Para> +<Literal>TQDateEdit</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQTimeEdit (TQt v3+)</Title> +<Para> +<Literal>TQTimeEdit</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQDateTimeEdit (TQt v3+)</Title> +<Para> +<Literal>TQDateTimeEdit</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +// TQDateEdit actually inherits TQDateTimeEditBase but that's an internal class +// and isn't exported under Windows in all versions. + +class TQDateEdit : TQWidget +{ +%TypeHeaderCode +#include <tqdatetimeedit.h> +%End + +public: + TQDateEdit(TQWidget * /TransferThis/ = 0,const char * = 0); + TQDateEdit(const TQDate &,TQWidget * /TransferThis/ = 0,const char * = 0); + + enum Order { + DMY, + MDY, + YMD, + YDM + }; + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + TQDate date() const; + virtual void setOrder(Order); + Order order() const; + virtual void setAutoAdvance(bool); + bool autoAdvance() const; + + virtual void setMinValue(const TQDate &); + TQDate minValue() const; + virtual void setMaxValue(const TQDate &); + TQDate maxValue() const; + virtual void setRange(const TQDate &,const TQDate &); + TQString separator() const; + virtual void setSeparator(const TQString &); + + void removeFirstNumber(int); + +public slots: + virtual void setDate(const TQDate &); + +signals: + void valueChanged(const TQDate &); + +protected: + bool event(TQEvent *); + void timerEvent(TQTimerEvent *); + void resizeEvent(TQResizeEvent *); + void stepUp(); + void stepDown(); + TQString sectionFormattedText(int); + void addNumber(int,int); + void removeLastNumber(int); + bool setFocusSection(int); + + virtual void setYear(int); + virtual void setMonth(int); + virtual void setDay(int); + virtual void fix(); + virtual bool outOfRange(int,int,int) const; + +protected slots: + void updateButtons(); + +private: + TQDateEdit(const TQDateEdit &); +}; + + +// TQDateEdit actually inherits TQDateTimeEditBase but that's an internal class +// and isn't exported under Windows in all versions. + +class TQTimeEdit : TQWidget +{ +%TypeHeaderCode +#include <tqdatetimeedit.h> +%End + +public: + enum Display { + Hours, + Minutes, + Seconds, + AMPM + }; + + TQTimeEdit(TQWidget * /TransferThis/ = 0,const char * = 0); + TQTimeEdit(const TQTime &,TQWidget * /TransferThis/ = 0,const char * = 0); + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + TQTime time() const; + virtual void setAutoAdvance(bool); + bool autoAdvance() const; + + virtual void setMinValue(const TQTime &); + TQTime minValue() const; + virtual void setMaxValue(const TQTime &); + TQTime maxValue() const; + virtual void setRange(const TQTime &,const TQTime &); + TQString separator() const; + virtual void setSeparator(const TQString &); + + uint display() const; + void setDisplay(uint); + + void removeFirstNumber(int); + +public slots: + virtual void setTime(const TQTime &); + +signals: + void valueChanged(const TQTime &); + +protected: + bool event(TQEvent *); + void timerEvent(TQTimerEvent *); + void resizeEvent(TQResizeEvent *); + void stepUp(); + void stepDown(); + TQString sectionFormattedText(int); + void addNumber(int,int); + void removeLastNumber(int); + bool setFocusSection(int); + + virtual bool outOfRange(int,int,int) const; + virtual void setHour(int); + virtual void setMinute(int); + virtual void setSecond(int); + +protected slots: + void updateButtons(); + +private: + TQTimeEdit(const TQTimeEdit &); +}; + + +class TQDateTimeEdit : TQWidget +{ +%TypeHeaderCode +#include <tqdatetimeedit.h> +%End + +public: + TQDateTimeEdit(TQWidget * /TransferThis/ = 0,const char * = 0); + TQDateTimeEdit(const TQDateTime &,TQWidget * /TransferThis/ = 0, + const char * = 0); + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + TQDateTime dateTime() const; + + TQDateEdit* dateEdit(); + TQTimeEdit* timeEdit(); + + virtual void setAutoAdvance(bool); + bool autoAdvance() const; + +public slots: + virtual void setDateTime(const TQDateTime &); + +signals: + void valueChanged(const TQDateTime &); + +protected: + void init(); + void resizeEvent(TQResizeEvent *); + +protected slots: + void newValue(const TQDate &); + void newValue(const TQTime &); + +private: + TQDateTimeEdit(const TQDateTimeEdit &); +}; diff --git a/sip/tqt/tqdesktopwidget.sip b/sip/tqt/tqdesktopwidget.sip new file mode 100644 index 0000000..ff8a3fa --- /dev/null +++ b/sip/tqt/tqdesktopwidget.sip @@ -0,0 +1,70 @@ +// This is the SIP interface definition for TQDesktopWidget. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQDesktopWidget (TQt v3+)</Title> +<Para> +<Literal>TQDesktopWidget</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQDesktopWidget : TQWidget +{ +%TypeHeaderCode +#include <tqdesktopwidget.h> +%End + +public: + TQDesktopWidget(); + + bool isVirtualDesktop() const; + + int numScreens() const; + int primaryScreen() const; + + int screenNumber(TQWidget * = 0) const; + int screenNumber(const TQPoint &) const; + + TQWidget *screen(int = -1); + + const TQRect &screenGeometry(int = -1) const; + const TQRect &screenGeometry(TQWidget *) const; + const TQRect &screenGeometry(const TQPoint &) const; + + const TQRect &availableGeometry(int = -1) const; + const TQRect &availableGeometry(TQWidget *) const; + const TQRect &availableGeometry(const TQPoint &) const; + + void insertChild(TQObject *); + +signals: + void resized(int); + void workAreaResized(int); + +protected: + void resizeEvent(TQResizeEvent *); + +private: + TQDesktopWidget(const TQDesktopWidget &); +}; diff --git a/sip/tqt/tqdial.sip b/sip/tqt/tqdial.sip new file mode 100644 index 0000000..d0f8913 --- /dev/null +++ b/sip/tqt/tqdial.sip @@ -0,0 +1,105 @@ +// This is the SIP interface definition for TQDial. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQDial (TQt v2.2+)</Title> +<Para> +<Literal>TQDial</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_DIAL) + +class TQDial : TQWidget, TQRangeControl +{ +%TypeHeaderCode +#include <tqdial.h> +%End + +public: + TQDial(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + TQDial(int,int,int,int,TQWidget * /TransferThis/ = 0,const char * = 0); + + bool tracking() const; + + bool wrapping() const; + + int notchSize() const; + + virtual void setNotchTarget(double); + double notchTarget() const; + + bool notchesVisible() const; + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + + int minValue() const; + int maxValue() const; + void setMinValue(int); + void setMaxValue(int); + int lineStep() const; + int pageStep() const; + void setLineStep(int); + void setPageStep(int); + int value() const; + +public slots: + virtual void setValue(int); + void addLine(); + void subtractLine(); + void addPage(); + void subtractPage(); + virtual void setNotchesVisible(bool); + virtual void setWrapping(bool); + virtual void setTracking(bool); + +signals: + void valueChanged(int); + void dialPressed(); + void dialMoved(int); + void dialReleased(); + +protected: + void resizeEvent(TQResizeEvent *); + void paintEvent(TQPaintEvent *); + + void keyPressEvent(TQKeyEvent *); + void mousePressEvent(TQMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); + void mouseMoveEvent(TQMouseEvent *); + void wheelEvent(TQWheelEvent *); + void focusInEvent(TQFocusEvent *); + void focusOutEvent(TQFocusEvent *); + + void valueChange(); + void rangeChange(); + + virtual void repaintScreen(const TQRect * = 0); + +private: + TQDial(const TQDial &); +}; + +%End diff --git a/sip/tqt/tqdialog.sip b/sip/tqt/tqdialog.sip new file mode 100644 index 0000000..aa26196 --- /dev/null +++ b/sip/tqt/tqdialog.sip @@ -0,0 +1,119 @@ +// This is the SIP interface definition for TQDialog. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQDialog</Title> +<FuncSynopsis> + <FuncDef>int <Function>exec</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>exec_loop</Literal> in Python. +</Para> +<Para> +This method also causes ownership of the underlying C++ dialog to be transfered +to Python. This means that the C++ dialog will be deleted when the Python +wrapper is garbage collected. Although this is a little inconsistent, it +ensures that the dialog is deleted without having to explicity code it using +<Literal>TQObject.deleteLater()</Literal> or other techniques. +</Para> +</Sect2> +%End + + +class TQDialog : TQWidget +{ +%TypeHeaderCode +#include <tqdialog.h> +%End + +public: + TQDialog(TQWidget * /TransferThis/ = 0,const char * = 0,bool = 0,WFlags = 0); + + enum DialogCode { + Rejected, + Accepted + }; + + int result() const; + + void show(); + void hide(); + void move(int,int); + void move(const TQPoint &); + void resize(int,int); + void resize(const TQSize &); + void setGeometry(int,int,int,int); + void setGeometry(const TQRect &); + + void setOrientation(Orientation); + Orientation orientation() const; + + void setExtension(TQWidget *); + TQWidget *extension() const; + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + + void setSizeGripEnabled(bool); + bool isSizeGripEnabled() const; + + void setModal(bool); + bool isModal() const; + +public slots: + int exec() /PyName=exec_loop, ReleaseGIL, + PreHook=__pyTQtPreEventLoopHook__, + PostHook=__pyTQtPostEventLoopHook__/; +%MethodCode + // Transfer ownership back to Python (a modal dialog will + // probably have the main window as it's parent). This means + // the TQt dialog will be deleted when the Python wrapper is + // garbage collected. Although this is a little inconsistent, + // it saves having to code it explicitly to avoid the memory + // leak. + sipTransferBack(sipSelf); + + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp->TQDialog::exec(); + Py_END_ALLOW_THREADS +%End + +protected slots: + virtual void done(int); + virtual void accept(); + virtual void reject(); + + void showExtension(bool); + +protected: + void setResult(int); + void keyPressEvent(TQKeyEvent *); + void closeEvent(TQCloseEvent *); + void resizeEvent(TQResizeEvent *); + void contextMenuEvent(TQContextMenuEvent *); + bool eventFilter(TQObject *,TQEvent *); + void adjustPosition(TQWidget *); + +private: + TQDialog(const TQDialog &); +}; diff --git a/sip/tqt/tqdir.sip b/sip/tqt/tqdir.sip new file mode 100644 index 0000000..1d4c8db --- /dev/null +++ b/sip/tqt/tqdir.sip @@ -0,0 +1,292 @@ +// This is the SIP interface definition for TQDir and TQFileInfoList. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQDir</Title> +<Para> +<Literal>TQDir</Literal> is fully implemented, including the Python +<Literal>len</Literal>, <Literal>[]</Literal> (for reading slices and +individual elements), <Literal>==</Literal>, <Literal>!=</Literal> and +<Literal>in</Literal> operators +</Para> +</Sect2> + +<Sect2><Title>TQFileInfoList</Title> +<Para> +This class isn't implemented. Whenever a <Literal>TQFileInfoList</Literal> is +the return type of a function or the type of an argument, a Python list of +<Literal>TQFileInfo</Literal> instances is used instead. +</Para> +</Sect2> +%End + + +%MappedType TQFileInfoList +{ +%TypeHeaderCode +#include <tqdir.h> +%End + +%ConvertFromTypeCode + PyObject *pl; + TQFileInfo *obj; + + // Convert the list. + + if ((pl = PyList_New(0)) == NULL) + return NULL; + + for (TQFileInfoListIterator it(*sipCpp); (obj = it.current()) != NULL; ++it) + { + PyObject *inst; + + if ((inst = sipConvertFromInstance(obj,sipClass_TQFileInfo,sipTransferObj)) == NULL || PyList_Append(pl,inst) < 0) + { + Py_XDECREF(inst); + Py_DECREF(pl); + + return NULL; + } + + Py_DECREF(inst); + } + + return pl; +%End + +%ConvertToTypeCode + // Convert a Python list of TQFileInfo instances to a TQFileInfoList on + // the heap. + + if (sipIsErr == NULL) + { + if (!PyList_Check(sipPy)) + return 0; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_TQFileInfo,0)) + return 0; + + return 1; + } + + TQFileInfoList *qfil = new TQFileInfoList; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + TQFileInfo *qfi; + + // We apply the transfer to the list itself, not the elements. + // Note that any temporary element will never be destroyed. + // There is nothing that can be done about this. + qfi = reinterpret_cast<TQFileInfo *>(sipConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_TQFileInfo,0,0,0,sipIsErr)); + + if (*sipIsErr) + { + delete qfil; + return 0; + } + + qfil -> append(qfi); + } + + *sipCppPtr = qfil; + + return sipGetState(sipTransferObj); +%End +}; + + +class TQDir +{ +%TypeHeaderCode +#include <tqdir.h> +%End + +public: + enum FilterSpec { + Dirs, + Files, + Drives, + NoSymLinks, + All, + TypeMask, + + Readable, + Writable, + Executable, + RWEMask, + + Modified, + Hidden, + System, + AccessMask, + + DefaultFilter + }; + + enum SortSpec { + Name, + Time, + Size, + Unsorted, + SortByMask, + + DirsFirst, + Reversed, + IgnoreCase, + DefaultSort + }; + + TQDir(); + TQDir(const TQString &,const TQString & = TQString::null, + int = Name | IgnoreCase,int = All); + TQDir(const TQDir &); + + virtual void setPath(const TQString &); + virtual TQString path() const; + virtual TQString absPath() const; + virtual TQString canonicalPath() const; + + virtual TQString dirName() const; + virtual TQString filePath(const TQString &,bool = 1) const; + virtual TQString absFilePath(const TQString &,bool = 1) const; + + static TQString convertSeparators(const TQString &); + + virtual bool cd(const TQString &,bool = 1); + virtual bool cdUp(); + + TQString nameFilter() const; + virtual void setNameFilter(const TQString &); + FilterSpec filter() const; + virtual void setFilter(int); + SortSpec sorting() const; + virtual void setSorting(int); + + bool matchAllDirs() const; + virtual void setMatchAllDirs(bool); + + uint count() const; + + int __len__() const; +%MethodCode + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp -> count(); + Py_END_ALLOW_THREADS +%End + + TQString operator[](int) const; +%MethodCode + int len; + + Py_BEGIN_ALLOW_THREADS + len = sipCpp -> count(); + Py_END_ALLOW_THREADS + + if ((a0 = (int)sipConvertFromSequenceIndex(a0,len)) < 0) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipRes = new TQString((*sipCpp)[a0]); + Py_END_ALLOW_THREADS + } +%End + + TQStringList operator[](SIP_PYSLICE) const; +%MethodCode + Py_ssize_t len, start, stop, step, slicelength, i; + + Py_BEGIN_ALLOW_THREADS + len = sipCpp -> count(); + Py_END_ALLOW_THREADS + + if (sipConvertFromSliceObject(a0,len,&start,&stop,&step,&slicelength) < 0) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipRes = new TQStringList(); + + for (i = 0; i < slicelength; ++i) + { + (*sipRes) += (*sipCpp)[start]; + start += step; + } + Py_END_ALLOW_THREADS + } +%End + + int __contains__(const TQString &) const; +%MethodCode + Py_BEGIN_ALLOW_THREADS + sipRes = (sipCpp -> entryList().findIndex(*a0) >= 0); + Py_END_ALLOW_THREADS +%End + + virtual TQStrList encodedEntryList(int = DefaultFilter, + int = DefaultSort) const; + virtual TQStrList encodedEntryList(const TQString &,int = DefaultFilter, + int = DefaultSort) const; + virtual TQStringList entryList(int = DefaultFilter, + int = DefaultSort) const; + virtual TQStringList entryList(const TQString &,int = DefaultFilter, + int = DefaultSort) const; + virtual const TQFileInfoList *entryInfoList(int = DefaultFilter, + int = DefaultSort) const; + virtual const TQFileInfoList *entryInfoList(const TQString &, + int = DefaultFilter, + int = DefaultSort) const; + + static const TQFileInfoList *drives(); + + virtual bool mkdir(const TQString &,bool = 1) const; + virtual bool rmdir(const TQString &,bool = 1) const; + + virtual bool isReadable() const; + virtual bool exists() const; + virtual bool isRoot() const; + + virtual bool isRelative() const; + virtual void convertToAbs(); + + virtual bool remove(const TQString &,bool = 1); + virtual bool rename(const TQString &,const TQString &,bool = 1); + virtual bool exists(const TQString &,bool = 1); + + static char separator(); + + static bool setCurrent(const TQString &); + static TQDir current(); + static TQDir home(); + static TQDir root(); + static TQString currentDirPath(); + static TQString homeDirPath(); + static TQString rootDirPath(); + + static bool match(const TQStringList &,const TQString &); + static bool match(const TQString &,const TQString &); + static TQString cleanDirPath(const TQString &); + static bool isRelativePath(const TQString &); + void refresh() const; +}; diff --git a/sip/tqt/tqdockarea.sip b/sip/tqt/tqdockarea.sip new file mode 100644 index 0000000..7c01b85 --- /dev/null +++ b/sip/tqt/tqdockarea.sip @@ -0,0 +1,84 @@ +// This is the SIP interface definition for TQDockArea. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQDockArea (TQt v3+)</Title> +<FuncSynopsis> + <FuncDef>bool <Function>hasDockWindow</Function> const</FuncDef> + <ParamDef>TQDockWindow *<Parameter>w</Parameter></ParamDef> + <ParamDef>int *<Parameter>index</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>w</Literal> parameter and returns the index of the +TQDockWIndow or -1 if the TQDockArea does not contain the TQDockWindow. +</Para> +</Sect2> +%End + + +class TQDockArea : TQWidget +{ +%TypeHeaderCode +#include <tqdockarea.h> +%End + +public: + enum HandlePosition { + Normal, + Reverse + }; + + TQDockArea(Orientation,HandlePosition = Normal, + TQWidget * /TransferThis/ = 0,const char * = 0); + + void moveDockWindow(TQDockWindow *,const TQPoint &,const TQRect &,bool); + void removeDockWindow(TQDockWindow *,bool,bool,bool = 1); + void moveDockWindow(TQDockWindow *,int = -1); + + int hasDockWindow(TQDockWindow *); +%MethodCode + // The Python interface returns the index. + + Py_BEGIN_ALLOW_THREADS + sipCpp -> TQDockArea::hasDockWindow(a0,&sipRes); + Py_END_ALLOW_THREADS +%End + + void invalidNextOffset(TQDockWindow *); + + Orientation orientation() const; + HandlePosition handlePosition() const; + + bool eventFilter(TQObject *,TQEvent *); + bool isEmpty() const; + int count() const; + TQPtrList<TQDockWindow> dockWindowList() const; + + bool isDockWindowAccepted(TQDockWindow *); + void setAcceptDockWindow(TQDockWindow *,bool); + +public slots: + void lineUp(bool); + +private: + TQDockArea(const TQDockArea &); +}; diff --git a/sip/tqt/tqdockwindow.sip b/sip/tqt/tqdockwindow.sip new file mode 100644 index 0000000..1f078aa --- /dev/null +++ b/sip/tqt/tqdockwindow.sip @@ -0,0 +1,125 @@ +// This is the SIP interface definition for TQDockWindow. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQDockWindow (TQt v3+)</Title> +<Para> +<Literal>TQDockWindow</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQDockWindow : TQFrame +{ +%TypeHeaderCode +#include <tqdockwindow.h> +%End + +public: + enum Place { + InDock, + OutsideDock + }; + + enum CloseMode { + Never, + Docked, + Undocked, + Always + }; + + TQDockWindow(Place = InDock,TQWidget * /TransferThis/ = 0, + const char * = 0,WFlags = 0); + TQDockWindow(TQWidget * /TransferThis/,const char * = 0,WFlags = 0); + + virtual void setWidget(TQWidget *); + TQWidget *widget() const; + + Place place() const; + + TQDockArea *area() const; + + virtual void setCloseMode(int); + bool isCloseEnabled() const; + int closeMode() const; + + virtual void setResizeEnabled(bool); + virtual void setMovingEnabled(bool); + bool isResizeEnabled() const; + bool isMovingEnabled() const; + + virtual void setHorizontallyStretchable(bool); + virtual void setVerticallyStretchable(bool); + bool isHorizontallyStretchable() const; + bool isVerticallyStretchable() const; + bool isStretchable() const; + + virtual void setOffset(int); + int offset() const; + + virtual void setFixedExtentWidth(int); + virtual void setFixedExtentHeight(int); + TQSize fixedExtent() const; + + virtual void setNewLine(bool); + bool newLine() const; + + TQt::Orientation orientation() const; + + TQSize sizeHint() const; + TQSize minimumSize() const; + TQSize minimumSizeHint() const; + + TQBoxLayout *boxLayout(); + + virtual void setOpaqueMoving(bool); + bool opaqueMoving() const; + + bool eventFilter(TQObject *,TQEvent *); + +signals: + void orientationChanged(Orientation); + void placeChanged(TQDockWindow::Place); + void visibilityChanged(bool); + +public slots: + virtual void undock(TQWidget *); + virtual void undock(); + virtual void dock(); + virtual void setOrientation(Orientation); + void setCaption(const TQString &); + +protected: + void resizeEvent(TQResizeEvent *); + void showEvent(TQShowEvent *); + void hideEvent(TQHideEvent *); + void contextMenuEvent(TQContextMenuEvent *); + + void drawFrame(TQPainter *); + void drawContents(TQPainter *); + + bool event(TQEvent *); + +private: + TQDockWindow(const TQDockWindow &); +}; diff --git a/sip/tqt/tqdragobject.sip b/sip/tqt/tqdragobject.sip new file mode 100644 index 0000000..da9e266 --- /dev/null +++ b/sip/tqt/tqdragobject.sip @@ -0,0 +1,231 @@ +// This is the SIP interface definition for TQDragObject, TQImageDrag, +// TQStoredDrag, TQTextDrag, TQUriDrag, TQUrlDrag, TQColorDrag. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +%DefaultEncoding "UTF-8" + +%ExportedDoc +<Sect2><Title>TQColorDrag (TQt v2.1+)</Title> +<Para> +<Literal>TQColorDrag</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQDragObject</Title> +<Para> +<Literal>TQDragObject</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQImageDrag</Title> +<Para> +<Literal>TQImageDrag</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQStoredDrag</Title> +<Para> +<Literal>TQStoredDrag</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQTextDrag</Title> +<Para> +<Literal>TQTextDrag</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQUriDrag (TQt v2+)</Title> +<Para> +<Literal>TQUriDrag</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQUrlDrag (TQt v1.x)</Title> +<Para> +<Literal>TQUrlDrag</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQDragObject : TQObject, TQMimeSource +{ +%TypeHeaderCode +#include <tqdragobject.h> +%End + +public: + TQDragObject(TQWidget * /TransferThis/ = 0,const char * = 0); + +%If (TQt_DRAGANDDROP) + bool drag(); + bool dragMove(); + void dragCopy(); + void dragLink(); + + virtual void setPixmap(TQPixmap); + virtual void setPixmap(TQPixmap,const TQPoint &); + TQPixmap pixmap() const; + TQPoint pixmapHotSpot() const; +%End + + TQWidget *source(); + static TQWidget *target(); + + static void setTarget(TQWidget *); + +%If (TQt_DRAGANDDROP) + enum DragMode { + DragDefault, + DragCopy, + DragMove, + DragLink, + DragCopyOrMove + }; +%End + +protected: +%If (TQt_DRAGANDDROP) + virtual bool drag(DragMode); +%End + +private: + TQDragObject(const TQDragObject &); +}; + + +class TQStoredDrag : TQDragObject +{ +%TypeHeaderCode +#include <tqdragobject.h> +%End + +public: + TQStoredDrag(const char *,TQWidget * /TransferThis/ = 0,const char * = 0); + + virtual void setEncodedData(const TQByteArray&); + + const char *format(int) const; + virtual TQByteArray encodedData(const char *) const; + +private: + TQStoredDrag(const TQStoredDrag &); +}; + + +class TQTextDrag : TQDragObject +{ +%TypeHeaderCode +#include <tqdragobject.h> +%End + +public: + TQTextDrag(const TQString &,TQWidget * /TransferThis/ = 0, + const char * = 0); + TQTextDrag(TQWidget * /TransferThis/ = 0,const char * = 0); + + virtual void setText(const TQString &); + virtual void setSubtype(const TQCString &); + + const char *format(int) const; + virtual TQByteArray encodedData(const char *) const; + + static bool canDecode(const TQMimeSource *); + static bool decode(const TQMimeSource *,TQString &); + static bool decode(const TQMimeSource *,TQString &,TQCString &); + +private: + TQTextDrag(const TQTextDrag &); +}; + + +class TQImageDrag : TQDragObject +{ +%TypeHeaderCode +#include <tqdragobject.h> +%End + +public: + TQImageDrag(TQImage,TQWidget * /TransferThis/ = 0,const char * = 0); + TQImageDrag(TQWidget * /TransferThis/ = 0,const char * = 0); + + virtual void setImage(TQImage); + + const char *format(int) const; + virtual TQByteArray encodedData(const char *) const; + + static bool canDecode(const TQMimeSource *); + static bool decode(const TQMimeSource *,TQImage &); + static bool decode(const TQMimeSource *,TQPixmap &); + +private: + TQImageDrag(const TQImageDrag &); +}; + + +class TQUriDrag : TQStoredDrag +{ +%TypeHeaderCode +#include <tqdragobject.h> +%End + +public: + TQUriDrag(TQStrList,TQWidget * /TransferThis/ = 0,const char * = 0); + TQUriDrag(TQWidget * /TransferThis/ = 0,const char * = 0); + + void setFileNames(const TQStringList &); + void setUnicodeUris(const TQStringList &); + virtual void setUris(TQStrList); + + static TQString uriToLocalFile(const char *); + static TQCString localFileToUri(const TQString &); + static TQString uriToUnicodeUri(const char *); + static TQCString unicodeUriToUri(const TQString &); + static bool canDecode(const TQMimeSource *); + static bool decode(const TQMimeSource *,TQStrList &); + static bool decodeToUnicodeUris(const TQMimeSource *,TQStringList &); + static bool decodeLocalFiles(const TQMimeSource *,TQStringList &); + +private: + TQUriDrag(const TQUriDrag &); +}; + + +class TQColorDrag : TQStoredDrag +{ +%TypeHeaderCode +#include <tqdragobject.h> +%End + +public: + TQColorDrag(const TQColor &,TQWidget * /TransferThis/ = 0, + const char * = 0); + TQColorDrag(TQWidget * /TransferThis/ = 0,const char * = 0); + + void setColor(const TQColor &); + + static bool canDecode(TQMimeSource *); + static bool decode(TQMimeSource *,TQColor &); + +private: + TQColorDrag(const TQColorDrag &); +}; diff --git a/sip/tqt/tqdrawutil.sip b/sip/tqt/tqdrawutil.sip new file mode 100644 index 0000000..34e3033 --- /dev/null +++ b/sip/tqt/tqdrawutil.sip @@ -0,0 +1,56 @@ +// This is the SIP interface definition for the TQt drawing utilities. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ModuleHeaderCode +#include <tqdrawutil.h> +%End + + +void qDrawShadeLine(TQPainter *,int,int,int,int,const TQColorGroup &,bool = 1, + int = 1,int = 0); +void qDrawShadeLine(TQPainter *,const TQPoint &,const TQPoint &, + const TQColorGroup &,bool = 1,int = 1,int = 0); + +void qDrawShadeRect(TQPainter *,int,int,int,int,const TQColorGroup &,bool = 0, + int = 1,int = 0,const TQBrush * = 0); +void qDrawShadeRect(TQPainter *,const TQRect &,const TQColorGroup &,bool = 0, + int = 1,int = 0,const TQBrush * = 0); + +void qDrawShadePanel(TQPainter *,int,int,int,int,const TQColorGroup &,bool = 0, + int = 1,const TQBrush * = 0); +void qDrawShadePanel(TQPainter *,const TQRect &,const TQColorGroup &,bool = 0, + int = 1,const TQBrush * = 0); + +void qDrawWinButton(TQPainter *,int,int,int,int,const TQColorGroup &,bool = 0, + const TQBrush * = 0); +void qDrawWinButton(TQPainter *,const TQRect &,const TQColorGroup &,bool = 0, + const TQBrush * = 0); + +void qDrawWinPanel(TQPainter *,int,int,int,int,const TQColorGroup &,bool = 0, + const TQBrush * = 0); +void qDrawWinPanel(TQPainter *,const TQRect &,const TQColorGroup &,bool = 0, + const TQBrush * = 0); + +void qDrawPlainRect(TQPainter *,int,int,int,int,const TQColor &,int = 1, + const TQBrush * = 0); +void qDrawPlainRect(TQPainter *,const TQRect &,const TQColor &,int = 1, + const TQBrush * = 0); diff --git a/sip/tqt/tqdropsite.sip b/sip/tqt/tqdropsite.sip new file mode 100644 index 0000000..dd216a9 --- /dev/null +++ b/sip/tqt/tqdropsite.sip @@ -0,0 +1,44 @@ +// This is the SIP interface definition for TQDropSite. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQDropSite</Title> +<Para> +<Literal>TQDropSite</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_DRAGANDDROP) + +class TQDropSite +{ +%TypeHeaderCode +#include <tqdropsite.h> +%End + +public: + TQDropSite(TQWidget *); +}; + +%End diff --git a/sip/tqt/tqerrormessage.sip b/sip/tqt/tqerrormessage.sip new file mode 100644 index 0000000..b6eb433 --- /dev/null +++ b/sip/tqt/tqerrormessage.sip @@ -0,0 +1,51 @@ +// This is the SIP interface definition for TQErrorMessage. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQErrorMessage (TQt v3+)</Title> +<Para> +<Literal>TQErrorMessage</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQErrorMessage : TQDialog +{ +%TypeHeaderCode +#include <tqerrormessage.h> +%End + +public: + TQErrorMessage(TQWidget * /TransferThis/,const char * = 0); + + static TQErrorMessage *qtHandler(); + +public slots: + void message(const TQString &); + +protected: + void done(int); + +private: + TQErrorMessage(const TQErrorMessage &); +}; diff --git a/sip/tqt/tqevent.sip b/sip/tqt/tqevent.sip new file mode 100644 index 0000000..7fa9592 --- /dev/null +++ b/sip/tqt/tqevent.sip @@ -0,0 +1,857 @@ +// This is the SIP interface definition for TQEvent, TQChildEvent, TQCloseEvent, +// TQIconDragEvent, TQContextMenuEvent, TQCustomEvent, TQDragEnterEvent, +// TQDragLeaveEvent, TQDragMoveEvent, TQDropEvent, TQFocusEvent, TQHideEvent, +// TQIMEvent, TQIMComposeEvent, TQKeyEvent, TQMouseEvent, TQMoveEvent, TQPaintEvent, +// TQResizeEvent, TQShowEvent, TQTabletEvent, TQTimerEvent, TQWheelEvent. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQEvent</Title> +<Para> +<Literal>TQEvent</Literal> is fully implemented. +</Para> +<Para> +Instances of <Literal>TQEvent</Literal>s are automatically converted to the +correct sub-class. +</Para> +</Sect2> + +<Sect2><Title>TQChildEvent</Title> +<Para> +<Literal>TQChildEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQCloseEvent</Title> +<Para> +<Literal>TQCloseEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQIconDragEvent (TQt v3.3+)</Title> +<Para> +<Literal>TQIconDragEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQContextMenuEvent (TQt v3+)</Title> +<Para> +<Literal>TQContextMenuEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQCustomEvent</Title> +<Para> +<Literal>TQCustomEvent</Literal> is fully implemented. Any Python object can be +passed as the event data and its reference count is increased. +</Para> +</Sect2> + +<Sect2><Title>TQDragEnterEvent</Title> +<Para> +<Literal>TQDragEnterEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQDragLeaveEvent</Title> +<Para> +<Literal>TQDragLeaveEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQDragMoveEvent</Title> +<Para> +<Literal>TQDragMoveEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQDropEvent</Title> +<Para> +<Literal>TQDropEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQFocusEvent</Title> +<Para> +<Literal>TQFocusEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQHideEvent</Title> +<Para> +<Literal>TQHideEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQIMComposeEvent (TQt v3.1+)</Title> +<Para> +<Literal>TQIMComposeEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQIMEvent (TQt v3+)</Title> +<Para> +<Literal>TQIMEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQKeyEvent</Title> +<Para> +<Literal>TQKeyEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQMouseEvent</Title> +<Para> +<Literal>TQMouseEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQMoveEvent</Title> +<Para> +<Literal>TQMoveEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQPaintEvent</Title> +<Para> +<Literal>TQPaintEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQResizeEvent</Title> +<Para> +<Literal>TQResizeEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQShowEvent</Title> +<Para> +<Literal>TQShowEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQTabletEvent (TQt v3+)</Title> +<Para> +<Literal>TQTabletEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQTimerEvent</Title> +<Para> +<Literal>TQTimerEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQWheelEvent (TQt v2+)</Title> +<Para> +<Literal>TQWheelEvent</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%ModuleHeaderCode +#include <tqevent.h> +%End + + +class TQEvent : TQt +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + enum Type + { + None, + Timer, + MouseButtonPress, + MouseButtonRelease, + MouseButtonDblClick, + MouseMove, + KeyPress, + KeyRelease, + FocusIn, + FocusOut, + Enter, + Leave, + Paint, + Move, + Resize, + Create, + Destroy, + Show, + Hide, + Close, + Quit, + Reparent, + ShowMinimized, + ShowNormal, + WindowActivate, + WindowDeactivate, + ShowToParent, + HideToParent, + ShowMaximized, + ShowFullScreen, + Accel, + Wheel, + AccelAvailable, + CaptionChange, + IconChange, + ParentFontChange, + ApplicationFontChange, + ParentPaletteChange, + ApplicationPaletteChange, + PaletteChange, + Clipboard, + Speech, + SockAct, + AccelOverride, + DeferredDelete, + DragEnter, + DragMove, + DragLeave, + Drop, + DragResponse, + ChildInserted, + ChildRemoved, + LayoutHint, + ShowWindowRequest, + WindowBlocked, + WindowUnblocked, + ActivateControl, + DeactivateControl, + ContextMenu, + IMStart, + IMCompose, + IMEnd, + Accessibility, + TabletMove, + LocaleChange, + LanguageChange, + LayoutDirectionChange, + Style, + TabletPress, + TabletRelease, + OkRequest, + HelpRequest, + IconDrag, + WindowStateChange, + User, + MaxUser, + }; + + TQEvent(Type); + TQEvent(TQEvent&); + virtual ~TQEvent(); + + Type type() const; + bool spontaneous() const; + +%ConvertToSubClassCode + switch (sipCpp -> type()) + { + case TQEvent::Timer: + sipClass = sipClass_TQTimerEvent; + break; + + case TQEvent::MouseButtonPress: + case TQEvent::MouseButtonRelease: + case TQEvent::MouseButtonDblClick: + case TQEvent::MouseMove: + sipClass = sipClass_TQMouseEvent; + break; + + case TQEvent::Accel: + case TQEvent::AccelOverride: + case TQEvent::KeyPress: + case TQEvent::KeyRelease: + sipClass = sipClass_TQKeyEvent; + break; + + case TQEvent::FocusIn: + case TQEvent::FocusOut: + sipClass = sipClass_TQFocusEvent; + break; + + case TQEvent::Paint: + sipClass = sipClass_TQPaintEvent; + break; + + case TQEvent::Move: + sipClass = sipClass_TQMoveEvent; + break; + + case TQEvent::Resize: + sipClass = sipClass_TQResizeEvent; + break; + + case TQEvent::Close: + sipClass = sipClass_TQCloseEvent; + break; + + case TQEvent::IconDrag: + sipClass = sipClass_TQIconDragEvent; + break; + + case TQEvent::Wheel: + sipClass = sipClass_TQWheelEvent; + break; + + case TQEvent::Show: + sipClass = sipClass_TQShowEvent; + break; + + case TQEvent::Hide: + sipClass = sipClass_TQHideEvent; + break; + +#if defined(SIP_FEATURE_TQt_DRAGANDDROP) + case TQEvent::DragMove: + sipClass = sipClass_TQDragMoveEvent; + break; + + case TQEvent::DragEnter: + sipClass = sipClass_TQDragEnterEvent; + break; + + case TQEvent::DragLeave: + sipClass = sipClass_TQDragLeaveEvent; + break; + + case TQEvent::Drop: + sipClass = sipClass_TQDropEvent; + break; +#endif + + case TQEvent::ChildInserted: + case TQEvent::ChildRemoved: + sipClass = sipClass_TQChildEvent; + break; + + case TQEvent::ContextMenu: + sipClass = sipClass_TQContextMenuEvent; + break; + + case TQEvent::IMStart: + case TQEvent::IMEnd: + sipClass = sipClass_TQIMEvent; + break; + + case TQEvent::IMCompose: + sipClass = sipClass_TQIMComposeEvent; + break; + + case TQEvent::TabletMove: + case TQEvent::TabletPress: + case TQEvent::TabletRelease: + sipClass = sipClass_TQTabletEvent; + break; + + default: + sipClass = (sipCpp -> type() < TQEvent::User ? + sipClass_TQEvent : + sipClass_TQCustomEvent); + } +%End +}; + + +class TQTimerEvent : TQEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQTimerEvent(int); + + int timerId() const; +}; + + +class TQMouseEvent : TQEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQMouseEvent(Type,const TQPoint &,int,int); + TQMouseEvent(Type,const TQPoint &,const TQPoint &,int,int); + + const TQPoint &pos() const; + const TQPoint &globalPos() const; + int x() const; + int y() const; + int globalX() const; + int globalY() const; + ButtonState button() const; + ButtonState state() const; + ButtonState stateAfter() const; + bool isAccepted() const; + void accept(); + void ignore(); +}; + + +class TQWheelEvent : TQEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQWheelEvent(const TQPoint &,int,int,Orientation = Vertical); + TQWheelEvent(const TQPoint &,const TQPoint &,int,int, + Orientation = Vertical); + + int delta() const; + const TQPoint &pos() const; + const TQPoint &globalPos() const; + int x() const; + int y() const; + int globalX() const; + int globalY() const; + ButtonState state() const; + Orientation orientation() const; + bool isAccepted() const; + void accept(); + void ignore(); +}; + + +class TQTabletEvent : TQEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + enum TabletDevice { + NoDevice, + Puck, + Stylus, + Eraser + }; + + TQTabletEvent(Type,const TQPoint &,const TQPoint &,int,int,int,int, + const TQPair<int,int> &); + TQTabletEvent(const TQPoint &,const TQPoint &,int,int,int,int, + const TQPair<int,int> &); + + int pressure() const; + int xTilt() const; + int yTilt() const; + const TQPoint &pos() const; + const TQPoint &globalPos() const; + int x() const; + int y() const; + int globalX() const; + int globalY() const; + TabletDevice device() const; + int isAccepted() const; + void accept(); + void ignore(); + TQPair<int,int> uniqueId(); +}; + + +class TQKeyEvent : TQEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQKeyEvent(Type,int,int,int,const TQString & = TQString::null,bool = 0, + ushort = 1); + + int key() const; + int ascii() const; + bool isAccepted() const; + void accept(); + void ignore(); + + ButtonState state() const; + ButtonState stateAfter() const; + TQString text() const; + bool isAutoRepeat() const; + int count() const; +}; + + +class TQFocusEvent : TQEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQFocusEvent(Type); + + bool gotFocus() const; + bool lostFocus() const; + + enum Reason { + Mouse, + Tab, + Backtab, + ActiveWindow, + Popup, + Shortcut, + Other + }; + + static Reason reason(); + static void setReason(Reason); + static void resetReason(); +}; + + +class TQPaintEvent : TQEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQPaintEvent(const TQRegion &,bool = 1); + TQPaintEvent(const TQRect &,bool = 1); + TQPaintEvent(const TQRegion &,const TQRect &,bool = 1); + + const TQRect &rect() const; + const TQRegion ®ion() const; + bool erased() const; +}; + + +class TQMoveEvent : TQEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQMoveEvent(const TQPoint &,const TQPoint &); + + const TQPoint &pos() const; + const TQPoint &oldPos() const; +}; + + +class TQResizeEvent : TQEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQResizeEvent(const TQSize &,const TQSize &); + + const TQSize &size() const; + const TQSize &oldSize() const; +}; + + +class TQCloseEvent : TQEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQCloseEvent(); + + bool isAccepted() const; + void accept(); + void ignore(); +}; + + +class TQIconDragEvent : TQEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQIconDragEvent(); + + bool isAccepted() const; + void accept(); + void ignore(); +}; + + +class TQShowEvent : TQEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQShowEvent(); +}; + + +class TQHideEvent : TQEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQHideEvent(); +}; + + +class TQContextMenuEvent : TQEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + enum Reason { + Mouse, + Keyboard, + Other + }; + + TQContextMenuEvent(Reason,const TQPoint &,const TQPoint &,int); + TQContextMenuEvent(Reason,const TQPoint &,int); + + int x() const; + int y() const; + int globalX() const; + int globalY() const; + + const TQPoint &pos() const; + const TQPoint &globalPos() const; + + ButtonState state() const; + bool isAccepted() const; + bool isConsumed() const; + void consume(); + void accept(); + void ignore(); + Reason reason() const; +}; + + +class TQIMEvent : TQEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQIMEvent(Type,const TQString &,int); + + const TQString &text() const; + int cursorPos() const; + bool isAccepted() const; + void accept(); + void ignore(); + int selectionLength() const; +}; + + +class TQIMComposeEvent : TQIMEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQIMComposeEvent(Type,const TQString &,int,int); +}; + + +%If (TQt_DRAGANDDROP) + +class TQDropEvent : TQEvent, TQMimeSource +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQDropEvent(const TQPoint &,Type = Drop); + + const TQPoint &pos() const; + bool isAccepted() const; + void accept(bool = 1); + void ignore(); + bool isActionAccepted() const; + void acceptAction(bool = 1); + + enum Action + { + Copy, + Link, + Move, + Private, + UserAction = 100 + }; + + void setAction(Action); + Action action() const; + TQWidget *source() const; + const char *format(int = 0) const; + TQByteArray encodedData(const char *) const; + bool provides(const char *) const; + TQByteArray data(const char *) const; + void setPoint(const TQPoint &); +}; + +%End + + +%If (TQt_DRAGANDDROP) + +class TQDragMoveEvent : TQDropEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQDragMoveEvent(const TQPoint &,Type = DragMove); + + TQRect answerRect() const; + void accept(bool = 1); + void accept(const TQRect &); + void ignore(const TQRect &); + void ignore(); +}; + + +class TQDragEnterEvent : TQDragMoveEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQDragEnterEvent(const TQPoint &); +}; + + +class TQDragLeaveEvent : TQEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQDragLeaveEvent(); +}; + +%End + + +class TQChildEvent : TQEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQChildEvent(Type,TQObject *); + + TQObject *child() const; + bool inserted() const; + bool removed() const; +}; + + +class TQCustomEvent : TQEvent +{ +%TypeHeaderCode +#include <tqevent.h> +%End + +public: + TQCustomEvent(Type,SIP_PYOBJECT /Transfer/); + TQCustomEvent(int); + ~TQCustomEvent(); +%VirtualCatcherCode + // We need to garbage collect any current data. + + PyObject *old = reinterpret_cast<PyObject *>(data()); + + SIP_BLOCK_THREADS + Py_XDECREF(old); + SIP_UNBLOCK_THREADS +%End + + SIP_PYOBJECT data() const; +%MethodCode + // We need to cast the result. + + sipRes = reinterpret_cast<PyObject *>(sipCpp -> TQCustomEvent::data()); + + // In case the event has been created from C++ code. + if (!sipRes) + sipRes = Py_None; + + Py_INCREF(sipRes); +%End + + void setData(SIP_PYOBJECT /Transfer/); +%MethodCode + // We need to garbage collect any current data. + + PyObject *old = reinterpret_cast<PyObject *>(sipCpp -> TQCustomEvent::data()); + sipCpp -> TQCustomEvent::setData(a0); + + Py_XDECREF(old); +%End + +%GCTraverseCode + // Support the Python garbage collector. Although it's not obviously + // documented, we can't release the GIL in traverse code. + + PyObject *obj = reinterpret_cast<PyObject *>(sipCpp -> TQCustomEvent::data()); + + if (obj) + sipRes = sipVisit(obj, sipArg); + else + sipRes = 0; +%End + +%GCClearCode + // Support the Python garbage collector. + + PyObject *obj = reinterpret_cast<PyObject *>(sipCpp -> TQCustomEvent::data()); + + sipCpp -> TQCustomEvent::setData(0); + + Py_XDECREF(obj); + + sipRes = 0; +%End +}; diff --git a/sip/tqt/tqeventloop.sip b/sip/tqt/tqeventloop.sip new file mode 100644 index 0000000..2146996 --- /dev/null +++ b/sip/tqt/tqeventloop.sip @@ -0,0 +1,83 @@ +// This is the SIP interface definition for TQEventLoop. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQEventLoop (TQt v3.1+)</Title> +<FuncSynopsis> + <FuncDef>virtual int <Function>exec</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>exec_loop</Literal> in Python. +</Para> +</Sect2> +%End + + +class TQEventLoop : TQObject +{ +%TypeHeaderCode +#include <tqeventloop.h> +%End + +public: + TQEventLoop(TQObject * /TransferThis/ = 0,const char * = 0); + + enum ProcessEvents { + AllEvents, + ExcludeUserInput, + ExcludeSocketNotifiers, + WaitForMore + }; + + typedef uint ProcessEventsFlags; + + void processEvents(ProcessEventsFlags,int) /ReleaseGIL/; + virtual bool processEvents(ProcessEventsFlags) /ReleaseGIL/; + + virtual bool hasPendingEvents() const; + + virtual void registerSocketNotifier(TQSocketNotifier *); + virtual void unregisterSocketNotifier(TQSocketNotifier *); + // These were present in the X11 version of TQt v3.1.0 but didn't make + // it to the Windows version until TQt v3.1.1. + void setSocketNotifierPending(TQSocketNotifier *); + int activateSocketNotifiers(); + + int activateTimers(); + int timeToWait() const; + + virtual int exec() /PyName=exec_loop, ReleaseGIL, + PreHook=__pyTQtPreEventLoopHook__, + PostHook=__pyTQtPostEventLoopHook__/; + virtual void exit(int = 0); + + virtual int enterLoop(); + virtual void exitLoop(); + virtual int loopLevel() const; + + virtual void wakeUp(); + +signals: + void awake(); + void aboutToBlock(); +}; diff --git a/sip/tqt/tqfile.sip b/sip/tqt/tqfile.sip new file mode 100644 index 0000000..5536c98 --- /dev/null +++ b/sip/tqt/tqfile.sip @@ -0,0 +1,199 @@ +// This is the SIP interface definition for TQFile. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQFile</Title> +<FuncSynopsis> + <FuncDef>bool <Function>open</Function></FuncDef> + <ParamDef>int <Parameter>m</Parameter></ParamDef> + <ParamDef>FILE *<Parameter>f</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>TQ_LONG <Function>readBlock</Function></FuncDef> + <ParamDef>char *<Parameter>data</Parameter></ParamDef> + <ParamDef>TQ_ULONG <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single <Literal>len</Literal> parameter. The +<Literal>data</Literal> is returned if there was no error, otherwise +<Literal>None</Literal> is returned. +</Para> + +<FuncSynopsis> + <FuncDef>TQ_LONG <Function>readLine</Function></FuncDef> + <ParamDef>char *<Parameter>data</Parameter></ParamDef> + <ParamDef>TQ_ULONG <Parameter>maxlen</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single <Literal>maxlen</Literal> parameter. The +<Literal>data</Literal> is returned if there was no error, otherwise +<Literal>None</Literal> is returned. +</Para> + +<FuncSynopsis> + <FuncDef>static void <Function>setDecodingFunction</Function></FuncDef> + <ParamDef>EncoderFn <Parameter>f</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (TQt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>static void <Function>setEncodingFunction</Function></FuncDef> + <ParamDef>EncoderFn <Parameter>f</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (TQt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>TQ_LONG <Function>writeBlock</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>TQ_ULONG <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>data</Literal> and not passed +as a parameter. +</Para> +</Sect2> +%End + + +class TQFile : TQIODevice +{ +%TypeHeaderCode +#include <tqfile.h> +%End + +public: + TQFile(); + TQFile(const TQString &); + + TQString name() const; + void setName(const TQString &); + + static TQCString encodeName(const TQString &); + static TQString decodeName(const TQCString &); +// static void setEncodingFunction(EncoderFn); +// static void setDecodingFunction(DecoderFn); + + bool exists() const; + static bool exists(const TQString &); + + bool remove(); + static bool remove(const TQString &); + + bool open(int) /ReleaseGIL/; +// bool open(int,FILE *) /ReleaseGIL/; + bool open(int,int) /ReleaseGIL/; + void close(); + void flush() /ReleaseGIL/; + + Offset size() const; + Offset at() const; + bool at(Offset); + bool atEnd() const; + + SIP_PYOBJECT readBlock(TQ_ULONG) /ReleaseGIL/ [TQ_LONG (char *,TQ_ULONG)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + TQ_LONG actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipSelfWasArg ? sipCpp->TQFile::readBlock(buf,a0) : sipCpp->readBlock(buf,a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + Py_INCREF(Py_None); + sipRes = Py_None; + } + else if ((sipRes = PyBytes_FromStringAndSize(buf,actlen)) == NULL) + sipIsErr = 1; + + sipFree((void *)buf); + } +%End + + + TQ_LONG writeBlock(const char * /Array/, + TQ_ULONG /ArraySize/) /ReleaseGIL/; + TQ_LONG writeBlock(const TQByteArray &) /ReleaseGIL/; + + SIP_PYOBJECT readLine(TQ_ULONG) /ReleaseGIL/ [TQ_LONG (char *,TQ_ULONG)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + TQ_LONG actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipSelfWasArg ? sipCpp->TQFile::readLine(buf,a0) : sipCpp->readLine(buf,a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + sipFree((void *)buf); + + Py_INCREF(Py_None); + sipRes = Py_None; + } + else + { + sipRes = PyBytes_FromStringAndSize(buf,actlen); + + sipFree((void *)buf); + + if (sipRes == NULL) + sipIsErr = 1; + } + } +%End + + TQ_LONG readLine(TQString &,TQ_ULONG) /ReleaseGIL/; + + int getch(); + int putch(int); + int ungetch(int); + + int handle() const; + + TQString errorString() const; + +protected: + void setErrorString(const TQString &); + +private: + TQFile(const TQFile &); +}; diff --git a/sip/tqt/tqfiledialog.sip b/sip/tqt/tqfiledialog.sip new file mode 100644 index 0000000..920a218 --- /dev/null +++ b/sip/tqt/tqfiledialog.sip @@ -0,0 +1,224 @@ +// This is the SIP interface definition for TQFileDialog, TQFileIconProvider and +// TQFilePreview. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQFileDialog</Title> +<Para> +<Literal>TQFileDialog</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQFileIconProvider</Title> +<Para> +<Literal>TQFileIconProvider</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQFilePreview</Title> +<Para> +<Literal>TQFilePreview</Literal> is fully implemented. However it cannot be +used from Python in the same way as it is used from C++ because PyTQt does not +support multiple inheritance involving more than one wrapped class. A trick +that seems to work is to use composition rather than inheritance as in the +following code fragment. +</Para> +<ProgramListing> +class FilePreview(TQFilePreview): + pass + +class Preview(TQLabel): + def __init__(self, parent=None): + TQLabel.__init__(self, parent) + self.preview = FilePreview() + self.preview.previewUrl = self.previewUrl +</ProgramListing> +<Para> +Note that TQFilePreview cannot be instantiated directly because it is abstract. +Thanks to Hans-Peter Jansen for this trick. +</Para> +</Sect2> +%End + + +%If (TQt_FILEDIALOG) + +class TQFileIconProvider : TQObject +{ +%TypeHeaderCode +#include <tqfiledialog.h> +%End + +public: + TQFileIconProvider(TQObject * /TransferThis/ = 0,const char * = 0); + + virtual const TQPixmap *pixmap(const TQFileInfo &); + +private: + TQFileIconProvider(const TQFileIconProvider &); +}; + + +class TQFilePreview +{ +%TypeHeaderCode +#include <tqfiledialog.h> +%End + +public: + TQFilePreview(); + + virtual void previewUrl(const TQUrl &) = 0; +}; + + +class TQFileDialog : TQDialog +{ +%TypeHeaderCode +#include <tqfiledialog.h> +%End + +public: + TQFileDialog(const TQString &,const TQString & = TQString::null, + TQWidget * /TransferThis/ = 0,const char * = 0,bool = 0); + TQFileDialog(TQWidget * /TransferThis/ = 0,const char * = 0,bool = 0); + + static TQString getOpenFileName(const TQString & = TQString::null, + const TQString & = TQString::null, + TQWidget * = 0,const char * = 0, + const TQString & = TQString::null, + TQString * = 0,bool = 1) /ReleaseGIL/; + + static TQString getSaveFileName(const TQString & = TQString::null, + const TQString & = TQString::null, + TQWidget * = 0,const char * = 0, + const TQString & = TQString::null, + TQString * = 0,bool = 1) /ReleaseGIL/; + + static TQString getExistingDirectory(const TQString & = TQString::null, + TQWidget * = 0,const char * = 0, + const TQString & = TQString::null, + bool = 1,bool = 1) /ReleaseGIL/; + + static TQStringList getOpenFileNames(const TQString & = TQString::null, + const TQString & = TQString::null, + TQWidget * = 0,const char * = 0, + const TQString & = TQString::null, + TQString * = 0, + bool = 1) /ReleaseGIL/; + + static void setIconProvider(TQFileIconProvider *); + static TQFileIconProvider *iconProvider(); + + TQString selectedFile() const; + TQString selectedFilter() const; + virtual void setSelectedFilter(const TQString &); + virtual void setSelectedFilter(int); + + void setSelection(const TQString &); + + void selectAll(bool); + + TQStringList selectedFiles() const; + + TQString dirPath() const; + + void setDir(const TQDir &); + const TQDir* dir() const; + + void setShowHiddenFiles(bool); + bool showHiddenFiles() const; + + void rereadDir() /ReleaseGIL/; + void resortDir(); + + enum Mode { + AnyFile, + ExistingFile, + Directory, + ExistingFiles, + DirectoryOnly + }; + + void setMode(Mode); + Mode mode() const; + + enum ViewMode { + Detail, + List + }; + + enum PreviewMode { + NoPreview, + Contents, + Info + }; + + void setViewMode(ViewMode); + ViewMode viewMode() const; + void setPreviewMode(PreviewMode); + PreviewMode previewMode() const; + + bool eventFilter(TQObject *,TQEvent *); + + bool isInfoPreviewEnabled() const; + bool isContentsPreviewEnabled() const; + void setInfoPreviewEnabled(bool); + void setContentsPreviewEnabled(bool); + + void setInfoPreview(TQWidget *,TQFilePreview *); + void setContentsPreview(TQWidget *,TQFilePreview *); + + TQUrl url() const; + + void addFilter(const TQString &); + +public slots: + void done(int); + void setDir(const TQString &); + void setUrl(const TQUrlOperator &); + void setFilter(const TQString &); + void setFilters(const TQString &); +// void setFilters(const char **); + void setFilters(const TQStringList &); + +signals: + void fileHighlighted(const TQString &); + void fileSelected(const TQString &); + void filesSelected(const TQStringList &); + void dirEntered(const TQString &); + void filterSelected(const TQString &); + +protected: + void resizeEvent(TQResizeEvent *); + void keyPressEvent(TQKeyEvent *); + + void addWidgets(TQLabel *,TQWidget *,TQPushButton *); + void addToolButton(TQButton *,bool = 0); + void addLeftWidget(TQWidget *); + void addRightWidget(TQWidget *); + +private: + TQFileDialog(const TQFileDialog &); +}; + +%End diff --git a/sip/tqt/tqfileinfo.sip b/sip/tqt/tqfileinfo.sip new file mode 100644 index 0000000..38b4609 --- /dev/null +++ b/sip/tqt/tqfileinfo.sip @@ -0,0 +1,94 @@ +// This is the SIP interface definition for TQFileInfo. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQFileInfo</Title> +<Para> +<Literal>TQFileInfo</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQFileInfo +{ +%TypeHeaderCode +#include <tqfileinfo.h> +%End + +public: + enum PermissionSpec { + ReadOwner, WriteOwner, ExeOwner, + ReadUser, WriteUser, ExeUser, + ReadGroup, WriteGroup, ExeGroup, + ReadOther, WriteOther, ExeOther + }; + + TQFileInfo(); + TQFileInfo(const TQString &); + TQFileInfo(const TQFile &); + TQFileInfo(const TQDir &,const TQString &); + TQFileInfo(const TQFileInfo &); + + void setFile(const TQString &); + void setFile(const TQFile &); + void setFile(const TQDir &,const TQString &); + bool exists() const; + void refresh() const; + bool caching() const; + void setCaching(bool); + + const TQString filePath() const; + TQString fileName() const; + TQString absFilePath() const; + TQString baseName(bool = 1) const; + TQString extension(bool = 1) const; + + TQString dirPath(bool = 0) const; + TQDir dir(bool = 0) const; + bool isReadable() const; + bool isWritable() const; + bool isExecutable() const; + bool isHidden() const; + + bool isRelative() const; + bool convertToAbs(); + + bool isFile() const; + bool isDir() const; + bool isSymLink() const; + + TQString readLink() const /ReleaseGIL/; + + TQString owner() const; + uint ownerId() const; + TQString group() const; + uint groupId() const; + + bool permission(int) const; + + uint size() const; + + TQDateTime created() const; + TQDateTime lastModified() const; + TQDateTime lastRead() const; +}; diff --git a/sip/tqt/tqfont.sip b/sip/tqt/tqfont.sip new file mode 100644 index 0000000..cb2fe5c --- /dev/null +++ b/sip/tqt/tqfont.sip @@ -0,0 +1,236 @@ +// This is the SIP interface definition for TQFont. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQFont</Title> +<Para> +<Literal>TQFont</Literal> is fully implemented, including the Python +<Literal>==</Literal> and <Literal>!=</Literal> operators. +</Para> +</Sect2> +%End + + +class TQFont +{ +%TypeHeaderCode +#include <tqfont.h> +%End + +public: + enum StyleHint { + Helvetica, + Times, + Courier, + OldEnglish, + System, + AnyStyle, + SansSerif, + Serif, + TypeWriter, + Decorative + }; + + enum StyleStrategy { + PreferDefault, + PreferBitmap, + PreferDevice, + PreferOutline, + ForceOutline, + PreferMatch, + PreferQuality, + PreferAntialias, + NoAntialias, + OpenGLCompatible, + }; + + enum Weight { + Light, + Normal, + DemiBold, + Bold, + Black + }; + + enum Stretch { + UltraCondensed, + ExtraCondensed, + Condensed, + SemiCondensed, + Unstretched, + SemiExpanded, + Expanded, + ExtraExpanded, + UltraExpanded + }; + + TQFont(); + TQFont(const TQString &,int = 12,int = -1,bool = 0); + TQFont(const TQFont &); + + TQString family() const; + void setFamily(const TQString &); + + float pointSizeFloat() const; + void setPointSizeFloat(float); + + int pixelSize() const; + void setPixelSize(int); + void setPixelSizeFloat(float); + int pointSize() const; + void setPointSize(int); + + int weight() const; + void setWeight(int); + + bool bold() const; + void setBold(bool); + + bool italic() const; + void setItalic(bool); + + bool underline() const; + void setUnderline(bool); + + bool overline() const; + void setOverline(bool); + + bool strikeOut() const; + void setStrikeOut(bool); + + bool fixedPitch() const; + void setFixedPitch(bool); + + StyleHint styleHint() const; + StyleStrategy styleStrategy() const; + void setStyleHint(StyleHint,StyleStrategy = PreferDefault); + void setStyleStrategy(StyleStrategy); + + int stretch() const; + void setStretch(int); + + bool rawMode() const; + void setRawMode(bool); + + bool exactMatch() const; + + bool operator==(const TQFont &) const; + bool operator!=(const TQFont &) const; + + bool isCopyOf(const TQFont &) const; + +%If (WS_X11) + TQt::HANDLE handle() const; +%End + void setRawName(const TQString &); + TQString rawName() const; + TQString key() const; + TQString toString() const; + bool fromString(const TQString &); + static TQString substitute(const TQString &); + static TQStringList substitutes(const TQString &); + static TQStringList substitutions(); + static void insertSubstitution(const TQString &,const TQString &); + static void insertSubstitutions(const TQString &,const TQStringList &); + static void removeSubstitution(const TQString &); + + static void initialize(); + static void cleanup(); + static void cacheStatistics(); + + enum Script { + Latin, + Greek, + Cyrillic, + Armenian, + Georgian, + Runic, + Ogham, + SpacingModifiers, + CombiningMarks, + + Hebrew, + Arabic, + Syriac, + Thaana, + + Devanagari, + Bengali, + Gurmukhi, + Gujarati, + Oriya, + Tamil, + Telugu, + Kannada, + Malayalam, + Sinhala, + Thai, + Lao, + Tibetan, + Myanmar, + Khmer, + + Han, + Hiragana, + Katakana, + Hangul, + Bopomofo, + Yi, + + Ethiopic, + Cherokee, + CanadianAboriginal, + Mongolian, + + CurrencySymbols, + LetterlikeSymbols, + NumberForms, + MathematicalOperators, + TechnicalSymbols, + GeometricSymbols, + MiscellaneousSymbols, + EnclosedAndSquare, + Braille, + + Unicode, + + Tagalog, + Hanunoo, + Buhid, + Tagbanwa, + + KatakanaHalfWidth, + + Limbu, + TaiLe, + }; + + TQString defaultFamily() const; + TQString lastResortFamily() const; + TQString lastResortFont() const; + + TQFont resolve(const TQFont &) const; + +protected: + bool dirty() const; + int deciPointSize() const; +}; diff --git a/sip/tqt/tqfontdatabase.sip b/sip/tqt/tqfontdatabase.sip new file mode 100644 index 0000000..da6501f --- /dev/null +++ b/sip/tqt/tqfontdatabase.sip @@ -0,0 +1,71 @@ +// This is the SIP interface definition for TQFontDatabase. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQFontDatabase (TQt v2.1+)</Title> +<Para> +<Literal>TQFontDatabase</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_FONTDATABASE) + +class TQFontDatabase +{ +%TypeHeaderCode +#include <tqfontdatabase.h> +%End + +public: + TQFontDatabase(); + + static TQValueList<int> standardSizes(); + + TQStringList families() const; + TQStringList families(TQFont::Script) const; + TQStringList styles(const TQString &) const; + TQValueList<int> pointSizes(const TQString &, + const TQString & = TQString::null); + TQValueList<int> smoothSizes(const TQString &,const TQString &); + TQString styleString(const TQFont &); + + TQFont font(const TQString,const TQString &,int); + + bool isBitmapScalable(const TQString &, + const TQString & = TQString::null) const; + bool isSmoothlyScalable(const TQString &, + const TQString & = TQString::null) const; + bool isScalable(const TQString &,const TQString & = TQString::null) const; + bool isFixedPitch(const TQString &, + const TQString & = TQString::null) const; + + bool italic(const TQString &,const TQString &) const; + bool bold(const TQString &,const TQString &) const; + int weight(const TQString &,const TQString &) const; + + static TQString scriptName(TQFont::Script); + static TQString scriptSample(TQFont::Script); +}; + +%End diff --git a/sip/tqt/tqfontdialog.sip b/sip/tqt/tqfontdialog.sip new file mode 100644 index 0000000..fdc0cb8 --- /dev/null +++ b/sip/tqt/tqfontdialog.sip @@ -0,0 +1,73 @@ +// This is the SIP interface definition for TQFontDialog. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQFontDialog (TQt v2+)</Title> +<FuncSynopsis> + <FuncDef>static TQFont <Function>getFont</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter></ParamDef> + <ParamDef>const TQFont &<Parameter>def</Parameter></ParamDef> + <ParamDef>TQWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>def</Literal>, <Literal>parent</Literal> and +<Literal>name</Literal> parameters and returns a tuple containing the +<Literal>TQFont</Literal> result and the <Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>static TQFont <Function>getFont</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter></ParamDef> + <ParamDef>TQWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>parent</Literal> and <Literal>name</Literal> parameters +and returns a tuple containing the <Literal>TQFont</Literal> result and the +<Literal>ok</Literal> value. +</Para> +</Sect2> +%End + + +%If (TQt_FONTDIALOG) + +class TQFontDialog : TQDialog +{ +%TypeHeaderCode +#include <tqfontdialog.h> +%End + +public: + static TQFont getFont(bool *,const TQFont &,TQWidget * = 0, + const char * = 0); + static TQFont getFont(bool *,TQWidget * = 0,const char * = 0); + +private: + TQFontDialog(TQWidget * /TransferThis/ = 0,const char * = 0,bool = 0, + WFlags = 0); + TQFontDialog(const TQFontDialog &); + ~TQFontDialog(); +}; + +%End diff --git a/sip/tqt/tqfontinfo.sip b/sip/tqt/tqfontinfo.sip new file mode 100644 index 0000000..7f714d4 --- /dev/null +++ b/sip/tqt/tqfontinfo.sip @@ -0,0 +1,56 @@ +// This is the SIP interface definition for TQFontInfo. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQFontInfo</Title> +<Para> +<Literal>TQFontInfo</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQFontInfo +{ +%TypeHeaderCode +#include <tqfontinfo.h> +%End + +public: + TQFontInfo(const TQFont &); + TQFontInfo(const TQFont &,TQFont::Script); + TQFontInfo(const TQFontInfo &); + + TQString family() const; + int pixelSize() const; + int pointSize() const; + bool italic() const; + int weight() const; + bool bold() const; + bool underline() const; + bool overline() const; + bool strikeOut() const; + bool fixedPitch() const; + TQFont::StyleHint styleHint() const; + bool rawMode() const; + bool exactMatch() const; +}; diff --git a/sip/tqt/tqfontmetrics.sip b/sip/tqt/tqfontmetrics.sip new file mode 100644 index 0000000..18e5b4e --- /dev/null +++ b/sip/tqt/tqfontmetrics.sip @@ -0,0 +1,167 @@ +// This is the SIP interface definition for TQFontMetrics. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQFontMetrics</Title> +<FuncSynopsis> + <FuncDef>TQRect <Function>boundingRect</Function></FuncDef> + <ParamDef>int <Parameter>x</Parameter></ParamDef> + <ParamDef>int <Parameter>y</Parameter></ParamDef> + <ParamDef>int <Parameter>w</Parameter></ParamDef> + <ParamDef>int <Parameter>h</Parameter></ParamDef> + <ParamDef>int <Parameter>flags</Parameter></ParamDef> + <ParamDef>const TQString &<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>len</Parameter> = -1</ParamDef> + <ParamDef>int <Parameter>tabstops</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>tabarray</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>tabarray</Literal> parameter is a Python list of integers. +</Para> + +<FuncSynopsis> + <FuncDef>TQSize <Function>size</Function></FuncDef> + <ParamDef>int <Parameter>flags</Parameter></ParamDef> + <ParamDef>const TQString &<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>len</Parameter> = -1</ParamDef> + <ParamDef>int <Parameter>tabstops</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>tabarray</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>tabarray</Literal> parameter is a Python list of integers. +</Para> +</Sect2> +%End + + +class TQFontMetrics +{ +%TypeHeaderCode +#include <tqfontmetrics.h> +%End + +public: + TQFontMetrics(const TQFont &); + TQFontMetrics(const TQFont &,TQFont::Script); + TQFontMetrics(const TQFontMetrics &); + + int ascent() const; + int descent() const; + int height() const; + int leading() const; + int lineSpacing() const; + int minLeftBearing() const; + int minRightBearing() const; + int maxWidth() const; + bool inFont(TQChar) const; + int leftBearing(TQChar) const; + int rightBearing(TQChar) const; + int width(const TQString &,int = -1) const; + int width(TQChar) const; + int charWidth(const TQString &,int) const; + TQRect boundingRect(const TQString &,int = -1) const; + TQRect boundingRect(TQChar) const; + + TQRect boundingRect(int,int,int,int,int,const TQString &,int = -1, + int = 0,SIP_PYLIST /AllowNone/ = 0) const; +%MethodCode + int *tabarray; + + if (intListToArray(a8,&tabarray) < 0) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipRes = new TQRect(sipCpp -> TQFontMetrics::boundingRect(a0,a1,a2,a3,a4,*a5,a6,a7,tabarray)); + Py_END_ALLOW_THREADS + + if (tabarray) + sipFree((void *)tabarray); + } +%End + + TQSize size(int,const TQString &,int = -1,int = 0, + SIP_PYLIST /AllowNone/ = 0) const; +%MethodCode + int *tabarray; + + if (intListToArray(a4,&tabarray) < 0) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipRes = new TQSize(sipCpp -> TQFontMetrics::size(a0,*a1,a2,a3,tabarray)); + Py_END_ALLOW_THREADS + + if (tabarray) + sipFree((void *)tabarray); + } +%End + + int underlinePos() const; + int overlinePos() const; + int strikeOutPos() const; + int lineWidth() const; + +%TypeCode +// Convert an optional Python list of integers to a zero terminated array. +// Return a negative value if there was an error. +static int intListToArray(PyObject *pl,int **ap) +{ + int i, nint, *ip; + + // The trivial case. + if (!pl || pl == Py_None) + { + *ap = 0; + return 0; + } + + nint = PyList_Size(pl); + + if ((*ap = (int *)sipMalloc((nint + 1) * sizeof (int))) == NULL) + return -1; + + // Convert the list. + PyErr_Clear(); + + ip = *ap; + + for (i = 0; i < nint; ++i) + { + *ip++ = PyLong_AsLong(PyList_GetItem(pl,i)); + + if (PyErr_Occurred()) + { + sipFree((void *)*ap); + return -1; + } + } + + // Terminate the list. + *ip = 0; + + return 0; +} +%End + +}; diff --git a/sip/tqt/tqframe.sip b/sip/tqt/tqframe.sip new file mode 100644 index 0000000..ca47416 --- /dev/null +++ b/sip/tqt/tqframe.sip @@ -0,0 +1,100 @@ +// This is the SIP interface definition for TQFrame. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQFrame</Title> +<Para> +<Literal>TQFrame</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQFrame : TQWidget +{ +%TypeHeaderCode +#include <tqframe.h> +%End + +public: + TQFrame(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + int frameStyle() const; + virtual void setFrameStyle(int); + + int frameWidth() const; + TQRect contentsRect() const; + + TQSize sizeHint() const; + + enum Shape { + NoFrame, + Box, + Panel, + WinPanel, + HLine, + VLine, + StyledPanel, + PopupPanel, + MenuBarPanel, + ToolBarPanel, + LineEditPanel, + TabWidgetPanel, + GroupBoxPanel, + MShape + }; + + enum Shadow { + Plain, + Raised, + Sunken, + MShadow + }; + + Shape frameShape() const; + void setFrameShape(Shape); + Shadow frameShadow() const; + void setFrameShadow(Shadow); + + int lineWidth() const; + virtual void setLineWidth(int); + + int margin() const; + virtual void setMargin(int); + + int midLineWidth() const; + virtual void setMidLineWidth(int); + + TQRect frameRect() const; + virtual void setFrameRect(const TQRect &); + +protected: + void paintEvent(TQPaintEvent *); + void resizeEvent(TQResizeEvent *); + virtual void drawFrame(TQPainter *); + virtual void drawContents(TQPainter *); + virtual void frameChanged(); + void styleChange(TQStyle &); + +private: + TQFrame(const TQFrame &); +}; diff --git a/sip/tqt/tqglobal.sip b/sip/tqt/tqglobal.sip new file mode 100644 index 0000000..711f26d --- /dev/null +++ b/sip/tqt/tqglobal.sip @@ -0,0 +1,67 @@ +// This is the SIP interface definition for some TQt globals. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ModuleHeaderCode +#include <tqglobal.h> +%End + + +const int TQT_VERSION; +const char *TQT_VERSION_STR; + +typedef unsigned char uchar; +typedef unsigned short ushort; +typedef unsigned uint; +typedef unsigned long ulong; +typedef char * pchar; +typedef uchar * puchar; +typedef const char * pcchar; + +typedef char TQ_INT8; +typedef unsigned char TQ_UINT8; +typedef short TQ_INT16; +typedef unsigned short TQ_UINT16; +typedef int TQ_INT32; +typedef unsigned TQ_UINT32; + +%If (TQt_TQ_LONG_IS_long) +typedef long TQ_LONG; +typedef unsigned long TQ_ULONG; +%End +%If (!TQt_TQ_LONG_IS_long) +typedef long long TQ_LONG; +typedef unsigned long long TQ_ULONG; +%End + +const char *tqVersion(); + +const char *tqInstallPath(); +const char *tqInstallPathDocs(); +const char *tqInstallPathHeaders(); +const char *tqInstallPathLibs(); +const char *tqInstallPathBins(); +const char *tqInstallPathPlugins(); +const char *tqInstallPathData(); +const char *tqInstallPathTranslations(); +%If (!WS_WIN) +const char *tqInstallPathSysconf(); +%End diff --git a/sip/tqt/tqgrid.sip b/sip/tqt/tqgrid.sip new file mode 100644 index 0000000..9047b70 --- /dev/null +++ b/sip/tqt/tqgrid.sip @@ -0,0 +1,51 @@ +// This is the SIP interface definition for TQGrid. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQGrid (TQt v2+)</Title> +<Para> +<Literal>TQGrid</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQGrid : TQFrame +{ +%TypeHeaderCode +#include <tqgrid.h> +%End + +public: + TQGrid(int,TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + TQGrid(int,Orientation,TQWidget * /TransferThis/ = 0,const char * = 0, + WFlags = 0); + + void setSpacing(int); + TQSize sizeHint() const; + +protected: + void frameChanged(); + +private: + TQGrid(const TQGrid &); +}; diff --git a/sip/tqt/tqgridview.sip b/sip/tqt/tqgridview.sip new file mode 100644 index 0000000..ba73e64 --- /dev/null +++ b/sip/tqt/tqgridview.sip @@ -0,0 +1,72 @@ +// This is the SIP interface definition for TQGridView. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQGridView (TQt v3+)</Title> +<Para> +<Literal>TQGridView</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQGridView : TQScrollView +{ +%TypeHeaderCode +#include <tqgridview.h> +%End + +public: + TQGridView(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + int numRows() const; + virtual void setNumRows(int); + int numCols() const; + virtual void setNumCols(int); + + int cellWidth() const; + virtual void setCellWidth(int); + int cellHeight() const; + virtual void setCellHeight(int); + + TQRect cellRect() const; + TQRect cellGeometry(int,int); + TQSize gridSize() const; + + int rowAt(int) const; + int columnAt(int) const; + + void repaintCell(int,int,bool = 1); + void updateCell(int,int); + void ensureCellVisible(int,int); + +protected: + virtual void paintCell(TQPainter *,int,int) = 0; + virtual void paintEmptyArea(TQPainter *,int,int,int,int); + + void drawContents(TQPainter *,int,int,int,int); + + virtual void dimensionChange(int,int); + +private: + TQGridView(const TQGridView &); +}; diff --git a/sip/tqt/tqgroupbox.sip b/sip/tqt/tqgroupbox.sip new file mode 100644 index 0000000..f4fdc61 --- /dev/null +++ b/sip/tqt/tqgroupbox.sip @@ -0,0 +1,92 @@ +// This is the SIP interface definition for TQGroupBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQGroupBox</Title> +<Para> +<Literal>TQGroupBox</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQGroupBox : TQFrame +{ +%TypeHeaderCode +#include <tqgroupbox.h> +%End + +public: + TQGroupBox(TQWidget * /TransferThis/ = 0,const char * = 0); + TQGroupBox(const TQString &,TQWidget * /TransferThis/ = 0, + const char * = 0); + TQGroupBox(int,Orientation,TQWidget * /TransferThis/ = 0, + const char * = 0); + TQGroupBox(int,Orientation,const TQString &,TQWidget * /TransferThis/ = 0, + const char * = 0); + + virtual void setColumnLayout(int,Orientation); + + TQString title() const; + virtual void setTitle(const TQString &); + + int alignment() const; + virtual void setAlignment(int); + + int columns() const; + void setColumns(int); + + Orientation orientation() const; + void setOrientation(Orientation); + + int insideMargin() const; + int insideSpacing() const; + void setInsideMargin(int); + void setInsideSpacing(int); + + void addSpace(int); + TQSize sizeHint() const; + + bool isFlat() const; + void setFlat(bool); + bool isCheckable() const; + void setCheckable(bool); + bool isChecked() const; + void setEnabled(bool); + +public slots: + void setChecked(bool); + +signals: + void toggled(bool); + +protected: + bool event(TQEvent *); + void childEvent(TQChildEvent *); + void resizeEvent(TQResizeEvent *); + void paintEvent(TQPaintEvent *); + void focusInEvent(TQFocusEvent *); + void fontChange(const TQFont &); + +private: + TQGroupBox(const TQGroupBox &); +}; diff --git a/sip/tqt/tqhbox.sip b/sip/tqt/tqhbox.sip new file mode 100644 index 0000000..884db2e --- /dev/null +++ b/sip/tqt/tqhbox.sip @@ -0,0 +1,52 @@ +// This is the SIP interface definition for TQHBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQHBox (TQt v2+)</Title> +<Para> +<Literal>TQHBox</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQHBox : TQFrame +{ +%TypeHeaderCode +#include <tqhbox.h> +%End + +public: + TQHBox(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + void setSpacing(int); + bool setStretchFactor(TQWidget *,int); + TQSize sizeHint() const; + +protected: + TQHBox(bool,TQWidget * /TransferThis/,const char *,WFlags = 0); + + void frameChanged(); + +private: + TQHBox(const TQHBox &); +}; diff --git a/sip/tqt/tqhbuttongroup.sip b/sip/tqt/tqhbuttongroup.sip new file mode 100644 index 0000000..3cdcd49 --- /dev/null +++ b/sip/tqt/tqhbuttongroup.sip @@ -0,0 +1,44 @@ +// This is the SIP interface definition for TQHButtonGroup. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQHButtonGroup (TQt v2+)</Title> +<Para> +<Literal>TQHButtonGroup</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQHButtonGroup : TQButtonGroup +{ +%TypeHeaderCode +#include <tqhbuttongroup.h> +%End + +public: + TQHButtonGroup(TQWidget * /TransferThis/ = 0,const char * = 0); + TQHButtonGroup(const TQString &,TQWidget * /TransferThis/ = 0,const char * = 0); + +private: + TQHButtonGroup(const TQHButtonGroup &); +}; diff --git a/sip/tqt/tqheader.sip b/sip/tqt/tqheader.sip new file mode 100644 index 0000000..2161dd3 --- /dev/null +++ b/sip/tqt/tqheader.sip @@ -0,0 +1,127 @@ +// This is the SIP interface definition for TQHeader. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQHeader</Title> +<Para> +<Literal>TQHeader</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQHeader : TQWidget +{ +%TypeHeaderCode +#include <tqheader.h> +%End + +public: + TQHeader(TQWidget * /TransferThis/ = 0,const char * = 0); + TQHeader(int,TQWidget * /TransferThis/ = 0,const char * = 0); + + int addLabel(const TQString &,int = -1); + int addLabel(const TQIconSet &,const TQString &,int = -1); + void removeLabel(int); + virtual void setLabel(int,const TQString &,int = -1); + virtual void setLabel(int,const TQIconSet &,const TQString &,int = -1); + + TQString label(int) const; + TQIconSet *iconSet(int) const; + + virtual void setOrientation(Orientation); + Orientation orientation() const; + virtual void setTracking(bool); + bool tracking() const; + + virtual void setClickEnabled(bool,int = -1); + virtual void setResizeEnabled(bool,int = -1); + virtual void setMovingEnabled(bool); + virtual void setStretchEnabled(bool,int); + bool isClickEnabled(int = -1) const; + bool isResizeEnabled(int = -1) const; + bool isMovingEnabled() const; + bool isStretchEnabled() const; + bool isStretchEnabled(int) const; + + void resizeSection(int,int); + int sectionSize(int) const; + int sectionPos(int) const; + int sectionAt(int) const; + int count() const; + int headerWidth() const; + TQRect sectionRect(int) const; + + int offset() const; + + TQSize sizeHint() const; + + int mapToSection(int) const; + int mapToIndex(int) const; + + void moveSection(int,int); + + // This is placed before the obsolete version below so that it has + // precedence. It may still cause problems with old code until SIP + // distinguishes between bools and enums. + void setSortIndicator(int,SortOrder); + int sortIndicatorSection() const; + SortOrder sortIndicatorOrder() const; + // Obsolete. + void setSortIndicator(int,bool = 1); + + void adjustHeaderSize(); + +public slots: + void setUpdatesEnabled(bool); + virtual void setOffset(int); + +signals: + void clicked(int); + void pressed(int); + void released(int); + void sizeChange(int,int,int); + void indexChange(int,int,int); + void sectionHandleDoubleClicked(int); + +protected: + void paintEvent(TQPaintEvent *); + void showEvent(TQShowEvent *); + void resizeEvent(TQResizeEvent *); + TQRect sRect(int); + + virtual void paintSection(TQPainter *,int,const TQRect &); + virtual void paintSectionLabel(TQPainter *,int,const TQRect &); + + void fontChange(const TQFont &); + + void mousePressEvent(TQMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); + void mouseMoveEvent(TQMouseEvent *); + void mouseDoubleClickEvent(TQMouseEvent *); + + void keyPressEvent(TQKeyEvent *); + void keyReleaseEvent(TQKeyEvent *); + +private: + TQHeader(const TQHeader &); +}; diff --git a/sip/tqt/tqhgroupbox.sip b/sip/tqt/tqhgroupbox.sip new file mode 100644 index 0000000..e287673 --- /dev/null +++ b/sip/tqt/tqhgroupbox.sip @@ -0,0 +1,44 @@ +// This is the SIP interface definition for TQHGroupBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQHGroupBox (TQt v2+)</Title> +<Para> +<Literal>TQHGroupBox</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQHGroupBox : TQGroupBox +{ +%TypeHeaderCode +#include <tqhgroupbox.h> +%End + +public: + TQHGroupBox(TQWidget * /TransferThis/ = 0,const char * = 0); + TQHGroupBox(const TQString &,TQWidget * /TransferThis/ = 0,const char * = 0); + +private: + TQHGroupBox(const TQHGroupBox &); +}; diff --git a/sip/tqt/tqiconset.sip b/sip/tqt/tqiconset.sip new file mode 100644 index 0000000..8fdba3a --- /dev/null +++ b/sip/tqt/tqiconset.sip @@ -0,0 +1,107 @@ +// This is the SIP interface definition for TQIconSet and TQIconFactory. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQIconSet</Title> +<Para> +<Literal>TQIconSet</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQIconFactory (TQt v3.1+)</Title> +<Para> +<Literal>TQIconFactory</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQIconSet +{ +%TypeHeaderCode +#include <tqiconset.h> +%End + +public: + enum Size { + Automatic, + Small, + Large + }; + + enum Mode { + Normal, + Disabled, + Active + }; + + enum State { + On, + Off + }; + + TQIconSet(); + TQIconSet(const TQPixmap &,Size = Automatic); + TQIconSet(const TQPixmap &,const TQPixmap &); + TQIconSet(const TQIconSet &); + + void reset(const TQPixmap &,Size); + + virtual void setPixmap(const TQPixmap &,Size,Mode = Normal,State = Off); + virtual void setPixmap(const TQString &,Size,Mode = Normal,State = Off); + TQPixmap pixmap(Size,Mode,State = Off) const; +// TQPixmap pixmap(Size,bool,State = Off) const; + TQPixmap pixmap() const; + bool isGenerated(Size,Mode,State = Off) const; + void clearGenerated(); + void installIconFactory(TQIconFactory *); + + bool isNull() const; + + void detach(); + + static void setIconSize(Size,const TQSize &); + static const TQSize &iconSize(Size); +}; + + +class TQIconFactory +{ +%TypeHeaderCode +#include <tqiconset.h> +%End + +public: + TQIconFactory(); + + virtual TQPixmap *createPixmap(const TQIconSet &,TQIconSet::Size, + TQIconSet::Mode, + TQIconSet::State) /Factory/; + void setAutoDelete(bool); + bool autoDelete() const; + + static TQIconFactory *defaultFactory(); + static void installDefaultFactory(TQIconFactory * /Transfer/); + +private: + TQIconFactory(const TQIconFactory &); +}; diff --git a/sip/tqt/tqiconview.sip b/sip/tqt/tqiconview.sip new file mode 100644 index 0000000..ceb6791 --- /dev/null +++ b/sip/tqt/tqiconview.sip @@ -0,0 +1,381 @@ +// This is the SIP interface definition for TQIconView, TQIconViewItem, TQIconDrag +// and TQIconDragItem. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQIconView (TQt v2.1+)</Title> +<FuncSynopsis> + <FuncDef>TQIconViewItem *<Function>makeRowLayout</Function></FuncDef> + <ParamDef>TQIconViewItem *<Parameter>begin</Parameter></ParamDef> + <ParamDef>int &<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> +</Sect2> + +<Sect2><Title>TQIconViewItem (TQt v2.1+)</Title> +<Para> +<Literal>TQIconViewItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQIconDrag (TQt v2.1+)</Title> +<Para> +<Literal>TQIconDrag</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQIconDragItem (TQt v2.1+)</Title> +<Para> +<Literal>TQIconDragItem</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_ICONVIEW) + +%If (TQt_DRAGANDDROP) + +class TQIconDragItem +{ +%TypeHeaderCode +#include <tqiconview.h> +%End + +public: + TQIconDragItem(); + + virtual TQByteArray data() const; + virtual void setData(const TQByteArray &); +}; + + +class TQIconDrag : TQDragObject +{ +%TypeHeaderCode +#include <tqiconview.h> +%End + +public: + TQIconDrag(TQWidget * /TransferThis/,const char * = 0); + + void append(const TQIconDragItem &,const TQRect &,const TQRect &); + + virtual const char* format(int) const; + static bool canDecode(TQMimeSource *); + virtual TQByteArray encodedData(const char *) const; + +private: + TQIconDrag(const TQIconDrag &); +}; + +%End + + +class TQIconViewItem : TQt +{ +%TypeHeaderCode +#include <tqiconview.h> +%End + +public: + TQIconViewItem(TQIconView * /TransferThis/); + TQIconViewItem(TQIconView * /TransferThis/,TQIconViewItem *); + TQIconViewItem(TQIconView * /TransferThis/,const TQString &); + TQIconViewItem(TQIconView * /TransferThis/,TQIconViewItem *, + const TQString &); + TQIconViewItem(TQIconView * /TransferThis/,const TQString &, + const TQPixmap &); + TQIconViewItem(TQIconView * /TransferThis/,TQIconViewItem *, + const TQString &,const TQPixmap &); + TQIconViewItem(TQIconView * /TransferThis/,const TQString &, + const TQPicture &); + TQIconViewItem(TQIconView * /TransferThis/,TQIconViewItem *, + const TQString &,const TQPicture &); + + virtual void setRenameEnabled(bool); + virtual void setDragEnabled(bool); + virtual void setDropEnabled(bool); + + virtual TQString text() const; + virtual TQPixmap *pixmap() const; + virtual TQPicture *picture() const; + virtual TQString key() const; + + bool renameEnabled() const; + bool dragEnabled() const; + bool dropEnabled() const; + + TQIconView *iconView() const; + TQIconViewItem *prevItem() const; + TQIconViewItem *nextItem() const; + + int index() const; + + virtual void setSelected(bool,bool); + virtual void setSelected(bool); + virtual void setSelectable(bool); + + bool isSelected() const; + bool isSelectable() const; + + virtual void repaint(); + + virtual bool move(int,int); + virtual void moveBy(int,int); + virtual bool move(const TQPoint &); + virtual void moveBy(const TQPoint &); + + TQRect rect() const; + int x() const; + int y() const; + int width() const; + int height() const; + TQSize size() const; + TQPoint pos() const; + TQRect textRect(bool = 1) const; + TQRect pixmapRect(bool = 1) const; + bool contains(const TQPoint &) const; + bool intersects(const TQRect &) const; + + virtual bool acceptDrop(const TQMimeSource *) const; + + void rename(); + + virtual int compare(TQIconViewItem *) const; + + virtual void setText(const TQString &); + virtual void setPixmap(const TQPixmap &); + virtual void setPicture(const TQPicture &); + virtual void setText(const TQString &,bool,bool = 1); + virtual void setPixmap(const TQPixmap &,bool,bool = 1); + virtual void setKey(const TQString &); + + virtual int rtti() const; + +protected: + virtual void removeRenameBox(); + virtual void calcRect(const TQString & = TQString::null); + virtual void paintItem(TQPainter *,const TQColorGroup &); + virtual void paintFocus(TQPainter *,const TQColorGroup &); +%If (TQt_DRAGANDDROP) + virtual void dropped(TQDropEvent *,const TQValueList<TQIconDragItem> &); +%End + virtual void dragEntered(); + virtual void dragLeft(); + void setItemRect(const TQRect &); + void setTextRect(const TQRect &); + void setPixmapRect(const TQRect &); + void calcTmpText(); + TQString tempText() const; +}; + + +class TQIconView : TQScrollView +{ +%TypeHeaderCode +#include <tqiconview.h> +%End + +public: + enum SelectionMode { + Single, + Multi, + Extended, + NoSelection + }; + + enum Arrangement { + LeftToRight, + TopToBottom + }; + + enum ResizeMode { + Fixed, + Adjust + }; + + enum ItemTextPos { + Bottom, + Right + }; + + TQIconView(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + virtual void insertItem(TQIconViewItem *,TQIconViewItem * = 0); + virtual void takeItem(TQIconViewItem *); + + int index(const TQIconViewItem *) const; + + TQIconViewItem *firstItem() const; + TQIconViewItem *lastItem() const; + TQIconViewItem *currentItem() const; + virtual void setCurrentItem(TQIconViewItem *); + virtual void setSelected(TQIconViewItem *,bool,bool = 0); + + uint count() const; + + virtual void showEvent(TQShowEvent *); + + virtual void setSelectionMode(SelectionMode); + SelectionMode selectionMode() const; + + TQIconViewItem *findItem(const TQPoint &) const; + TQIconViewItem *findItem(const TQString &, + ComparisonFlags = BeginsWith) const; + virtual void selectAll(bool); + virtual void clearSelection(); + virtual void invertSelection(); + + virtual void repaintItem(TQIconViewItem *); + void repaintSelectedItems(); + + void ensureItemVisible(TQIconViewItem *); + TQIconViewItem* findFirstVisibleItem(const TQRect &) const; + TQIconViewItem* findLastVisibleItem(const TQRect &) const; + + virtual void clear(); + + virtual void setGridX(int); + virtual void setGridY(int); + int gridX() const; + int gridY() const; + virtual void setSpacing(int); + int spacing() const; + virtual void setItemTextPos(ItemTextPos); + ItemTextPos itemTextPos() const; + virtual void setItemTextBackground(const TQBrush &); + TQBrush itemTextBackground() const; + virtual void setArrangement(Arrangement); + Arrangement arrangement() const; + virtual void setResizeMode(ResizeMode); + ResizeMode resizeMode() const; + virtual void setMaxItemWidth(int); + int maxItemWidth() const; + virtual void setMaxItemTextLength(int); + int maxItemTextLength() const; + virtual void setAutoArrange(bool); + bool autoArrange() const; + virtual void setShowToolTips(bool); + bool showToolTips() const; + + void setSorting(bool,bool = 1); + bool sorting() const; + bool sortDirection() const; + + virtual void setItemsMovable(bool); + bool itemsMovable() const; + virtual void setWordWrapIconText(bool); + bool wordWrapIconText() const; + + bool eventFilter(TQObject *,TQEvent *); + + TQSize minimumSizeHint() const; + TQSize sizeHint() const; + + virtual void sort(bool = 1); + + virtual void setFont(const TQFont &); + virtual void setPalette(const TQPalette &); + + bool isRenaming() const; + +public slots: + virtual void arrangeItemsInGrid(const TQSize &,bool = 1); + virtual void arrangeItemsInGrid(bool = 1); + virtual void setContentsPos(int,int); + virtual void updateContents(); + +signals: + void selectionChanged(); + void selectionChanged(TQIconViewItem *); + void currentChanged(TQIconViewItem *); + void clicked(TQIconViewItem *); + void clicked(TQIconViewItem *,const TQPoint &); + void pressed(TQIconViewItem *); + void pressed(TQIconViewItem *,const TQPoint &); + + void doubleClicked(TQIconViewItem *); + void returnPressed(TQIconViewItem *); + void rightButtonClicked(TQIconViewItem *,const TQPoint &); + void rightButtonPressed(TQIconViewItem *,const TQPoint &); + void mouseButtonPressed(int,TQIconViewItem *,const TQPoint &); + void mouseButtonClicked(int,TQIconViewItem *,const TQPoint &); + void contextMenuRequested(TQIconViewItem *,const TQPoint &); +%If (TQt_DRAGANDDROP) + void dropped(TQDropEvent *,const TQValueList<TQIconDragItem> &); +%End + void moved(); + void onItem(TQIconViewItem *); + void onViewport(); + void itemRenamed(TQIconViewItem *,const TQString &); + void itemRenamed(TQIconViewItem *); + +protected slots: + virtual void doAutoScroll(); + virtual void adjustItems(); + virtual void slotUpdate(); + +protected: + void drawContents(TQPainter *,int,int,int,int); + void contentsMousePressEvent(TQMouseEvent *); + void contentsMouseReleaseEvent(TQMouseEvent *); + void contentsMouseMoveEvent(TQMouseEvent *); + void contentsMouseDoubleClickEvent(TQMouseEvent *); + void contentsContextMenuEvent(TQContextMenuEvent *); + +%If (TQt_DRAGANDDROP) + void contentsDragEnterEvent(TQDragEnterEvent *); + void contentsDragMoveEvent(TQDragMoveEvent *); + void contentsDragLeaveEvent(TQDragLeaveEvent *); + void contentsDropEvent(TQDropEvent *); +%End + + void resizeEvent(TQResizeEvent *); + void keyPressEvent(TQKeyEvent *); + void focusInEvent(TQFocusEvent *); + void focusOutEvent(TQFocusEvent *); + void enterEvent(TQEvent *); + + virtual void drawRubber(TQPainter *); +%If (TQt_DRAGANDDROP) + virtual TQDragObject *dragObject(); + virtual void startDrag(); +%End + virtual void insertInGrid(TQIconViewItem *); + virtual void drawBackground(TQPainter *,const TQRect &); + + void emitSelectionChanged(TQIconViewItem * = 0); + void emitRenamed(TQIconViewItem *); + +// TQIconViewItem *makeRowLayout(TQIconViewItem *,int &,bool &); + + void styleChange(TQStyle &); + void windowActivationChange(bool); + +private: + TQIconView(const TQIconView &); +}; + +%End diff --git a/sip/tqt/tqimage.sip b/sip/tqt/tqimage.sip new file mode 100644 index 0000000..2164d09 --- /dev/null +++ b/sip/tqt/tqimage.sip @@ -0,0 +1,448 @@ +// This is the SIP interface definition for TQImage, TQImageIO and +// TQImageTextKeyLang. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQImage</Title> +<Para> +The Python <Literal>==</Literal> and <Literal>!=</Literal> operators are +supported. +</Para> + +<FuncSynopsis> + <FuncDef><Function>TQImage</Function></FuncDef> + <ParamDef>const char *<Parameter>xpm</Parameter>[]</ParamDef> +</FuncSynopsis> +<Para> +This takes a list of strings as its parameter. +</Para> + +<FuncSynopsis> + <FuncDef><Function>TQImage</Function></FuncDef> + <ParamDef>uchar *<Parameter>data</Parameter></ParamDef> + <ParamDef>int <Parameter>w</Parameter></ParamDef> + <ParamDef>int <Parameter>h</Parameter></ParamDef> + <ParamDef>int <Parameter>depth</Parameter></ParamDef> + <ParamDef>TQRgb *<Parameter>colorTable</Parameter></ParamDef> + <ParamDef>int <Parameter>numColors</Parameter></ParamDef> + <ParamDef>Endian <Parameter>bitOrder</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The <Literal>colorTable</Literal> parameter is a list of TQRgb instances or +None. (TQt v2.1+) +</Para> + +<FuncSynopsis> + <FuncDef>uchar *<Function>bits</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +The return value is a <Literal>sip.voidptr</Literal> object which is only +useful if passed to another Python module. +</Para> + +<FuncSynopsis> + <FuncDef>TQRgb *<Function>colorTable</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +The return value is a <Literal>sip.voidptr</Literal> object which is only +useful if passed to another Python module. +</Para> + +<FuncSynopsis> + <FuncDef>TQImage <Function>convertDepthWithPalette</Function></FuncDef> + <ParamDef>int</ParamDef> + <ParamDef>TQRgb *<Parameter>p</Parameter></ParamDef> + <ParamDef>int <Parameter>pc</Parameter></ParamDef> + <ParamDef>int <Parameter>cf</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>uchar **<Function>jumpTable</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +The return value is a <Literal>sip.voidptr</Literal> object which is only +useful if passed to another Python module. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>loadFromData</Function></FuncDef> + <ParamDef>const uchar *<Parameter>buf</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> + <ParamDef>const char *<Parameter>format</Parameter> = 0</ParamDef> + <ParamDef>ColorMode <Parameter>mode</Parameter> = Auto</ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>buf</Literal> and not passed as +a parameter. +</Para> + +<FuncSynopsis> + <FuncDef>uchar *<Function>scanLine</Function></FuncDef> + <ParamDef>int <Parameter>i</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The return value is a <Literal>sip.voidptr</Literal> object which is only +useful if passed to another Python module. +</Para> +</Sect2> + +<Sect2><Title>TQImageIO</Title> +<FuncSynopsis> + <FuncDef>static void <Function>defineIOHandler</Function></FuncDef> + <ParamDef>const char *<Parameter>format</Parameter></ParamDef> + <ParamDef>const char *<Parameter>header</Parameter></ParamDef> + <ParamDef>const char *<Parameter>flags</Parameter></ParamDef> + <ParamDef>image_io_handler <Parameter>read_image</Parameter></ParamDef> + <ParamDef>image_io_handler <Parameter>write_image</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> + +<Sect2><Title>TQImageTextKeyLang</Title> +<Para> +<Literal>TQImageTextKeyLang</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQImage +{ +%TypeHeaderCode +#include <tqimage.h> +%End + +public: + enum Endian { + IgnoreEndian, + BigEndian, + LittleEndian + }; + + TQImage(); + TQImage(int,int,int,int = 0,Endian = IgnoreEndian); + TQImage(const TQSize &,int,int = 0,Endian = IgnoreEndian); + TQImage(const TQString &,char * = 0); + + TQImage(SIP_PYLIST) [(const char **)]; +%MethodCode + // The Python interface is a list of strings that make up the + // image. + + const char **str; + + if ((str = PyTQt_tqt_ListToArray(a0)) == NULL) + sipIsErr = 1; + else + { + // There is no wrapper class for TQImage. + + Py_BEGIN_ALLOW_THREADS + sipCpp = new TQImage(str); + Py_END_ALLOW_THREADS + + sipFree((void *)str); + } +%End + + TQImage(const TQByteArray &); + + TQImage(uchar *,int,int,int,SIP_PYLIST /AllowNone/,int,Endian) [(uchar *,int,int,int,int,TQRgb *,int,Endian)]; +%MethodCode + // The Python interface takes a list of TQRgb instances. + + TQRgb *coltab; + + if (a4 == Py_None) + coltab = 0; + else + { + int len = PyList_Size(a4); + + if (a5 > len) + a5 = len; + + coltab = new TQRgb[len]; + + PyErr_Clear(); + + for (int i = 0; i < a5; ++i) + { + coltab[i] = PyLong_AsUnsignedLong(PyList_GetItem(a4,i)); + + if (PyErr_Occurred()) + { + delete[] coltab; + sipIsErr = 1; + break; + } + } + } + + if (!sipIsErr) + { + // There is no wrapper class for TQImage. + + Py_BEGIN_ALLOW_THREADS + sipCpp = new TQImage(a0,a1,a2,a3,0,a5,(TQImage::Endian)a6); + + if (coltab) + { + // Now set the colours using the TQImage's self + // allocated colour table. If we had passed in + // coltab as the colour table then we couldn't + // have freed it and it would leak. + for (int i = 0; i < a5; ++i) + sipCpp -> setColor(i,coltab[i]); + + delete[] coltab; + } + Py_END_ALLOW_THREADS + } +%End + + TQImage(const TQImage &); + + bool operator==(const TQImage &) const; + bool operator!=(const TQImage &) const; + + void detach(); + TQImage copy() const; + TQImage copy(int,int,int,int,int = 0) const; + TQImage copy(const TQRect &) const; + static TQImage fromMimeSource(const TQString &); + bool isNull() const; + + int width() const; + int height() const; + TQSize size() const; + TQRect rect() const; + int depth() const; + int numColors() const; + Endian bitOrder() const; + + TQRgb color(int) const; + void setColor(int,TQRgb); + void setNumColors(int); + + bool hasAlphaBuffer() const; + void setAlphaBuffer(bool); + + bool allGray() const; + bool isGrayscale() const; + + // Actually returns uchar *. + void *bits() const; + // Actually returns uchar *. + void *scanLine(int) const; + // Actually returns uchar **. + void *jumpTable() const; + // Actually returns TQRgb *. + void *colorTable() const; + int numBytes() const; + int bytesPerLine() const; + + bool create(int,int,int,int = 0,Endian = IgnoreEndian); + bool create(const TQSize &,int,int = 0,Endian = IgnoreEndian); + void reset(); + + void fill(uint); + void invertPixels(bool = 1); + + TQImage convertDepth(int) const; +// TQImage convertDepthWithPalette(int,TQRgb *,int,int = 0) const; + TQImage convertDepth(int,int) const; + TQImage convertBitOrder(Endian) const; + + enum ScaleMode { + ScaleFree, + ScaleMin, + ScaleMax + }; + + TQImage smoothScale(int,int,ScaleMode = ScaleFree) const; + TQImage smoothScale(const TQSize &,ScaleMode = ScaleFree) const; + TQImage scale(int,int,ScaleMode = ScaleFree) const; + TQImage scale(const TQSize &,ScaleMode = ScaleFree) const; + TQImage scaleWidth(int) const; + TQImage scaleHeight(int) const; + TQImage xForm(const TQWMatrix &) const; + + TQImage createAlphaMask(int = 0) const; + TQImage createHeuristicMask(bool = 1) const; + TQImage mirror() const; + TQImage mirror(bool,bool) const; + TQImage swapRGB() const; + + static Endian systemBitOrder(); + static Endian systemByteOrder(); + + static const char *imageFormat(const TQString &); + static TQStrList inputFormats(); + static TQStrList outputFormats(); + static TQStringList inputFormatList(); + static TQStringList outputFormatList(); + bool load(const TQString &,const char * = 0); + bool loadFromData(const uchar * /Array/,uint /ArraySize/, + const char * = 0); + bool loadFromData(TQByteArray,char * = 0); + bool save(const TQString &,const char *,int = -1) const; + bool save(TQIODevice *,const char *,int = -1) const; + + bool valid(int,int) const; + int pixelIndex(int,int) const; + TQRgb pixel(int,int) const; + void setPixel(int,int,uint); + + int dotsPerMeterX() const; + int dotsPerMeterY() const; + void setDotsPerMeterX(int); + void setDotsPerMeterY(int); + TQPoint offset() const; + void setOffset(const TQPoint &); +%If (TQt_IMAGE_TEXT) + TQValueList<TQImageTextKeyLang> textList() const; + TQStringList textLanguages() const; + TQStringList textKeys() const; + TQString text(const char *,const char * = 0) const; + TQString text(const TQImageTextKeyLang &) const; + void setText(const char *,const char *,const TQString &); +%End +}; + + +void bitBlt(TQImage *,int,int,const TQImage *,int = 0,int = 0,int = -1,int = -1, + int = 0); + + +class TQImageIO +{ +%TypeHeaderCode +#include <tqimage.h> +%End + +public: + TQImageIO(); + TQImageIO(TQIODevice *,const char *); + TQImageIO(const TQString &,const char *); + + const TQImage &image() const; + int status() const; + const char *format() const; + TQIODevice *ioDevice() const; + TQString fileName() const; + int quality() const; + TQString description() const; + const char *parameters() const; + float gamma() const; + + void setImage(const TQImage &); + void setStatus(int); + void setFormat(const char *); + void setIODevice(TQIODevice *); + void setFileName(const TQString &); + void setQuality(int); + void setDescription(const TQString &); + void setParameters(const char *); + void setGamma(float); + + bool read(); + bool write(); + + static const char *imageFormat(const TQString &); + static const char *imageFormat(TQIODevice *); + static TQStrList inputFormats(); + static TQStrList outputFormats(); + +// static void defineIOHandler(const char *,const char *,const char *, +// image_io_handler,image_io_handler); + +private: + TQImageIO(const TQImageIO &); +}; + + +%If (TQt_IMAGE_TEXT) + +class TQImageTextKeyLang +{ +%TypeHeaderCode +#include <tqimage.h> +%End + +public: + TQImageTextKeyLang(const char *,const char *); + TQImageTextKeyLang(); + + TQCString key; + TQCString lang; +}; + +%End + + +%ModuleHeaderCode +const char **PyTQt_tqt_ListToArray(PyObject *lst); +%End + + +%ModuleCode +// Convert a list of strings to an array of strings on the heap. Also used by +// TQPixmap. +const char **PyTQt_tqt_ListToArray(PyObject *lst) +{ + SIP_SSIZE_T nstr; + const char **str, **sp; + + nstr = PyList_Size(lst); + + if ((str = (const char **)sipMalloc(nstr * sizeof (char *))) == NULL) + return NULL; + + // Convert the list. + sp = str; + + for (int i = 0; i < nstr; ++i) + { + PyObject *item = PyList_GetItem(lst, i); + const char *item_utf8 = sipString_AsUTF8String(&item); + + if (item_utf8 == NULL) + { + sipFree((void *)str); + return NULL; + } + + *sp++ = item_utf8; + } + + return str; +} +%End diff --git a/sip/tqt/tqinputdialog.sip b/sip/tqt/tqinputdialog.sip new file mode 100644 index 0000000..f64baa7 --- /dev/null +++ b/sip/tqt/tqinputdialog.sip @@ -0,0 +1,157 @@ +// This is the SIP interface definition for TQInputDialog. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQInputDialog (TQt v2.1+)</Title> +<FuncSynopsis> + <FuncDef>static TQString <Function>getText</Function></FuncDef> + <ParamDef>const TQString &<Parameter>caption</Parameter></ParamDef> + <ParamDef>const TQString &<Parameter>label</Parameter></ParamDef> + <ParamDef>const TQString &<Parameter>text</Parameter> = TQString::null</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> + <ParamDef>TQWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>TQString</Literal> result and the <Literal>ok</Literal> flag. +(TQt v2.1 - v2.3.1) +</Para> + +<FuncSynopsis> + <FuncDef>static TQString <Function>getText</Function></FuncDef> + <ParamDef>const TQString &<Parameter>caption</Parameter></ParamDef> + <ParamDef>const TQString &<Parameter>label</Parameter></ParamDef> + <ParamDef>TQLineEdit::EchoMode<Parameter>echo</Parameter></ParamDef> + <ParamDef>const TQString &<Parameter>text</Parameter> = TQString::null</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> + <ParamDef>TQWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>TQString</Literal> result and the <Literal>ok</Literal> flag. +(TQt v2.2 - v2.3.1) +</Para> + +<FuncSynopsis> + <FuncDef>static TQString <Function>getText</Function></FuncDef> + <ParamDef>const TQString &<Parameter>caption</Parameter></ParamDef> + <ParamDef>const TQString &<Parameter>label</Parameter></ParamDef> + <ParamDef>TQLineEdit::EchoMode<Parameter>echo</Parameter> = TQLineEdit::Normal</ParamDef> + <ParamDef>const TQString &<Parameter>text</Parameter> = TQString::null</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> + <ParamDef>TQWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>TQString</Literal> result and the <Literal>ok</Literal> flag. +(TQt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>static int <Function>getInteger</Function></FuncDef> + <ParamDef>const TQString &<Parameter>caption</Parameter></ParamDef> + <ParamDef>const TQString &<Parameter>label</Parameter></ParamDef> + <ParamDef>int <Parameter>num</Parameter> = 0</ParamDef> + <ParamDef>int <Parameter>from</Parameter> = -2147483647</ParamDef> + <ParamDef>int <Parameter>to</Parameter> = 2147483647</ParamDef> + <ParamDef>int <Parameter>step</Parameter> = 1</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> + <ParamDef>TQWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>int</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> + <FuncDef>static double <Function>getDouble</Function></FuncDef> + <ParamDef>const TQString &<Parameter>caption</Parameter></ParamDef> + <ParamDef>const TQString &<Parameter>label</Parameter></ParamDef> + <ParamDef>double <Parameter>num</Parameter> = 0</ParamDef> + <ParamDef>double <Parameter>from</Parameter> = -2147483647</ParamDef> + <ParamDef>double <Parameter>to</Parameter> = 2147483647</ParamDef> + <ParamDef>int <Parameter>step</Parameter> = 1</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> + <ParamDef>TQWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>double</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> + <FuncDef>static TQString <Function>getItem</Function></FuncDef> + <ParamDef>const TQString &<Parameter>caption</Parameter></ParamDef> + <ParamDef>const TQString &<Parameter>label</Parameter></ParamDef> + <ParamDef>const TQStringList &<Parameter>list</Parameter></ParamDef> + <ParamDef>int <Parameter>current</Parameter> = 0</ParamDef> + <ParamDef>bool <Parameter>editable</Parameter> = TRUE</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> + <ParamDef>TQWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>TQString</Literal> result and the <Literal>ok</Literal> flag. +</Para> +</Sect2> +%End + + +%If (TQt_INPUTDIALOG) + +class TQInputDialog : TQDialog +{ +%TypeHeaderCode +#include <tqinputdialog.h> +%End + +public: + static TQString getText(const TQString &,const TQString &, + TQLineEdit::EchoMode = TQLineEdit::Normal, + const TQString & = TQString::null, + bool * = 0,TQWidget * = 0,const char * = 0); + + static int getInteger(const TQString &,const TQString &,int = 0, + int = -2147483647,int = 2147483647,int = 1, + bool * = 0,TQWidget * = 0,const char * = 0); + + static double getDouble(const TQString &,const TQString &, + double = 0,double = -2147483647, + double = 2147483647,int = 1, + bool * = 0,TQWidget * = 0,const char * = 0); + + static TQString getItem(const TQString &,const TQString &, + const TQStringList &,int = 0,bool = TRUE, + bool * = 0,TQWidget * = 0,const char * = 0); + +private: + TQInputDialog(const TQInputDialog &); + ~TQInputDialog(); +}; + +%End diff --git a/sip/tqt/tqinterlacestyle.sip b/sip/tqt/tqinterlacestyle.sip new file mode 100644 index 0000000..7e4445f --- /dev/null +++ b/sip/tqt/tqinterlacestyle.sip @@ -0,0 +1,103 @@ +// This is the SIP interface definition for TQInterlaceStyle. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQInterlaceStyle (TQt v2.3.1+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const TQTabBar *<Parameter>sb</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>sb</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +</Para> +</Sect2> +%End + + +// Temporary until it is ported to TQt3. +%If (TQt_STYLE_INTERLACE) +%If (TQt_2_3_1 - TQt_3_0_0) + +class TQInterlaceStyle : TQMotifStyle +{ +%TypeHeaderCode +#include <tqinterlacestyle.h> +%End + +public: + TQInterlaceStyle(); + + void polish(TQApplication *); + void unPolish(TQApplication *); + void polish(TQWidget *); + void unPolish(TQWidget *); + int defaultFrameWidth() const; + TQRect pushButtonContentsRect(TQPushButton *); + void drawFocusRect(TQPainter *,const TQRect &,const TQColorGroup &, + const TQColor * = 0,bool = 0); + void drawButton(TQPainter *,int,int,int,int,const TQColorGroup &, + bool = 0,const TQBrush * = 0); + void drawButtonMask(TQPainter *,int,int,int,int); + void drawBevelButton(TQPainter *,int,int,int,int,const TQColorGroup &, + bool = 0,const TQBrush * = 0); + + void drawPushButton(TQPushButton *,TQPainter *); + TQSize indicatorSize() const; + void drawIndicator(TQPainter *,int,int,int,int,const TQColorGroup &, + int,bool = 0,bool = 1); + void drawIndicatorMask(TQPainter *,int,int,int,int,int); + TQSize exclusiveIndicatorSize() const; + void drawExclusiveIndicator(TQPainter *,int,int,int,int, + const TQColorGroup &,bool,bool = 0, + bool = 1); + void drawExclusiveIndicatorMask(TQPainter *,int,int,int,int,bool); + TQRect comboButtonRect(int,int,int,int); + void drawComboButton(TQPainter *,int,int,int,int,const TQColorGroup &, + bool,bool,bool,const TQBrush *); + void drawPushButtonLabel(TQPushButton *,TQPainter *); + void drawPanel(TQPainter *,int,int,int,int,const TQColorGroup &,bool,int, + const TQBrush *); + + void scrollBarMetrics(const TQScrollBar *,int &,int &,int &,int &); + + void drawScrollBarControls(TQPainter *,const TQScrollBar *,int,uint, + uint); + void drawSlider(TQPainter *,int,int,int,int,const TQColorGroup &, + Orientation,bool,bool); + void drawSliderMask(TQPainter *,int,int,int,int,Orientation,bool,bool); + void drawSliderGroove(TQPainter *,int,int,int,int,const TQColorGroup &, + TQCOORD,Orientation); + void drawSliderGrooveMask(TQPainter *,int,int,int,int,TQCOORD, + Orientation); + int splitterWidth() const; + void drawSplitter(TQPainter *,int,int,int,int,const TQColorGroup &, + Orientation); +}; + +%End +%End diff --git a/sip/tqt/tqiodevice.sip b/sip/tqt/tqiodevice.sip new file mode 100644 index 0000000..30ca235 --- /dev/null +++ b/sip/tqt/tqiodevice.sip @@ -0,0 +1,257 @@ +// This is the SIP interface definition for TQIODevice. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQIODevice</Title> +<Para> +<Literal>TQIODevice</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%ModuleHeaderCode +#include <tqiodevice.h> +%End + + +// Device access types. + +const int IO_Direct; +const int IO_Sequential; +const int IO_Combined; +const int IO_TypeMask; + +// Handling modes. + +const int IO_Raw; +const int IO_Async; + +// Device open modes. + +const int IO_ReadOnly; +const int IO_WriteOnly; +const int IO_ReadWrite; +const int IO_Append; +const int IO_Truncate; +const int IO_Translate; +const int IO_ModeMask; + +// Device state. + +const int IO_Open; +const int IO_StateMask; + +// Device status. + +const int IO_Ok; +const int IO_ReadError; +const int IO_WriteError; +const int IO_FatalError; +const int IO_ResourceError; +const int IO_OpenError; +const int IO_ConnectError; +const int IO_AbortError; +const int IO_TimeOutError; +const int IO_UnspecifiedError; + + +class TQIODevice +{ +%TypeHeaderCode +#include <tqiodevice.h> +%End + +public: + typedef TQ_ULONG Offset; + + TQIODevice(); + + int flags() const; + int mode() const; + int state() const; + bool isDirectAccess() const; + bool isSequentialAccess() const; + bool isCombinedAccess() const; + bool isBuffered() const; + bool isRaw() const; + bool isSynchronous() const; + bool isAsynchronous() const; + bool isTranslated() const; + bool isReadable() const; + bool isWritable() const; + bool isReadWrite() const; + bool isInactive() const; + bool isOpen() const; + + int status() const; + void resetStatus(); + + virtual bool open(int) = 0 /ReleaseGIL/; + virtual void close() = 0; + virtual void flush() = 0 /ReleaseGIL/; + + virtual Offset size() const = 0; + virtual Offset at() const; + virtual bool at(Offset); + virtual bool atEnd() const; + bool reset(); + + virtual SIP_PYOBJECT readBlock(TQ_ULONG) = 0 /ReleaseGIL/ [TQ_LONG (char *,TQ_ULONG)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + TQ_LONG actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipCpp -> readBlock(buf,a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + sipFree((void *)buf); + + Py_INCREF(Py_None); + sipRes = Py_None; + } + else + { + sipRes = PyBytes_FromStringAndSize(buf,actlen); + + sipFree((void *)buf); + + if (sipRes == NULL) + sipIsErr = 1; + } + } +%End +%VirtualCatcherCode + PyObject *result = sipCallMethod(&sipIsErr,sipMethod,"l",a1); + + if (result != NULL) + { + PyObject *buf; + + sipParseResult(&sipIsErr,sipMethod,result,"O",&buf); + + if (buf == Py_None) + sipRes = -1L; + else if (!PyBytes_Check(buf)) + { + sipBadCatcherResult(sipMethod); + sipIsErr = 1; + } + else + { + memcpy(a0,PyBytes_AS_STRING(buf),PyBytes_GET_SIZE(buf)); + sipRes = PyBytes_GET_SIZE(buf); + } + + Py_DECREF(buf); + Py_DECREF(result); + } +%End + + virtual TQ_LONG writeBlock(const char * /Array/, + TQ_ULONG /ArraySize/) = 0 /ReleaseGIL/; + + virtual SIP_PYOBJECT readLine(TQ_ULONG) /ReleaseGIL/ [TQ_LONG (char *,TQ_ULONG)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + TQ_LONG actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipSelfWasArg ? sipCpp->TQIODevice::readLine(buf, a0) : sipCpp->readLine(buf, a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + sipFree((void *)buf); + + Py_INCREF(Py_None); + sipRes = Py_None; + } + else + { + sipRes = PyBytes_FromStringAndSize(buf,actlen); + + sipFree((void *)buf); + + if (sipRes == NULL) + sipIsErr = 1; + } + } +%End +%VirtualCatcherCode + PyObject *result = sipCallMethod(&sipIsErr,sipMethod,"l",a1); + + if (result != NULL) + { + PyObject *buf; + + sipParseResult(&sipIsErr,sipMethod,result,"O",&buf); + + if (buf == Py_None) + sipRes = -1L; + else if (!PyBytes_Check(buf)) + { + sipBadCatcherResult(sipMethod); + sipIsErr = 1; + } + else + { + memcpy(a0,PyBytes_AS_STRING(buf),PyBytes_GET_SIZE(buf)); + sipRes = PyBytes_GET_SIZE(buf); + } + + Py_DECREF(buf); + Py_DECREF(result); + } +%End + + TQ_LONG writeBlock(const TQByteArray &) /ReleaseGIL/; + + virtual TQByteArray readAll() /ReleaseGIL/; + + virtual int getch() = 0 /ReleaseGIL/; + virtual int putch(int) = 0 /ReleaseGIL/; + virtual int ungetch(int) = 0; + +protected: + void setFlags(int); + void setType(int); + void setMode(int); + void setState(int); + void setStatus(int); + +private: + TQIODevice(const TQIODevice &); +}; diff --git a/sip/tqt/tqkeysequence.sip b/sip/tqt/tqkeysequence.sip new file mode 100644 index 0000000..8b94cfd --- /dev/null +++ b/sip/tqt/tqkeysequence.sip @@ -0,0 +1,113 @@ +// This is the SIP interface definition for TQKeySequence. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQKeySequence (TQt v3+)</Title> +<Para> +<Literal>TQKeySequence</Literal> is fully implemented including the operators +<Literal>==</Literal>, <Literal>!=</Literal>, <Literal>TQString()</Literal> and +<Literal>int()</Literal>. A <Literal>TQString</Literal> instance or a Python +integer may be used whenever a <Literal>TQKeySequence</Literal> can be used. +</Para> +</Sect2> +%End + + +class TQKeySequence : TQt +{ +%TypeHeaderCode +#include <tqkeysequence.h> +%End + +public: + TQKeySequence(); + TQKeySequence(const TQString &); + TQKeySequence(int); + TQKeySequence(int,int,int = 0,int = 0); + + bool operator==(const TQKeySequence &) const; + bool operator!=(const TQKeySequence &) const; + + uint count() const; + bool isEmpty() const; + TQt::SequenceMatch matches(const TQKeySequence &) const; + + int __int__() const; + +%ConvertToTypeCode + // Allow a TQString or a Python integer whenever a TQKeySequence is + // expected. + + if (sipIsErr == NULL) + { + if (sipCanConvertToInstance(sipPy,sipClass_TQKeySequence,SIP_NO_CONVERTORS)) + return 1; + + if (sipCanConvertToInstance(sipPy,sipClass_TQString,0)) + return 1; + + PyErr_Clear(); + + PyLong_AsLong(sipPy); + + return !PyErr_Occurred(); + } + + // We do this case before the int case because, otherwise, + // PyInt_AsLong() would achieve the same result but less efficiently. + + if (sipCanConvertToInstance(sipPy,sipClass_TQKeySequence,SIP_NO_CONVERTORS)) + { + *sipCppPtr = reinterpret_cast<TQKeySequence *>(sipConvertToInstance(sipPy,sipClass_TQKeySequence,sipTransferObj,SIP_NO_CONVERTORS,0,sipIsErr)); + + return 0; + } + + if (sipCanConvertToInstance(sipPy,sipClass_TQString,0)) + { + int state; + TQString *s = reinterpret_cast<TQString *>(sipConvertToInstance(sipPy,sipClass_TQString,0,0,&state,sipIsErr)); + + if (*sipIsErr) + { + sipReleaseInstance(s,sipClass_TQString,state); + return 0; + } + + Py_BEGIN_ALLOW_THREADS + *sipCppPtr = new TQKeySequence(*s); + Py_END_ALLOW_THREADS + + sipReleaseInstance(s,sipClass_TQString,state); + + return sipGetState(sipTransferObj); + } + + int key = (int)PyLong_AsLong(sipPy); + + Py_BEGIN_ALLOW_THREADS + *sipCppPtr = new TQKeySequence(key); + Py_END_ALLOW_THREADS + + return sipGetState(sipTransferObj); +%End +}; diff --git a/sip/tqt/tqlabel.sip b/sip/tqt/tqlabel.sip new file mode 100644 index 0000000..849b3a7 --- /dev/null +++ b/sip/tqt/tqlabel.sip @@ -0,0 +1,85 @@ +// This is the SIP interface definition for TQLabel. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +%DefaultEncoding "UTF-8" + +%ExportedDoc +<Sect2><Title>TQLabel</Title> +<Para> +<Literal>TQLabel</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQLabel : TQFrame +{ +%TypeHeaderCode +#include <tqlabel.h> +%End + +public: + TQLabel(TQWidget * /TransferThis/,const char * = 0,WFlags = 0); + TQLabel(const TQString &,TQWidget * /TransferThis/,const char * = 0,WFlags = 0); + TQLabel(TQWidget *,const TQString &,TQWidget * /TransferThis/,const char * = 0,WFlags = 0); + + TQString text() const; + TQPixmap *pixmap() const; + TQPicture *picture() const; + TQMovie *movie() const; + + TextFormat textFormat() const; + void setTextFormat(TextFormat); + + int alignment() const; + virtual void setAlignment(int); + int indent() const; + void setIndent(int); + + bool autoResize() const; + virtual void setAutoResize(bool); + bool hasScaledContents() const; + void setScaledContents(bool); + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + virtual void setBuddy(TQWidget *); + TQWidget *buddy() const; + int heightForWidth(int) const; + + void setFont(const TQFont &); + +public slots: + virtual void setText(const TQString &); + virtual void setPixmap(const TQPixmap &); + virtual void setPicture(const TQPicture &); + virtual void setMovie(const TQMovie &); + virtual void setNum(int /Constrained/); + virtual void setNum(double); + void clear(); + +protected: + void drawContents(TQPainter *); + void fontChange(const TQFont &); + void resizeEvent(TQResizeEvent *); + +private: + TQLabel(const TQLabel &); +}; diff --git a/sip/tqt/tqlayout.sip b/sip/tqt/tqlayout.sip new file mode 100644 index 0000000..82b86f2 --- /dev/null +++ b/sip/tqt/tqlayout.sip @@ -0,0 +1,458 @@ +// This is the SIP interface definition for TQBoxLayout, TQGLayoutIterator, +// TQGridLayout, TQHBoxLayout, TQLayout, TQLayoutItem, TQLayoutIterator, +// TQSpacerItem, TQVBoxLayout and TQWidgetItem. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQLayout</Title> +<Para> +<Literal>TQLayout</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQBoxLayout</Title> +<Para> +<Literal>TQBoxLayout</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQGLayoutIterator (TQt v2+)</Title> +<Para> +<Literal>TQGLayoutIterator</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQGridLayout</Title> +<FuncSynopsis> + <FuncDef>bool <Function>findWidget</Function></FuncDef> + <ParamDef>TQWidget *<Parameter>w</Parameter></ParamDef> + <ParamDef>int *<Parameter>row</Parameter></ParamDef> + <ParamDef>int *<Parameter>col</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>w</Literal> parameter and returns a tuple containing +the <Literal>bool</Literal> result, <Literal>row</Literal> and +<Literal>col</Literal>. (TQt v2+) +</Para> +</Sect2> + +<Sect2><Title>TQHBoxLayout</Title> +<Para> +<Literal>TQHBoxLayout</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQLayoutItem (TQt v2+)</Title> +<Para> +<Literal>TQLayoutItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQLayoutIterator (TQt v2+)</Title> +<FuncSynopsis> + <FuncDef>TQLayoutItem *<Function>next</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This is a wrapper around the <Literal>TQLayoutIterator</Literal> +<Literal>++</Literal> operator. +</Para> +</Sect2> + +<Sect2><Title>TQSpacerItem (TQt v2+)</Title> +<Para> +<Literal>TQSpacerItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQVBoxLayout</Title> +<Para> +<Literal>TQVBoxLayout</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQWidgetItem (TQt v2+)</Title> +<Para> +<Literal>TQWidgetItem</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQGLayoutIterator +{ +%TypeHeaderCode +#include <tqabstractlayout.h> +%End + +public: + virtual TQLayoutItem *next() = 0; + virtual TQLayoutItem *current() = 0; + virtual TQLayoutItem *takeCurrent() = 0 /TransferBack/; +}; + + +class TQLayoutIterator +{ +%TypeHeaderCode +#include <tqabstractlayout.h> +%End + +public: + TQLayoutIterator(TQGLayoutIterator *) /Default/; + TQLayoutIterator(const TQLayoutIterator &); + + TQLayoutItem *next(); +%MethodCode + Py_BEGIN_ALLOW_THREADS + sipRes = ++(*sipCpp); + Py_END_ALLOW_THREADS +%End + + TQLayoutItem *current(); + TQLayoutItem *takeCurrent() /TransferBack/; + void deleteCurrent(); +}; + + +class TQLayoutItem +{ +%TypeHeaderCode +#include <tqabstractlayout.h> +%End + +public: + TQLayoutItem(int = 0 ); + +%ConvertToSubClassCode + // Note that we let the TQObject sub-class code handle TQLayout and it's + // sub-classes. + if (sipCpp->widget()) + sipClass = sipClass_TQWidgetItem; + else if (sipCpp->spacerItem()) + sipClass = sipClass_TQSpacerItem; + else + sipClass = NULL; +%End + + virtual TQSize sizeHint() const = 0; + virtual TQSize minimumSize() const = 0; + virtual TQSize maximumSize() const = 0; + virtual TQSizePolicy::ExpandData expanding() const = 0; + virtual void setGeometry(const TQRect &) = 0; + virtual TQRect geometry() const = 0; + virtual bool isEmpty() const = 0; + virtual bool hasHeightForWidth() const; + virtual int heightForWidth(int) const; + virtual void invalidate(); + + virtual TQWidget *widget(); + virtual TQLayoutIterator iterator(); + virtual TQLayout *layout(); + virtual TQSpacerItem *spacerItem(); + + int alignment() const; + virtual void setAlignment(int); +}; + + +class TQSpacerItem : TQLayoutItem +{ +%TypeHeaderCode +#include <tqabstractlayout.h> +%End + +public: + TQSpacerItem(int,int,TQSizePolicy::SizeType = TQSizePolicy::Minimum, + TQSizePolicy::SizeType = TQSizePolicy::Minimum); + + void changeSize(int,int,TQSizePolicy::SizeType = TQSizePolicy::Minimum, + TQSizePolicy::SizeType = TQSizePolicy::Minimum); + TQSize sizeHint() const; + TQSize minimumSize() const; + TQSize maximumSize() const; + TQSizePolicy::ExpandData expanding() const; + bool isEmpty() const; + void setGeometry(const TQRect &); + TQRect geometry() const; + TQSpacerItem *spacerItem(); +}; + + +class TQWidgetItem : TQLayoutItem +{ +%TypeHeaderCode +#include <tqabstractlayout.h> +%End + +public: + TQWidgetItem(TQWidget *); + + TQSize sizeHint() const; + TQSize minimumSize() const; + TQSize maximumSize() const; + TQSizePolicy::ExpandData expanding() const; + bool isEmpty() const; + void setGeometry(const TQRect &) ; + TQRect geometry() const; + virtual TQWidget *widget(); + + bool hasHeightForWidth() const; + int heightForWidth(int) const; +}; + + +class TQLayout : TQObject, TQLayoutItem +{ +%TypeHeaderCode +#include <tqabstractlayout.h> +%End + +public: + enum ResizeMode { + FreeResize, + Minimum, + Fixed, + Auto + }; + + TQLayout(TQWidget * /TransferThis/,int = 0,int = -1,const char * = 0); + TQLayout(TQLayout * /TransferThis/,int = -1,const char * = 0); + TQLayout(int = -1,const char * = 0); + + int margin() const; + int spacing() const; + + virtual void setMargin(int); + virtual void setSpacing(int); + + int defaultBorder() const; + void freeze(int,int); + void freeze(); + + void setResizeMode(ResizeMode); + ResizeMode resizeMode() const; + + virtual void setMenuBar(TQMenuBar *); + TQMenuBar *menuBar() const; + + TQWidget *mainWidget(); + bool isTopLevel() const; + + virtual void setAutoAdd(bool); + bool autoAdd() const; + + void invalidate(); + TQRect geometry() const; + bool activate(); + + void add(TQWidget *); + virtual void addItem(TQLayoutItem * /Transfer/) = 0; + + void remove(TQWidget *); + void removeItem(TQLayoutItem * /TransferBack/); + + TQSizePolicy::ExpandData expanding() const; + TQSize minimumSize() const; + TQSize maximumSize() const; + virtual void setGeometry(const TQRect &) = 0; + virtual TQLayoutIterator iterator() = 0; + bool isEmpty() const; + + int totalHeightForWidth(int) const; + TQSize totalMinimumSize() const; + TQSize totalMaximumSize() const; + TQSize totalSizeHint() const; + TQLayout *layout(); + + bool supportsMargin() const; + + void setEnabled(bool); + bool isEnabled() const; + +protected: + bool eventFilter(TQObject *,TQEvent *); + void childEvent(TQChildEvent *); + void addChildLayout(TQLayout *); + void deleteAllItems(); + + void setSupportsMargin(bool); + TQRect alignmentRect(const TQRect &) const; + +private: + TQLayout(const TQLayout &); +}; + + +class TQGridLayout : TQLayout +{ +%TypeHeaderCode +#include <tqlayout.h> +%End + +public: + TQGridLayout(TQWidget * /TransferThis/,int = 1,int = 1,int = 0,int = -1,const char * = 0); + TQGridLayout(int = 1,int = 1,int = -1,const char * = 0); + TQGridLayout(TQLayout * /TransferThis/,int = 1,int = 1,int = -1,const char * = 0); + + TQSize sizeHint() const; + TQSize minimumSize() const; + TQSize maximumSize() const; + + virtual void setRowStretch(int,int); + virtual void setColStretch(int,int); + int rowStretch(int) const; + int colStretch(int) const; + + void setRowSpacing(int,int); + void setColSpacing(int,int); + int rowSpacing(int) const; + int colSpacing(int) const; + + int numRows() const; + int numCols() const; + TQRect cellGeometry(int,int) const; + + bool hasHeightForWidth() const; + int heightForWidth(int) const; + int minimumHeightForWidth(int) const; + + TQSizePolicy::ExpandData expanding() const; + void invalidate(); + + void addItem(TQLayoutItem * /Transfer/); + void addItem(TQLayoutItem * /Transfer/,int,int); + void addMultiCell(TQLayoutItem * /Transfer/,int,int,int,int,int = 0); + + void addWidget(TQWidget *,int,int,int = 0); + void addMultiCellWidget(TQWidget *,int,int,int,int,int = 0); + void addLayout(TQLayout * /Transfer/,int,int); + void addMultiCellLayout(TQLayout * /Transfer/,int,int,int,int,int = 0); + void addRowSpacing(int,int); + void addColSpacing(int,int); + void expand(int,int); + + enum Corner { + TopLeft, + TopRight, + BottomLeft, + BottomRight + }; + + void setOrigin(Corner); + Corner origin() const; + TQLayoutIterator iterator(); + void setGeometry(const TQRect &); + +protected: + bool findWidget(TQWidget *,int *,int *); + void add(TQLayoutItem * /Transfer/,int,int); + +private: + TQGridLayout(const TQGridLayout &); +}; + + +class TQBoxLayout : TQLayout +{ +%TypeHeaderCode +#include <tqlayout.h> +%End + +public: + enum Direction { + LeftToRight, + RightToLeft, + TopToBottom, + BottomToTop, + Down = TopToBottom, + Up = BottomToTop + }; + + TQBoxLayout(TQWidget * /TransferThis/,Direction,int = 0,int = -1,const char * = 0); + TQBoxLayout(TQLayout * /TransferThis/,Direction,int = -1,const char * = 0); + TQBoxLayout(Direction,int = -1,const char * = 0); + + Direction direction() const; + void setDirection(Direction); + void addSpacing(int); + void addStretch(int = 0); + void addLayout(TQLayout * /Transfer/,int = 0); + void addStrut(int); + void addItem(TQLayoutItem * /Transfer/); + void addWidget(TQWidget *,int = 0,int = 0); + void insertSpacing(int,int); + void insertStretch(int,int = 0); + void insertWidget(int,TQWidget *,int = 0,int = 0); + void insertLayout(int,TQLayout * /Transfer/,int = 0); + int findWidget(TQWidget *); + bool setStretchFactor(TQWidget *,int); + TQSize sizeHint() const; + TQSize minimumSize() const; + TQSize maximumSize() const; + bool hasHeightForWidth() const; + int heightForWidth(int) const; + int minimumHeightForWidth(int) const; + + TQSizePolicy::ExpandData expanding() const; + void invalidate(); + TQLayoutIterator iterator(); + void setGeometry(const TQRect &); + +protected: + void insertItem(int,TQLayoutItem * /Transfer/); + +private: + TQBoxLayout(const TQBoxLayout &); +}; + + +class TQHBoxLayout : TQBoxLayout +{ +%TypeHeaderCode +#include <tqlayout.h> +%End + +public: + TQHBoxLayout(TQWidget * /TransferThis/,int = 0,int = -1,const char * = 0); + TQHBoxLayout(TQLayout * /TransferThis/,int = -1,const char * = 0); + TQHBoxLayout(int = -1,const char * = 0); + +private: + TQHBoxLayout(const TQHBoxLayout &); +}; + + +class TQVBoxLayout : TQBoxLayout +{ +%TypeHeaderCode +#include <tqlayout.h> +%End + +public: + TQVBoxLayout(TQWidget * /TransferThis/,int = 0,int = -1,const char * = 0); + TQVBoxLayout(TQLayout * /TransferThis/,int = -1,const char * = 0); + TQVBoxLayout(int = -1,const char * = 0); + +private: + TQVBoxLayout(const TQVBoxLayout &); +}; diff --git a/sip/tqt/tqlcdnumber.sip b/sip/tqt/tqlcdnumber.sip new file mode 100644 index 0000000..ef8cb79 --- /dev/null +++ b/sip/tqt/tqlcdnumber.sip @@ -0,0 +1,93 @@ +// This is the SIP interface definition for TQLCDNumber. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +%DefaultEncoding "UTF-8" + +%ExportedDoc +<Sect2><Title>TQLCDNumber</Title> +<Para> +<Literal>TQLCDNumber</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQLCDNumber : TQFrame +{ +%TypeHeaderCode +#include <tqlcdnumber.h> +%End + +public: + TQLCDNumber(TQWidget * /TransferThis/ = 0,const char * = 0); + TQLCDNumber(uint,TQWidget * /TransferThis/ = 0,const char * = 0); + + enum Mode { + Hex, HEX = Hex, + Dec, DEC = Dec, + Oct, OCT = Oct, + Bin, BIN = Bin + }; + + enum SegmentStyle { + Outline, + Filled, + Flat + }; + + bool smallDecimalPoint() const; + + int numDigits() const; + virtual void setNumDigits(int); + + bool checkOverflow(int /Constrained/) const; + bool checkOverflow(double) const; + + Mode mode() const; + virtual void setMode(Mode); + + SegmentStyle segmentStyle() const; + virtual void setSegmentStyle(SegmentStyle); + + double value() const; + int intValue() const; + + TQSize sizeHint() const; + +public slots: + void display(const TQString &); + void display(int /Constrained/); + void display(double); + virtual void setHexMode(); + virtual void setDecMode(); + virtual void setOctMode(); + virtual void setBinMode(); + virtual void setSmallDecimalPoint(bool); + +signals: + void overflow(); + +protected: + void drawContents(TQPainter *); + +private: + TQLCDNumber(const TQLCDNumber &); +}; diff --git a/sip/tqt/tqlibrary.sip b/sip/tqt/tqlibrary.sip new file mode 100644 index 0000000..4d0a4cc --- /dev/null +++ b/sip/tqt/tqlibrary.sip @@ -0,0 +1,55 @@ +// This is the SIP interface definition for TQLibrary. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQLibrary (TQt v3+)</Title> +<Para> +<Literal>TQLibrary</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQLibrary +{ +%TypeHeaderCode +#include <tqlibrary.h> +%End + +public: + TQLibrary(const TQString &); + + void *resolve(const char *); + static void *resolve(const TQString &,const char *); + + bool load(); + virtual bool unload(); + bool isLoaded() const; + + bool autoUnload() const; + void setAutoUnload(bool); + + TQString library() const; + +private: + TQLibrary(const TQLibrary &); +}; diff --git a/sip/tqt/tqlineedit.sip b/sip/tqt/tqlineedit.sip new file mode 100644 index 0000000..23488c3 --- /dev/null +++ b/sip/tqt/tqlineedit.sip @@ -0,0 +1,209 @@ +// This is the SIP interface definition for TQLineEdit. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQLineEdit</Title> +<FuncSynopsis> + <FuncDef>int <Function>characterAt</Function></FuncDef> + <ParamDef>int <Parameter>xpos</Parameter></ParamDef> + <ParamDef>TQChar *<Parameter>chr</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>xpos</Literal> parameter and returns the int +result and the <Literal>chr</Literal> value as a tuple. (TQt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>del</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delChar</Literal> in Python. (TQt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>getSelection</Function></FuncDef> + <ParamDef>int *<Parameter>start</Parameter></ParamDef> + <ParamDef>int *<Parameter>end</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns the bool result and the +<Literal>start</Literal> and <Literal>end</Literal> values as a tuple. +(TQt v3+) +</Para> +</Sect2> +%End + + +class TQLineEdit : TQFrame +{ +%TypeHeaderCode +#include <tqlineedit.h> +%End + +public: + TQLineEdit(TQWidget * /TransferThis/,const char * = 0); + TQLineEdit(const TQString &,TQWidget * /TransferThis/,const char * = 0); + TQLineEdit(const TQString &,const TQString &,TQWidget * /TransferThis/, + const char * = 0); + + TQString text() const; + + TQString displayText() const; + + int maxLength() const; + + bool frame() const; + + enum EchoMode { + Normal, + NoEcho, + Password + }; + + EchoMode echoMode() const; + + bool isReadOnly() const; + + const TQValidator *validator() const; + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + + int cursorPosition() const; + // Obsolete. + bool validateAndSet(const TQString &,int,int,int); + + int alignment() const; + + void cursorForward(bool,int = 1); + void cursorBackward(bool,int = 1); + void cursorWordForward(bool); + void cursorWordBackward(bool); + void backspace(); + void del() /PyName=delChar/; + void home(bool); + void end(bool); + + bool isModified() const; + void clearModified(); + + // Obsolete. + bool edited() const; + // Obsolete. + void setEdited(bool); + + bool hasSelectedText() const; + TQString selectedText() const; + int selectionStart() const; + + bool isUndoAvailable() const; + bool isRedoAvailable() const; + + bool dragEnabled() const; + + TQString inputMask() const; + void setInputMask(const TQString &); + bool hasAcceptableInput() const; + +public slots: + virtual void setText(const TQString &); + virtual void selectAll(); + virtual void deselect(); + virtual void clearValidator(); + virtual void insert(const TQString &); + virtual void clear(); + virtual void undo(); + virtual void redo(); + virtual void setMaxLength(int); + virtual void setFrame(bool); + virtual void setEchoMode(EchoMode); + virtual void setReadOnly(bool); + virtual void setValidator(const TQValidator *); + virtual void setFont(const TQFont &); + virtual void setPalette(const TQPalette &); + virtual void setSelection(int,int); + virtual void setCursorPosition(int); + virtual void setAlignment(int); +%If (TQt_CLIPBOARD) + virtual void cut(); + virtual void copy() const; + virtual void paste(); +%End + virtual void setDragEnabled(bool); + +signals: + void textChanged(const TQString &); + void returnPressed(); + void lostFocus(); + void selectionChanged(); + +protected: + bool event(TQEvent *); + void mousePressEvent(TQMouseEvent *); + void mouseMoveEvent(TQMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); + void mouseDoubleClickEvent(TQMouseEvent *); + void keyPressEvent(TQKeyEvent *); + void imStartEvent(TQIMEvent *); + void imComposeEvent(TQIMEvent *); + void imEndEvent(TQIMEvent *); + void focusInEvent(TQFocusEvent *); + void focusOutEvent(TQFocusEvent *); + void resizeEvent(TQResizeEvent *); + void drawContents(TQPainter *); +%If (TQt_DRAGANDDROP) + void dragEnterEvent(TQDragEnterEvent *); + void dragMoveEvent(TQDragMoveEvent *); + void dragLeaveEvent(TQDragLeaveEvent *); + void dropEvent(TQDropEvent *); +%End + void contextMenuEvent(TQContextMenuEvent *); + virtual TQPopupMenu *createPopupMenu() /Factory/; + void windowActivationChange(bool); + +public: + // These appeared in v3.0.2 but defined as incompatible 3.0 addons, + // until v3.1.0. v3.2.0 then defined them as internal and obsolete. + void setPasswordChar(TQChar); + TQChar passwordChar() const; + + // Obsolete. + SIP_PYTUPLE characterAt(int) const; +%MethodCode + int res; + TQChar *chr; + + Py_BEGIN_ALLOW_THREADS + chr = new TQChar(); + res = sipCpp -> characterAt(a0,chr); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr,"(iB)",res,chr,sipClass_TQChar,NULL); +%End + + // Obsolete. + bool getSelection(int *,int *); + +private: + TQLineEdit(const TQLineEdit &); +}; diff --git a/sip/tqt/tqlistbox.sip b/sip/tqt/tqlistbox.sip new file mode 100644 index 0000000..9efb272 --- /dev/null +++ b/sip/tqt/tqlistbox.sip @@ -0,0 +1,333 @@ +// This is the SIP interface definition for TQListBox, TQListBoxItem, +// TQListBoxPixmap and TQListBoxText. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQListBox</Title> +<FuncSynopsis> + <FuncDef>bool <Function>itemYPos</Function></FuncDef> + <ParamDef>int <Parameter>index</Parameter></ParamDef> + <ParamDef>int *<Parameter>yPos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>index</Literal> parameter and returns a tuple +containing the <Literal>bool</Literal> result and <Literal>yPos</Literal>. +(TQt v1.x) +</Para> +</Sect2> + +<Sect2><Title>TQListBoxItem</Title> +<Para> +<Literal>TQListBoxItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQListBoxPixmap</Title> +<Para> +<Literal>TQListBoxPixmap</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQListBoxText</Title> +<Para> +<Literal>TQListBoxText</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQListBox : TQScrollView +{ +%TypeHeaderCode +#include <tqlistbox.h> +%End + +public: + TQListBox(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + virtual void setFont(const TQFont &); + + uint count() const; + + void insertStringList(const TQStringList &,int = -1); + void insertStrList(const TQStrList *,int = -1); +// void insertStrList(const TQStrList &,int = -1); +// void insertStrList(const char **,int = -1,int = -1); + + void insertItem(const TQListBoxItem * /Transfer/,int = -1); + void insertItem(const TQListBoxItem * /Transfer/,const TQListBoxItem *); + void insertItem(const TQString &,int = -1); + void insertItem(const TQPixmap &,int = -1); + void insertItem(const TQPixmap &,const TQString &,int = -1); + + void removeItem(int); + + TQString text(int) const; + const TQPixmap *pixmap(int) const; + + void changeItem(const TQListBoxItem * /Transfer/,int); + void changeItem(const TQString &,int); + void changeItem(const TQPixmap &,int); + void changeItem(const TQPixmap &,const TQString &,int); + + void takeItem(const TQListBoxItem * /TransferBack/); + + int numItemsVisible() const; + + int currentItem() const; + TQString currentText() const; + virtual void setCurrentItem(int); + virtual void setCurrentItem(TQListBoxItem *); + void centerCurrentItem(); + int topItem() const; + virtual void setTopItem(int); + virtual void setBottomItem(int); + + long maxItemWidth() const; + + enum SelectionMode { + Single, + Multi, + Extended, + NoSelection + }; + + virtual void setSelectionMode(SelectionMode); + SelectionMode selectionMode() const; + + void setMultiSelection(bool); + bool isMultiSelection() const; + + virtual void setSelected(TQListBoxItem *,bool); + void setSelected(int,bool); + bool isSelected(int) const; + bool isSelected(TQListBoxItem *) const; + TQListBoxItem *selectedItem() const; + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + + TQListBoxItem *item(int) const; + int index(const TQListBoxItem *) const; + TQListBoxItem *findItem(const TQString &, + ComparisonFlags = BeginsWith) const; + + void triggerUpdate(bool); + + bool itemVisible(int); + bool itemVisible(const TQListBoxItem *); + + enum LayoutMode { + FixedNumber, + FitToWidth, + FitToHeight = FitToWidth, + Variable + }; + + virtual void setColumnMode(LayoutMode /Constrained/); + virtual void setColumnMode(int); + virtual void setRowMode(LayoutMode /Constrained/); + virtual void setRowMode(int); + + LayoutMode columnMode() const; + LayoutMode rowMode() const; + + int numColumns() const; + int numRows() const; + + bool variableWidth() const; + virtual void setVariableWidth(bool); + + bool variableHeight() const; + virtual void setVariableHeight(bool); + + void viewportPaintEvent(TQPaintEvent *); + + int itemHeight(int = 0) const; + TQListBoxItem *itemAt(TQPoint) const; + + TQRect itemRect(TQListBoxItem *) const; + + TQListBoxItem *firstItem() const; + + void sort(bool = 1); + +public slots: + void clear(); + virtual void ensureCurrentVisible(); + virtual void clearSelection(); + virtual void selectAll(bool); + virtual void invertSelection(); + +signals: + void highlighted(int); + void selected(int); + void highlighted(const TQString &); + void selected(const TQString &); + void highlighted(TQListBoxItem *); + void selected(TQListBoxItem *); + + void selectionChanged(); + void selectionChanged(TQListBoxItem *); + void currentChanged(TQListBoxItem *); + void clicked(TQListBoxItem *); + void clicked(TQListBoxItem *,const TQPoint &); + void pressed(TQListBoxItem *); + void pressed(TQListBoxItem *,const TQPoint &); + + void doubleClicked(TQListBoxItem *); + void returnPressed(TQListBoxItem *); + void rightButtonClicked(TQListBoxItem *,const TQPoint &); + void rightButtonPressed(TQListBoxItem *,const TQPoint &); + void mouseButtonPressed(int,TQListBoxItem *,const TQPoint &); + void mouseButtonClicked(int,TQListBoxItem *,const TQPoint &); + + void contextMenuRequested(TQListBoxItem *,const TQPoint &); + + void onItem(TQListBoxItem *); + void onViewport(); + +protected: + void mousePressEvent(TQMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); + void mouseDoubleClickEvent(TQMouseEvent *); + void mouseMoveEvent(TQMouseEvent *); + + void keyPressEvent(TQKeyEvent *); + void focusInEvent(TQFocusEvent *); + void focusOutEvent(TQFocusEvent *); + void resizeEvent(TQResizeEvent *); + void showEvent(TQShowEvent *); + + bool eventFilter(TQObject *,TQEvent *); + + void updateItem(int); + void updateItem(TQListBoxItem *); + + virtual void paintCell(TQPainter *,int,int); + + void toggleCurrentItem(); + bool isRubberSelecting() const; + + void doLayout() const; + + void windowActivationChange(bool); + +protected slots: + void clearInputString(); + +private: + TQListBox(const TQListBox &); +}; + + +class TQListBoxItem +{ +%TypeHeaderCode +#include <tqlistbox.h> +%End + +public: + TQListBoxItem(TQListBox * /TransferThis/ = 0); + TQListBoxItem(TQListBox * /TransferThis/,TQListBoxItem *); + + virtual TQString text() const; + virtual const TQPixmap *pixmap() const; + + virtual int height(const TQListBox *) const; + virtual int width(const TQListBox *) const; + + bool isSelected() const; + bool isCurrent() const; + + TQListBox *listBox() const; + + void setSelectable(bool); + bool isSelectable() const; + + TQListBoxItem *next() const; + TQListBoxItem *prev() const; + + virtual int rtti() const; + +protected: + virtual void paint(TQPainter *) = 0; + virtual void setText(const TQString &); + void setCustomHighlighting(bool); + +private: + TQListBoxItem(const TQListBoxItem &); +}; + +class TQListBoxText : TQListBoxItem +{ +%TypeHeaderCode +#include <tqlistbox.h> +%End + +public: + TQListBoxText(TQListBox * /TransferThis/, + const TQString & = TQString::null); + TQListBoxText(const TQString & = TQString::null); + TQListBoxText(TQListBox * /TransferThis/,const TQString &,TQListBoxItem *); + + int height(const TQListBox *) const; + int width(const TQListBox *) const; + + int rtti() const; + +protected: + void paint(TQPainter *); + +private: + TQListBoxText(const TQListBoxText &); +}; + +class TQListBoxPixmap : TQListBoxItem +{ +%TypeHeaderCode +#include <tqlistbox.h> +%End + +public: + TQListBoxPixmap(TQListBox * /TransferThis/,const TQPixmap &); + TQListBoxPixmap(const TQPixmap &); + TQListBoxPixmap(TQListBox * /TransferThis/,const TQPixmap &, + TQListBoxItem *); + TQListBoxPixmap(TQListBox * /TransferThis/,const TQPixmap &, + const TQString &); + TQListBoxPixmap(const TQPixmap &,const TQString &); + TQListBoxPixmap(TQListBox * /TransferThis/,const TQPixmap &, + const TQString &,TQListBoxItem *); + + const TQPixmap *pixmap() const; + int height(const TQListBox *) const; + int width(const TQListBox *) const; + + int rtti() const; + +protected: + void paint(TQPainter *); + +private: + TQListBoxPixmap(const TQListBoxPixmap &); +}; diff --git a/sip/tqt/tqlistview.sip b/sip/tqt/tqlistview.sip new file mode 100644 index 0000000..fa2a5ab --- /dev/null +++ b/sip/tqt/tqlistview.sip @@ -0,0 +1,491 @@ +// This is the SIP interface definition for TQListView, TQListViewItem, +// TQCheckListItem and TQListViewItemIterator. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQListView</Title> +<Para> +<Literal>TQListView</Literal> is fully implemented. +</Para> +<Para> +Note that to remove a child <Literal>TQListViewItem</Literal> you must first +call <Literal>takeItem()</Literal> and then <Literal>del()</Literal>. +</Para> +</Sect2> + +<Sect2><Title>TQListViewItem</Title> +<Para> +<Literal>TQListViewItem</Literal> is fully implemented. +</Para> +<Para> +Note that to remove a child <Literal>TQListViewItem</Literal> you must first +call <Literal>takeItem()</Literal> and then <Literal>del()</Literal>. +</Para> +</Sect2> + +<Sect2><Title>TQCheckListItem</Title> +<Para> +<Literal>TQCheckListItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQListViewItemIterator (TQt v2+)</Title> +<Para> +<Literal>TQListViewItemIterator</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQListViewItem : TQt +{ +%TypeHeaderCode +#include <tqlistview.h> +%End + +public: + TQListViewItem(TQListView * /TransferThis/); + TQListViewItem(TQListViewItem * /TransferThis/); + TQListViewItem(TQListView * /TransferThis/,TQListViewItem *); + TQListViewItem(TQListViewItem * /TransferThis/,TQListViewItem *); + + TQListViewItem(TQListView * /TransferThis/, + TQString,TQString = TQString::null, + TQString = TQString::null,TQString = TQString::null, + TQString = TQString::null,TQString = TQString::null, + TQString = TQString::null,TQString = TQString::null); + + TQListViewItem(TQListViewItem * /TransferThis/, + TQString,TQString = TQString::null, + TQString = TQString::null,TQString = TQString::null, + TQString = TQString::null,TQString = TQString::null, + TQString = TQString::null,TQString = TQString::null); + + TQListViewItem(TQListView * /TransferThis/,TQListViewItem *, + TQString,TQString = TQString::null, + TQString = TQString::null,TQString = TQString::null, + TQString = TQString::null,TQString = TQString::null, + TQString = TQString::null,TQString = TQString::null); + + TQListViewItem(TQListViewItem * /TransferThis/,TQListViewItem *, + TQString,TQString = TQString::null, + TQString = TQString::null,TQString = TQString::null, + TQString = TQString::null,TQString = TQString::null, + TQString = TQString::null,TQString = TQString::null); + + virtual void insertItem(TQListViewItem * /Transfer/); + virtual void takeItem(TQListViewItem * /TransferBack/); + + int height() const; + virtual void invalidateHeight(); + int totalHeight() const; + virtual int width(const TQFontMetrics &,const TQListView *,int) const; + void widthChanged(int = -1) const; + int depth() const; + + virtual void setText(int,const TQString &); + virtual TQString text(int) const; + + virtual void setPixmap(int,const TQPixmap &); + virtual const TQPixmap *pixmap(int) const; + + virtual TQString key(int,bool) const; + virtual int compare(TQListViewItem *,int,bool) const; + virtual void sortChildItems(int,bool); + + int childCount() const; + + bool isOpen() const; + virtual void setOpen(bool); + virtual void setup(); + + virtual void setSelected(bool); + bool isSelected() const; + + virtual void paintCell(TQPainter *,const TQColorGroup &,int,int,int); + virtual void paintBranches(TQPainter *,const TQColorGroup &,int,int,int); + virtual void paintFocus(TQPainter *,const TQColorGroup &,const TQRect &); + + TQListViewItem *firstChild() const; + TQListViewItem *nextSibling() const; + TQListViewItem *parent() const; + + TQListViewItem *itemAbove(); + TQListViewItem *itemBelow(); + + int itemPos() const; + + TQListView *listView() const; + + virtual void setSelectable(bool); + bool isSelectable() const; + + virtual void setExpandable(bool); + bool isExpandable(); + + void repaint() const; + + virtual void sort(); + void moveItem(TQListViewItem *); + + virtual void setDragEnabled(bool); + virtual void setDropEnabled(bool); + bool dragEnabled() const; + bool dropEnabled() const; + virtual bool acceptDrop(const TQMimeSource *) const; + + void setVisible(bool); + bool isVisible() const; + + virtual void setRenameEnabled(int,bool); + bool renameEnabled(int) const; + virtual void startRename(int); + + virtual void setEnabled(bool); + bool isEnabled() const; + + virtual int rtti() const; + + virtual void setMultiLinesEnabled(bool); + bool multiLinesEnabled() const; + +protected: + virtual void enforceSortOrder() const; + virtual void setHeight(int); + virtual void activate(); + + bool activatedPos(TQPoint &); + virtual void dropped(TQDropEvent *); + virtual void dragEntered(); + virtual void dragLeft(); + virtual void okRename(int); + virtual void cancelRename(int); + + void ignoreDoubleClick(); +}; + + +class TQListView : TQScrollView +{ +%TypeHeaderCode +#include <tqlistview.h> +%End + +public: + TQListView(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + int treeStepSize() const; + virtual void setTreeStepSize(int); + + virtual void insertItem(TQListViewItem * /Transfer/); + virtual void takeItem(TQListViewItem * /TransferBack/); + + TQHeader *header() const; + + virtual int addColumn(const TQString &,int = -1); + virtual int addColumn(const TQIconSet &,const TQString &,int = -1); + void removeColumn(int); + virtual void setColumnText(int,const TQString &); + virtual void setColumnText(int,const TQIconSet &,const TQString &); + TQString columnText(int) const; + virtual void setColumnWidth(int,int); + int columnWidth(int) const; + + enum WidthMode + { + Manual, + Maximum + }; + + virtual void setColumnWidthMode(int,WidthMode); + WidthMode columnWidthMode(int) const; + int columns() const; + + virtual void setColumnAlignment(int,int); + int columnAlignment(int) const; + + void show(); + + TQListViewItem *itemAt(const TQPoint &) const; + TQRect itemRect(const TQListViewItem *) const; + int itemPos(const TQListViewItem *); + + void ensureItemVisible(const TQListViewItem *); + + void repaintItem(const TQListViewItem *) const; + + virtual void setMultiSelection(bool); + bool isMultiSelection() const; + + enum SelectionMode { + Single, + Multi, + Extended, + NoSelection + }; + + void setSelectionMode(SelectionMode); + SelectionMode selectionMode() const; + + virtual void clearSelection(); + virtual void setSelected(TQListViewItem *,bool); + void setSelectionAnchor(TQListViewItem *); + bool isSelected(TQListViewItem *) const; + TQListViewItem *selectedItem() const; + virtual void setOpen(TQListViewItem *,bool); + bool isOpen(TQListViewItem *) const; + + virtual void setCurrentItem(TQListViewItem *); + TQListViewItem *currentItem() const; + + TQListViewItem *firstChild() const; + TQListViewItem *lastItem() const; + + int childCount() const; + + virtual void setAllColumnsShowFocus(bool); + bool allColumnsShowFocus() const; + + virtual void setItemMargin(int); + int itemMargin() const; + + virtual void setRootIsDecorated(bool); + bool rootIsDecorated() const; + + virtual void setSorting(int,bool = 1); + int sortColumn() const; + void setSortColumn(int); + SortOrder sortOrder() const; + void setSortOrder(SortOrder); + virtual void sort(); + + virtual void setFont(const TQFont &); + virtual void setPalette(const TQPalette &); + + bool eventFilter(TQObject *,TQEvent *); + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + + void setShowSortIndicator(bool); + bool showSortIndicator() const; + virtual void setShowToolTips(bool); + bool showToolTips() const; + + enum ResizeMode { + NoColumn, + AllColumns, + LastColumn + }; + + virtual void setResizeMode(ResizeMode); + ResizeMode resizeMode() const; + + TQListViewItem *findItem(const TQString &,int, + ComparisonFlags = ExactMatch | CaseSensitive) const; + + enum RenameAction { + Accept, + Reject + }; + + virtual void setDefaultRenameAction(RenameAction); + RenameAction defaultRenameAction() const; + bool isRenaming() const; + + void hideColumn(int); + +public slots: + virtual void clear(); + void invertSelection(); + void selectAll(bool); + void setContentsPos(int,int); + void triggerUpdate(); + void adjustColumn(int); + +signals: + void selectionChanged(); + void selectionChanged(TQListViewItem *); + void currentChanged(TQListViewItem *); + void clicked(TQListViewItem *); + void clicked(TQListViewItem *,const TQPoint &,int); + void pressed(TQListViewItem *); + void pressed(TQListViewItem *,const TQPoint &,int); + + void doubleClicked(TQListViewItem *); + void doubleClicked(TQListViewItem *,const TQPoint &,int); + void returnPressed(TQListViewItem *); + void spacePressed(TQListViewItem *); + void rightButtonClicked(TQListViewItem *,const TQPoint &,int); + void rightButtonPressed(TQListViewItem *,const TQPoint &,int); + void mouseButtonPressed(int,TQListViewItem *,const TQPoint &,int); + void mouseButtonClicked(int,TQListViewItem *,const TQPoint &,int); + + void contextMenuRequested(TQListViewItem *,const TQPoint &,int); + + void onItem(TQListViewItem *); + void onViewport(); + + void expanded(TQListViewItem *); + void collapsed(TQListViewItem *); + void dropped(TQDropEvent *); + void itemRenamed(TQListViewItem *,int,const TQString &); + void itemRenamed(TQListViewItem *,int); + +protected: + void contentsMousePressEvent(TQMouseEvent *); + void contentsMouseReleaseEvent(TQMouseEvent *); + void contentsMouseMoveEvent(TQMouseEvent *); + void contentsMouseDoubleClickEvent(TQMouseEvent *); + void contentsContextMenuEvent(TQContextMenuEvent *); + void contentsDragEnterEvent(TQDragEnterEvent *); + void contentsDragMoveEvent(TQDragMoveEvent *); + void contentsDragLeaveEvent(TQDragLeaveEvent *); + void contentsDropEvent(TQDropEvent *); + virtual TQDragObject *dragObject(); + virtual void startDrag(); + + void focusInEvent(TQFocusEvent *); + void focusOutEvent(TQFocusEvent *); + + void keyPressEvent(TQKeyEvent *); + + void resizeEvent(TQResizeEvent *); + void viewportResizeEvent(TQResizeEvent *); + + void showEvent(TQShowEvent *); + + void drawContentsOffset(TQPainter *,int,int,int,int,int,int); + + virtual void paintEmptyArea(TQPainter *,const TQRect &); + void styleChange(TQStyle &); + void windowActivationChange(bool); + +protected slots: + void updateContents(); + void doAutoScroll(); + +private: + TQListView(const TQWidget &); +}; + + +class TQCheckListItem : TQListViewItem +{ +%TypeHeaderCode +#include <tqlistview.h> +%End + +public: + enum Type { + RadioButton, + CheckBox, + Controller, + RadioButtonController, + CheckBoxController, + }; + + enum ToggleState { + Off, + NoChange, + On + }; + + TQCheckListItem(TQCheckListItem * /TransferThis/,const TQString &, + Type = RadioButtonController); + TQCheckListItem(TQCheckListItem * /TransferThis/,TQListViewItem *, + const TQString &,Type = RadioButtonController); + TQCheckListItem(TQListViewItem * /TransferThis/,const TQString &, + Type = RadioButtonController); + TQCheckListItem(TQListViewItem * /TransferThis/,TQListViewItem *, + const TQString &,Type = RadioButtonController); + TQCheckListItem(TQListView * /TransferThis/,const TQString &, + Type = RadioButtonController); + TQCheckListItem(TQListView * /TransferThis/,TQListViewItem *, + const TQString &,Type = RadioButtonController); + TQCheckListItem(TQListViewItem * /TransferThis/,const TQString &, + const TQPixmap &); + TQCheckListItem(TQListView * /TransferThis/,const TQString &, + const TQPixmap &); + + void paintCell(TQPainter *,const TQColorGroup &,int,int,int); + virtual void paintFocus(TQPainter *,const TQColorGroup &,const TQRect &); + int width(const TQFontMetrics &,const TQListView *,int) const; + void setup(); + + virtual void setOn(bool); + bool isOn() const; + Type type() const; + TQString text() const; + TQString text(int) const; + + void setTristate(bool); + bool isTristate() const; + ToggleState state() const; + void setState(ToggleState); + + int rtti() const; + +protected: + void activate(); + void turnOffChild(); + virtual void stateChange(bool); +}; + + +class TQListViewItemIterator +{ +%TypeHeaderCode +#include <tqlistview.h> +%End + +public: + enum IteratorFlag { + Visible, + Invisible, + Selected, + Unselected, + Selectable, + NotSelectable, + DragEnabled, + DragDisabled, + DropEnabled, + DropDisabled, + Expandable, + NotExpandable, + Checked, + NotChecked + }; + + TQListViewItemIterator(); + TQListViewItemIterator(TQListViewItem *); + TQListViewItemIterator(TQListViewItem *,int); + + TQListViewItemIterator(const TQListViewItemIterator &); + TQListViewItemIterator(TQListView *); + TQListViewItemIterator(TQListView *,int); + + TQListViewItemIterator &operator+=(int); + TQListViewItemIterator &operator-=(int); + + TQListViewItem *current() const; +}; diff --git a/sip/tqt/tqlocale.sip b/sip/tqt/tqlocale.sip new file mode 100644 index 0000000..5352ac0 --- /dev/null +++ b/sip/tqt/tqlocale.sip @@ -0,0 +1,533 @@ +// This is the SIP interface definition for TQLocale. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQLocale (TQt v3.3+)</Title> +<FuncSynopsis> + <FuncDef>short <Function>toShort</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>short</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>ushort <Function>toUShort</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>ushort</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>toInt</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>int</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>uint <Function>toUInt</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>uint</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>TQ_LONG <Function>toLong</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>long</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>TQ_ULONG <Function>toULong</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>ulong</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>float <Function>toFloat</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>float</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>double <Function>toDouble</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>double</Literal> result and the +<Literal>ok</Literal> value. +</Para> +</Sect2> +%End + + +class TQLocale +{ +%TypeHeaderCode +#include <tqlocale.h> +%End + +public: + enum Language { + C, + Abkhazian, + Afan, + Afar, + Afrikaans, + Albanian, + Amharic, + Arabic, + Armenian, + Assamese, + Aymara, + Azerbaijani, + Bashkir, + Basque, + Bengali, + Bhutani, + Bihari, + Bislama, + Breton, + Bulgarian, + Burmese, + Byelorussian, + Cambodian, + Catalan, + Chinese, + Corsican, + Croatian, + Czech, + Danish, + Dutch, + English, + Esperanto, + Estonian, + Faroese, + FijiLanguage, + Finnish, + French, + Frisian, + Gaelic, + Galician, + Georgian, + German, + Greek, + Greenlandic, + Guarani, + Gujarati, + Hausa, + Hebrew, + Hindi, + Hungarian, + Icelandic, + Indonesian, + Interlingua, + Interlingue, + Inuktitut, + Inupiak, + Irish, + Italian, + Japanese, + Javanese, + Kannada, + Kashmiri, + Kazakh, + Kinyarwanda, + Kirghiz, + Korean, + Kurdish, + Kurundi, + Laothian, + Latin, + Latvian, + Lingala, + Lithuanian, + Macedonian, + Malagasy, + Malay, + Malayalam, + Maltese, + Maori, + Marathi, + Moldavian, + Mongolian, + NauruLanguage, + Nepali, + Norwegian, + Occitan, + Oriya, + Pashto, + Persian, + Polish, + Portuguese, + Punjabi, + Quechua, + RhaetoRomance, + Romanian, + Russian, + Samoan, + Sangho, + Sanskrit, + Serbian, + SerboCroatian, + Sesotho, + Setswana, + Shona, + Sindhi, + Singhalese, + Siswati, + Slovak, + Slovenian, + Somali, + Spanish, + Sundanese, + Swahili, + Swedish, + Tagalog, + Tajik, + Tamil, + Tatar, + Telugu, + Thai, + Tibetan, + Tigrinya, + TongaLanguage, + Tsonga, + Turkish, + Turkmen, + Twi, + Uigur, + Ukrainian, + Urdu, + Uzbek, + Vietnamese, + Volapuk, + Welsh, + Wolof, + Xhosa, + Yiddish, + Yoruba, + Zhuang, + Zulu, + LastLanguage + }; + + enum Country { + AnyCountry, + Afghanistan, + Albania, + Algeria, + AmericanSamoa, + Andorra, + Angola, + Anguilla, + Antarctica, + AntiguaAndBarbuda, + Argentina, + Armenia, + Aruba, + Australia, + Austria, + Azerbaijan, + Bahamas, + Bahrain, + Bangladesh, + Barbados, + Belarus, + Belgium, + Belize, + Benin, + Bermuda, + Bhutan, + Bolivia, + BosniaAndHerzegowina, + Botswana, + BouvetIsland, + Brazil, + BritishIndianOceanTerritory, + BruneiDarussalam, + Bulgaria, + BurkinaFaso, + Burundi, + Cambodia, + Cameroon, + Canada, + CapeVerde, + CaymanIslands, + CentralAfricanRepublic, + Chad, + Chile, + China, + ChristmasIsland, + CocosIslands, + Colombia, + Comoros, + DemocraticRepublicOfCongo, + PeoplesRepublicOfCongo, + CookIslands, + CostaRica, + IvoryCoast, + Croatia, + Cuba, + Cyprus, + CzechRepublic, + Denmark, + Djibouti, + Dominica, + DominicanRepublic, + EastTimor, + Ecuador, + Egypt, + ElSalvador, + EquatorialGuinea, + Eritrea, + Estonia, + Ethiopia, + FalklandIslands, + FaroeIslands, + FijiCountry, + Finland, + France, + MetropolitanFrance, + FrenchGuiana, + FrenchPolynesia, + FrenchSouthernTerritories, + Gabon, + Gambia, + Georgia, + Germany, + Ghana, + Gibraltar, + Greece, + Greenland, + Grenada, + Guadeloupe, + Guam, + Guatemala, + Guinea, + GuineaBissau, + Guyana, + Haiti, + HeardAndMcDonaldIslands, + Honduras, + HongKong, + Hungary, + Iceland, + India, + Indonesia, + Iran, + Iraq, + Ireland, + Israel, + Italy, + Jamaica, + Japan, + Jordan, + Kazakhstan, + Kenya, + Kiribati, + DemocraticRepublicOfKorea, + RepublicOfKorea, + Kuwait, + Kyrgyzstan, + Lao, + Latvia, + Lebanon, + Lesotho, + Liberia, + LibyanArabJamahiriya, + Liechtenstein, + Lithuania, + Luxembourg, + Macau, + Macedonia, + Madagascar, + Malawi, + Malaysia, + Maldives, + Mali, + Malta, + MarshallIslands, + Martinique, + Mauritania, + Mauritius, + Mayotte, + Mexico, + Micronesia, + Moldova, + Monaco, + Mongolia, + Montserrat, + Morocco, + Mozambique, + Myanmar, + Namibia, + NauruCountry, + Nepal, + Netherlands, + NetherlandsAntilles, + NewCaledonia, + NewZealand, + Nicaragua, + Niger, + Nigeria, + Niue, + NorfolkIsland, + NorthernMarianaIslands, + Norway, + Oman, + Pakistan, + Palau, + PalestinianTerritory, + Panama, + PapuaNewGuinea, + Paraguay, + Peru, + Philippines, + Pitcairn, + Poland, + Portugal, + PuertoRico, + Qatar, + Reunion, + Romania, + RussianFederation, + Rwanda, + SaintKittsAndNevis, + StLucia, + StVincentAndTheGrenadines, + Samoa, + SanMarino, + SaoTomeAndPrincipe, + SaudiArabia, + Senegal, + Seychelles, + SierraLeone, + Singapore, + Slovakia, + Slovenia, + SolomonIslands, + Somalia, + SouthAfrica, + SouthGeorgiaAndTheSouthSandwichIslands, + Spain, + SriLanka, + StHelena, + StPierreAndMiquelon, + Sudan, + Suriname, + SvalbardAndJanMayenIslands, + Swaziland, + Sweden, + Switzerland, + SyrianArabRepublic, + Taiwan, + Tajikistan, + Tanzania, + Thailand, + Togo, + Tokelau, + TongaCountry, + TrinidadAndTobago, + Tunisia, + Turkey, + Turkmenistan, + TurksAndCaicosIslands, + Tuvalu, + Uganda, + Ukraine, + UnitedArabEmirates, + UnitedKingdom, + UnitedStates, + UnitedStatesMinorOutlyingIslands, + Uruguay, + Uzbekistan, + Vanuatu, + VaticanCityState, + Venezuela, + VietNam, + BritishVirginIslands, + USVirginIslands, + WallisAndFutunaIslands, + WesternSahara, + Yemen, + Yugoslavia, + Zambia, + Zimbabwe, + LastCountry + }; + + TQLocale(); + TQLocale(const TQString &); + TQLocale(Language,Country = AnyCountry); + TQLocale(const TQLocale &); + + Language language() const; + Country country() const; + TQString name() const; + + short toShort(const TQString &,bool * = 0) const; + ushort toUShort(const TQString &,bool * = 0) const; + int toInt(const TQString &,bool * = 0) const; + uint toUInt(const TQString &,bool * = 0) const; + TQ_LONG toLong(const TQString &,bool * = 0) const; + TQ_ULONG toULong(const TQString &,bool * = 0) const; + //TQ_LLONG toLongLong(const TQString &,bool * = 0) const; + //TQ_ULLONG toULongLong(const TQString &,bool * = 0) const; + float toFloat(const TQString &,bool * = 0) const; + double toDouble(const TQString &,bool * = 0) const; + + //TQString toString(short) const; + //TQString toString(ushort) const; + TQString toString(int /Constrained/) const; + //TQString toString(uint) const; + //TQString toString(TQ_LONG) const; + //TQString toString(TQ_ULONG) const; + //TQString toString(Q_LLONG) const; + //TQString toString(Q_ULLONG) const; + //TQString toString(float,char = 'g',int = 6) const; + TQString toString(double,char = 'g',int = 6) const; + + static TQString languageToString(Language); + static TQString countryToString(Country); + static void setDefault(const TQLocale &); + + static TQLocale c(); + static TQLocale system(); +}; diff --git a/sip/tqt/tqmainwindow.sip b/sip/tqt/tqmainwindow.sip new file mode 100644 index 0000000..b271b6c --- /dev/null +++ b/sip/tqt/tqmainwindow.sip @@ -0,0 +1,171 @@ +// This is the SIP interface definition for TQMainWindow. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +%DefaultEncoding "UTF-8" + +%ExportedDoc +<Sect2><Title>TQMainWindow</Title> +<FuncSynopsis> + <FuncDef>TQTextStream &<Function>operator<<</Function></FuncDef> + <ParamDef>TQTextStream &<Parameter></Parameter></ParamDef> + <ParamDef>const TQMainWindow &<Parameter></Parameter></ParamDef> +</FuncSynopsis> +<Para> +This operator is fully implemented. (TQt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>TQTextStream &<Function>operator>></Function></FuncDef> + <ParamDef>TQTextStream &<Parameter></Parameter></ParamDef> + <ParamDef>TQMainWindow &<Parameter></Parameter></ParamDef> +</FuncSynopsis> +<Para> +This operator is fully implemented. (TQt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>getLocation</Function></FuncDef> + <ParamDef>TQToolBar *<Parameter>tb</Parameter></ParamDef> + <ParamDef>ToolBarDock &<Parameter>dock</Parameter></ParamDef> + <ParamDef>int &<Parameter>index</Parameter></ParamDef> + <ParamDef>bool &<Parameter>nl</Parameter></ParamDef> + <ParamDef>int &<Parameter>extraOffset</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>tb</Literal> parameter and returns a tuple of the +result, <Literal>dock</Literal>, <Literal>index</Literal>, +<Literal>nl</Literal> and <Literal>extraOffset</Literal> values. (TQt v2.1.0+) +</Para> + +<FuncSynopsis> + <FuncDef>TQPtrList<TQToolBar> <Function>toolBars</Function></FuncDef> + <ParamDef>ToolBarDock <Parameter>dock</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This returns a list of <Literal>TQToolBar</Literal> instances. (TQt v2.1.0+) +</Para> +</Sect2> +%End + + +class TQMainWindow : TQWidget +{ +%TypeHeaderCode +#include <tqmainwindow.h> +%End + +public: + TQMainWindow(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = WType_TopLevel); + + TQMenuBar *menuBar() const; + TQStatusBar *statusBar() const; + TQToolTipGroup *toolTipGroup() const; + virtual void setCentralWidget(TQWidget *); + TQWidget *centralWidget() const; + + virtual void setDockEnabled(Dock,bool); + bool isDockEnabled(Dock) const; + bool isDockEnabled(TQDockArea *) const; + virtual void setDockEnabled(TQDockWindow *,Dock,bool); + bool isDockEnabled(TQDockWindow *,Dock) const; + bool isDockEnabled(TQDockWindow *,TQDockArea *) const; + + virtual void addDockWindow(TQDockWindow *,Dock = DockTop,bool = 0); + virtual void addDockWindow(TQDockWindow *,const TQString &, + Dock = DockTop,bool = 0); + virtual void moveDockWindow(TQDockWindow *,Dock = DockTop); + virtual void moveDockWindow(TQDockWindow *,Dock,bool,int,int = -1); + virtual void removeDockWindow(TQDockWindow *); + + void show(); + void hide(); + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + + bool rightJustification() const; + bool usesBigPixmaps() const; + bool usesTextLabel() const; + bool dockWindowsMovable() const; + bool opaqueMoving() const; + + bool eventFilter(TQObject *,TQEvent *); + + bool getLocation(TQDockWindow *,Dock &,int &,bool &,int &) const; + + TQPtrList<TQDockWindow> dockWindows(Dock) const; + TQPtrList<TQDockWindow> dockWindows() const; + void lineUpDockWindows(bool = 0); + + void lineUpToolBars(bool = 0); + bool isDockMenuEnabled() const; + + bool hasDockWindow(TQDockWindow *); + TQPtrList<TQToolBar> toolBars(Dock) const; + + // The following one is in TQt3 but not documented. + //virtual TQDockArea *dockingArea(const TQPoint &); + TQDockArea *leftDock() const; + TQDockArea *rightDock() const; + TQDockArea *topDock() const; + TQDockArea *bottomDock() const; + + virtual bool isCustomizable() const; + + bool appropriate(TQDockWindow *) const; + + enum DockWindows { + OnlyToolBars, + NoToolBars, + AllDockWindows + }; + + TQPopupMenu *createDockWindowMenu(DockWindows = AllDockWindows) const; + +public slots: + virtual void setRightJustification(bool); + virtual void setUsesBigPixmaps(bool); + virtual void setUsesTextLabel(bool); + virtual void setDockWindowsMovable(bool); + virtual void setOpaqueMoving(bool); + virtual void setDockMenuEnabled(bool); + virtual void whatsThis(); + virtual void setAppropriate(TQDockWindow *,bool); + virtual void customize(); + +signals: + void pixmapSizeChanged(bool); + void usesTextLabelChanged(bool); + void dockWindowPositionChanged(TQDockWindow *); + +protected slots: + virtual void setUpLayout(); + virtual bool showDockMenu(const TQPoint &); + void menuAboutToShow(); + +protected: + void paintEvent(TQPaintEvent *); + void childEvent(TQChildEvent *); + bool event(TQEvent *); + void styleChange(TQStyle &); + +private: + TQMainWindow(const TQMainWindow &); +}; diff --git a/sip/tqt/tqmemarray.sip b/sip/tqt/tqmemarray.sip new file mode 100644 index 0000000..aebbcb4 --- /dev/null +++ b/sip/tqt/tqmemarray.sip @@ -0,0 +1,164 @@ +// This is the SIP interface definition for all types based on the TQMemArray +// template. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQMemArray<type> (TQt v3+)</Title> +<Para> +Types based on the <Literal>TQMemArray</Literal> template are automatically +converted to and from Python lists of the type. +</Para> +</Sect2> +%End + + +%MappedType TQMemArray<int> +{ +%TypeHeaderCode +#include <tqmemarray.h> +%End + +%ConvertFromTypeCode + // Convert to a Python list of integers. + + PyObject *l; + + // Create the list. + if ((l = PyList_New(sipCpp -> size())) == NULL) + return NULL; + + // Get it. + for (uint i = 0; i < sipCpp -> size(); ++i) + if (PyList_SetItem(l,i,PyLong_FromLong((long)sipCpp -> at(i))) < 0) + { + Py_DECREF(l); + + return NULL; + } + + return l; +%End + +%ConvertToTypeCode + // Convert a Python list of integers to a TQMemArray<int> on the heap. + + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + TQMemArray<int> *qma = new TQMemArray<int>(PyList_GET_SIZE(sipPy)); + + PyErr_Clear(); + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + (*qma)[i] = (int)PyLong_AsLong(PyList_GET_ITEM(sipPy,i)); + + if (PyErr_Occurred() != NULL) + { + delete qma; + *sipIsErr = 1; + + return 0; + } + } + + *sipCppPtr = qma; + + return sipGetState(sipTransferObj); +%End +}; + +template<TYPE> +%MappedType TQMemArray<TYPE> +{ +%TypeHeaderCode +#include <tqmemarray.h> +%End + +%ConvertFromTypeCode + // Create the list. + PyObject *l; + + if ((l = PyList_New(sipCpp->size())) == NULL) + return NULL; + + // Set the list elements. + for (uint i = 0; i < sipCpp->size(); ++i) + { + TYPE *t = new TYPE(sipCpp->at(i)); + PyObject *tobj; + + if ((tobj = sipConvertFromNewInstance(t, sipClass_TYPE, sipTransferObj)) == NULL) + { + Py_DECREF(l); + delete t; + + return NULL; + } + + PyList_SetItem(l, i, tobj); + } + + return l; +%End + +%ConvertToTypeCode + // Check the type if that is all that is required. + if (sipIsErr == NULL) + { + if (!PyList_Check(sipPy)) + return 0; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy, i), sipClass_TYPE, SIP_NOT_NONE)) + return 0; + + return 1; + } + + TQMemArray<TYPE> *ql = new TQMemArray<TYPE>; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + int state; + TYPE *t = reinterpret_cast<TYPE *>(sipConvertToInstance(PyList_GET_ITEM(sipPy, i), sipClass_TYPE, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); + + if (*sipIsErr) + { + sipReleaseInstance(t, sipClass_TYPE, state); + + delete ql; + return 0; + } + + uint idx = ql->size(); + ql->resize(idx + 1); + ql->at(idx) = *t; + + sipReleaseInstance(t, sipClass_TYPE, state); + } + + *sipCppPtr = ql; + + return sipGetState(sipTransferObj); +%End +}; diff --git a/sip/tqt/tqmenubar.sip b/sip/tqt/tqmenubar.sip new file mode 100644 index 0000000..a008e46 --- /dev/null +++ b/sip/tqt/tqmenubar.sip @@ -0,0 +1,97 @@ +// This is the SIP interface definition for TQMenuBar. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQMenuBar</Title> +<Para> +<Literal>TQMenuBar</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQMenuBar : TQFrame, TQMenuData +{ +%TypeHeaderCode +#include <tqmenubar.h> +%End + +public: + TQMenuBar(TQWidget * /TransferThis/ = 0,const char * = 0); + + void updateItem(int); + + void show(); + void hide(); + + bool eventFilter(TQObject *,TQEvent *); + + int heightForWidth(int) const; + + enum Separator { + Never = 0, + InWindowsStyle = 1 + }; + + Separator separator() const; + virtual void setSeparator(Separator); + + void setDefaultUp(bool); + bool isDefaultUp() const; + + bool customWhatsThis() const; + + TQSize sizeHint() const; + TQSize minimumSize() const; + TQSize minimumSizeHint() const; + + void activateItemAt(int); + +signals: + void activated(int); + void highlighted(int); + +protected: + void drawContents(TQPainter *); + void fontChange(const TQFont &); + void mousePressEvent(TQMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); + void mouseMoveEvent(TQMouseEvent *); + void keyPressEvent(TQKeyEvent *); + void focusInEvent(TQFocusEvent *); + void focusOutEvent(TQFocusEvent *); + void resizeEvent(TQResizeEvent *); + void leaveEvent(TQEvent *); + void menuContentsChanged(); + void menuStateChanged(); + void styleChange(TQStyle &); + int itemAtPos(const TQPoint &); + void hidePopups(); + TQRect itemRect(int); + +private: + void menuInsPopup(TQPopupMenu *); + void menuDelPopup(TQPopupMenu *); + void frameChanged(); + + TQMenuBar(const TQMenuBar &); +}; diff --git a/sip/tqt/tqmenudata.sip b/sip/tqt/tqmenudata.sip new file mode 100644 index 0000000..7363902 --- /dev/null +++ b/sip/tqt/tqmenudata.sip @@ -0,0 +1,190 @@ +// This is the SIP interface definition for TQMenuData, TQCustomMenuItem and +// TQMenuItem. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQMenuData</Title> +<FuncSynopsis> + <FuncDef>TQMenuItem *<Function>findItem</Function></FuncDef> + <ParamDef>int <Parameter>id</Parameter></ParamDef> + <ParamDef>TQMenuData **<Parameter>parent</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> + +<Sect2><Title>TQCustomMenuItem (TQt v2.1+)</Title> +<Para> +<Literal>TQCustomMenuItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQMenuItem</Title> +<Para> +<Literal>TQMenuItem</Literal> is an internal TQt class. +</Para> +</Sect2> +%End + + +// Even though this is an internal class, uic for TQt v3.1.0 generates code that +// uses it. +class TQMenuItem +{ +%TypeHeaderCode +#include <tqmenudata.h> +%End + +public: + TQMenuItem(); + + void setText(const TQString &); + +private: + TQMenuItem(const TQMenuItem &); +}; + + +class TQMenuData +{ +%TypeHeaderCode +#include <tqmenudata.h> +%End + +public: + TQMenuData(); + + uint count(); + + int insertItem(const TQString &,SIP_RXOBJ_CON,SIP_SLOT_CON(int), + const TQKeySequence & = TQKeySequence(0),int = -1, + int = -1); + int insertItem(const TQIconSet &,const TQString &,SIP_RXOBJ_CON, + SIP_SLOT_CON(int), + const TQKeySequence & = TQKeySequence(0),int = -1, + int = -1); + int insertItem(const TQPixmap &,SIP_RXOBJ_CON,SIP_SLOT_CON(int), + const TQKeySequence & = TQKeySequence(0),int = -1, + int = -1); + int insertItem(const TQIconSet &,const TQPixmap &,SIP_RXOBJ_CON, + SIP_SLOT_CON(int), + const TQKeySequence & = TQKeySequence(0),int = -1, + int = -1); + + int insertItem(const TQString &,int = -1,int = -1); + int insertItem(const TQIconSet &,const TQString &,int = -1,int = -1); + + int insertItem(const TQString &,TQPopupMenu *,int = -1,int = -1); + int insertItem(const TQIconSet &,const TQString &,TQPopupMenu *,int = -1, + int = -1); + + int insertItem(const TQPixmap &,int = -1,int = -1); + int insertItem(const TQIconSet &,const TQPixmap &,int = -1,int = -1); + int insertItem(const TQPixmap &,TQPopupMenu *,int = -1,int = -1); + int insertItem(const TQIconSet &,const TQPixmap &,TQPopupMenu *,int = -1, + int = -1); + + int insertItem(TQWidget * /Transfer/,int = -1,int = -1); + int insertItem(const TQIconSet &,TQCustomMenuItem * /Transfer/,int = -1, + int = -1); + int insertItem(TQCustomMenuItem * /Transfer/,int = -1,int = -1); + + int insertSeparator(int = -1); + + void removeItem(int); + void removeItemAt(int); + void clear(); + + TQKeySequence accel(int) const; + void setAccel(const TQKeySequence &,int); + + TQIconSet *iconSet(int) const; + TQString text(int) const; + TQPixmap *pixmap(int) const; + + void setWhatsThis(int,const TQString &); + TQString whatsThis(int) const; + + void changeItem(int,const TQString &); + void changeItem(int,const TQPixmap &); + void changeItem(int,const TQIconSet &,const TQString &); + void changeItem(int,const TQIconSet &,const TQPixmap &); + + bool isItemActive(int) const; + + bool isItemEnabled(int) const; + void setItemEnabled(int,bool); + + bool isItemChecked(int) const; + void setItemChecked(int,bool); + + bool isItemVisible(int) const; + void setItemVisible(int,bool); + + virtual void updateItem(int); + + int indexOf(int) const; + int idAt(int) const; + virtual void setId(int,int); + + bool connectItem(int,SIP_RXOBJ_CON,SIP_SLOT_CON(int)); + bool disconnectItem(int,SIP_RXOBJ_DIS,SIP_SLOT_DIS(int)); + + bool setItemParameter(int,int); + int itemParameter(int) const; + + TQMenuItem *findItem(int) const; +// TQMenuItem *findItem(int,TQMenuData **) const; +// Not documented in the TQt3 API (the similar findPopup() was internal in +// TQt2). +// TQMenuItem *findItem(TQPopupMenu *,int * = 0) const; + + virtual void activateItemAt(int); + +protected: + virtual void menuContentsChanged(); + virtual void menuStateChanged(); + virtual void menuInsPopup(TQPopupMenu *); + virtual void menuDelPopup(TQPopupMenu *); + +private: + TQMenuData(const TQMenuData &); +}; + + +class TQCustomMenuItem : TQt +{ +%TypeHeaderCode +#include <tqmenudata.h> +%End + +public: + TQCustomMenuItem(); + + virtual bool fullSpan() const; + virtual bool isSeparator() const; + virtual void setFont(const TQFont &); + virtual void paint(TQPainter *,const TQColorGroup &,bool,bool,int,int, + int,int) = 0; + virtual TQSize sizeHint() = 0; +}; diff --git a/sip/tqt/tqmessagebox.sip b/sip/tqt/tqmessagebox.sip new file mode 100644 index 0000000..5844107 --- /dev/null +++ b/sip/tqt/tqmessagebox.sip @@ -0,0 +1,139 @@ +// This is the SIP interface definition for TQMessageBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQMessageBox</Title> +<Para> +<Literal>TQMessageBox</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_MESSAGEBOX) + +class TQMessageBox : TQDialog +{ +%TypeHeaderCode +#include <tqmessagebox.h> +%End + +public: + enum Icon { + NoIcon, + Information, + Warning, + Critical, + Question, + }; + + TQMessageBox(TQWidget * /TransferThis/ = 0,const char * = 0); + TQMessageBox(const TQString &,const TQString &,Icon,int,int,int, + TQWidget * /TransferThis/ = 0,const char * = 0,bool = 1, + WFlags = WStyle_DialogBorder); + + enum { + Ok, + Cancel, + Yes, + No, + Abort, + Retry, + Ignore, + YesAll, + NoAll, + ButtonMask, + Default, + Escape, + FlagMask + }; + + static int information(TQWidget *,const TQString &,const TQString &,int, + int = 0,int = 0) /ReleaseGIL/; + static int information(TQWidget *,const TQString &,const TQString &, + const TQString & = TQString::null, + const TQString & = TQString::null, + const TQString & = TQString::null, + int = 0,int = -1) /ReleaseGIL/; + + static int question(TQWidget *,const TQString &,const TQString &,int, + int = 0,int = 0) /ReleaseGIL/; + static int question(TQWidget *,const TQString &,const TQString &, + const TQString & = TQString::null, + const TQString & = TQString::null, + const TQString & = TQString::null, + int = 0,int = -1) /ReleaseGIL/; + + static int warning(TQWidget *,const TQString &,const TQString &,int, + int = 0,int = 0) /ReleaseGIL/; + static int warning(TQWidget *,const TQString &,const TQString &, + const TQString & = TQString::null, + const TQString & = TQString::null, + const TQString & = TQString::null,int = 0, + int = -1) /ReleaseGIL/; + + static int critical(TQWidget *,const TQString &,const TQString &,int, + int = 0,int = 0) /ReleaseGIL/; + static int critical(TQWidget *,const TQString &,const TQString &, + const TQString & = TQString::null, + const TQString & = TQString::null, + const TQString & = TQString::null,int = 0, + int = -1) /ReleaseGIL/; + + static void about(TQWidget *,const TQString &, + const TQString &) /ReleaseGIL/; + static void aboutTQt(TQWidget *, + const TQString & = TQString::null) /ReleaseGIL/; + + TQString text() const; + void setText(const TQString &); + + Icon icon() const; + + void setIcon(Icon); + void setIcon(const TQPixmap &); + + const TQPixmap *iconPixmap() const; + void setIconPixmap(const TQPixmap &); + + TQString buttonText(int) const; + void setButtonText(int,const TQString &); + + void adjustSize(); + + static TQPixmap standardIcon(Icon); + + TextFormat textFormat() const; + void setTextFormat(TextFormat); + +protected: + void resizeEvent(TQResizeEvent *); + void showEvent(TQShowEvent *); + void closeEvent(TQCloseEvent *); + void keyPressEvent(TQKeyEvent *); + void styleChanged(TQStyle &); + +private: + TQMessageBox(const TQMessageBox &); +}; + +%End diff --git a/sip/tqt/tqmetaobject.sip b/sip/tqt/tqmetaobject.sip new file mode 100644 index 0000000..56e96e6 --- /dev/null +++ b/sip/tqt/tqmetaobject.sip @@ -0,0 +1,117 @@ +// This is the SIP interface definition for TQMetaObject and TQMetaProperty. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQMetaObject</Title> +<FuncSynopsis> + <FuncDef>int <Function>numClassInfo</Function> const</FuncDef> + <ParamDef>bool <Parameter>super</Parameter> = FALSE</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>const TQClassInfo *<Function>classInfo</Function> const</FuncDef> + <ParamDef>bool <Parameter>super</Parameter> = FALSE</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> + +<Sect2><Title>TQMetaProperty</Title> +<Para> +<Literal>TQMetaProperty</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQMetaObject +{ +%TypeHeaderCode +#include <tqmetaobject.h> +%End + +public: + const char *className() const; + const char *superClassName() const; + TQMetaObject *superClass() const; + + bool inherits(const char *) const; + + int numSlots(bool = 0) const; + int numSignals(bool = 0) const; + + TQStrList slotNames(bool = 0) const; + TQStrList signalNames(bool = 0) const; + + //int numClassInfo(bool = 0) const; + //TQClassInfo *classInfo(int,bool = 0) const; + const char *classInfo(const char *,bool = 0) const; + +%If (TQt_PROPERTIES) + const TQMetaProperty *property(int,bool = 0) const; + int findProperty(const char *,bool = 0) const; + int numProperties(bool = 0) const; + + TQStrList propertyNames(bool = 0) const; +%End + +private: + TQMetaObject(const TQMetaObject &); +}; + + +%If (TQt_PROPERTIES) + +class TQMetaProperty +{ +%TypeHeaderCode +#include <tqmetaobject.h> +%End + +public: + const char *type() const; + const char *name() const; + + bool writable() const; + bool isValid() const; + + bool isSetType() const; + bool isEnumType() const; + TQStrList enumKeys() const; + + int keyToValue(const char *) const; + const char *valueToKey(int) const; + int keysToValue(const TQStrList &) const; + TQStrList valueToKeys(int) const; + + bool designable(TQObject * = 0) const; + bool scriptable(TQObject * = 0) const; + bool stored(TQObject * = 0) const; + + bool reset(TQObject *) const; +}; + +%End diff --git a/sip/tqt/tqmime.sip b/sip/tqt/tqmime.sip new file mode 100644 index 0000000..630b6f2 --- /dev/null +++ b/sip/tqt/tqmime.sip @@ -0,0 +1,88 @@ +// This is the SIP interface definition for the TQt v2+ TQMimeSource, +// TQMimeSourceFactory and TQWindowsMime classes. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQMimeSource (TQt v2+)</Title> +<Para> +<Literal>TQMimeSource</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQMimeSourceFactory (TQt v2+)</Title> +<Para> +<Literal>TQMimeSourceFactory</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQWindowsMime (TQt v3+)</Title> +<Para> +<Literal>TQWindowsMime</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQMimeSource +{ +%TypeHeaderCode +#include <tqmime.h> +%End + +public: + TQMimeSource(); + + virtual const char *format(int = 0) const = 0; + virtual bool provides(const char *) const; + virtual TQByteArray encodedData(const char *) const = 0; + int serialNumber() const; +}; + + +class TQMimeSourceFactory +{ +%TypeHeaderCode +#include <tqmime.h> +%End + +public: + TQMimeSourceFactory(); + + static TQMimeSourceFactory *defaultFactory(); + static void setDefaultFactory(TQMimeSourceFactory * /Transfer/); + static TQMimeSourceFactory *takeDefaultFactory() /TransferBack/; + static void addFactory(TQMimeSourceFactory *); + static void removeFactory(TQMimeSourceFactory *); + + virtual const TQMimeSource *data(const TQString &) const; + virtual TQString makeAbsolute(const TQString &,const TQString &) const; + const TQMimeSource *data(const TQString &,const TQString &) const; + + virtual void setText(const TQString &,const TQString &); + virtual void setImage(const TQString &,const TQImage &); + virtual void setPixmap(const TQString &,const TQPixmap &); + virtual void setData(const TQString &,TQMimeSource * /Transfer/); + virtual void setFilePath(const TQStringList &); + virtual TQStringList filePath() const; + void addFilePath(const TQString &); + virtual void setExtensionType(const TQString &,const char *); +}; diff --git a/sip/tqt/tqmotifplusstyle.sip b/sip/tqt/tqmotifplusstyle.sip new file mode 100644 index 0000000..d4d847b --- /dev/null +++ b/sip/tqt/tqmotifplusstyle.sip @@ -0,0 +1,102 @@ +// This is the SIP interface definition for TQMotifPlusStyle. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQMotifPlusStyle (TQt v2.2+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>getButtonShift</Function></FuncDef> + <ParamDef>int &<Parameter>x</Parameter></ParamDef> + <ParamDef>int &<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>x</Literal> and +<Literal>y</Literal> values. (TQt v2) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const TQScrollBar *<Parameter>sb</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>sb</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +(TQt v2) +</Para> +</Sect2> +%End + + +%If (TQt_STYLE_MOTIFPLUS) + +class TQMotifPlusStyle : TQMotifStyle +{ +%TypeHeaderCode +#include <tqmotifplusstyle.h> +%End + +public: + TQMotifPlusStyle(bool = 1); + + void polish(TQPalette &pal); + void polish(const TQStyleControlElementData&, ControlElementFlags, void *); + void unPolish(const TQStyleControlElementData&, ControlElementFlags, void *); + + void applicationPolish(const TQStyleControlElementData&, ControlElementFlags, void *); + void applicationUnPolish(const TQStyleControlElementData&, ControlElementFlags, void *); + + void drawPrimitive(PrimitiveElement,TQPainter *,const TQStyleControlElementData&,ControlElementFlags,const TQRect &, + const TQColorGroup &,SFlags = Style_Default, + const TQStyleOption & = TQStyleOption()) const; + + void drawControl(ControlElement,TQPainter *,const TQStyleControlElementData&,ControlElementFlags, + const TQRect &,const TQColorGroup &, + SFlags = Style_Default, + const TQStyleOption & = TQStyleOption(), const TQWidget *=0) const; + + TQRect subRect(SubRect,const TQStyleControlElementData&, const ControlElementFlags,const TQWidget *) const; + + void drawComplexControl(ComplexControl,TQPainter *,const TQStyleControlElementData&,ControlElementFlags, + const TQRect &,const TQColorGroup &, + SFlags = Style_Default,SCFlags = SC_All, + SCFlags = SC_None, + const TQStyleOption & = TQStyleOption(),const TQWidget *=0) const; + + TQRect querySubControlMetrics(ComplexControl,const TQStyleControlElementData&,ControlElementFlags, + SubControl, + const TQStyleOption & = TQStyleOption(), const TQWidget *=0) const; + + int pixelMetric(PixelMetric,const TQStyleControlElementData&,ControlElementFlags,const TQWidget * = 0) const; + + int styleHint(StyleHint,const TQStyleControlElementData&,ControlElementFlags, + const TQStyleOption & = TQStyleOption(), + TQStyleHintReturn * = 0, const TQWidget * = 0) const; + +protected: + bool eventFilter(TQObject *,TQEvent *); +}; + +%End diff --git a/sip/tqt/tqmotifstyle.sip b/sip/tqt/tqmotifstyle.sip new file mode 100644 index 0000000..e018a8e --- /dev/null +++ b/sip/tqt/tqmotifstyle.sip @@ -0,0 +1,112 @@ +// This is the SIP interface definition for TQMotifStyle. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQMotifStyle (TQt v2+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const TQTabBar *<Parameter>sb</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>sb</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +(TQt v2) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>tabbarMetrics</Function></FuncDef> + <ParamDef>const TQTabBar *<Parameter>t</Parameter></ParamDef> + <ParamDef>int &<Parameter>hframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>vframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>overlap</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>t</Literal> parameter and returns a tuple of the +<Literal>hframe</Literal>, <Literal>vframe</Literal> and +<Literal>overlap</Literal> values. (TQt v2) +</Para> +</Sect2> +%End + + +%If (TQt_STYLE_MOTIF) + +class TQMotifStyle : TQCommonStyle +{ +%TypeHeaderCode +#include <tqmotifstyle.h> +%End + +public: + TQMotifStyle(bool = 0); + + void setUseHighlightColors(bool); + bool useHighlightColors() const; + + void polish( TQPalette& ); + void polish( const TQStyleControlElementData&, ControlElementFlags, void * ); + void applicationPolish( const TQStyleControlElementData&, ControlElementFlags, void * ); + + void polishPopupMenu( const TQStyleControlElementData&, ControlElementFlags, void * ); + + void drawPrimitive(PrimitiveElement,TQPainter *,const TQStyleControlElementData&,ControlElementFlags,const TQRect &, + const TQColorGroup &,SFlags = Style_Default, + const TQStyleOption & = TQStyleOption()) const; + + void drawControl(ControlElement,TQPainter *,const TQStyleControlElementData&,ControlElementFlags, + const TQRect &,const TQColorGroup &, + SFlags = Style_Default, + const TQStyleOption & = TQStyleOption(), const TQWidget *=0) const; + + void drawComplexControl(ComplexControl,TQPainter *,const TQStyleControlElementData&,ControlElementFlags, + const TQRect &,const TQColorGroup &, + SFlags = Style_Default,SCFlags = SC_All, + SCFlags = SC_None, + const TQStyleOption & = TQStyleOption(),const TQWidget *=0) const; + + TQRect querySubControlMetrics(ComplexControl,const TQStyleControlElementData&,ControlElementFlags,SubControl, + const TQStyleOption & = TQStyleOption(), const TQWidget *=0) const; + + int pixelMetric(PixelMetric,const TQStyleControlElementData&,ControlElementFlags,const TQWidget * = 0) const; + + TQSize sizeFromContents(ContentsType,const TQStyleControlElementData&,ControlElementFlags,const TQSize &, + const TQStyleOption & = TQStyleOption(),const TQWidget *=0) const; + + TQRect subRect(SubRect,const TQStyleControlElementData&, const ControlElementFlags,const TQWidget *) const; + + TQPixmap stylePixmap(StylePixmap,const TQStyleControlElementData&,ControlElementFlags, + const TQStyleOption & = TQStyleOption(), const TQWidget * = 0) const; + + int styleHint(StyleHint,const TQStyleControlElementData&,ControlElementFlags, + const TQStyleOption & = TQStyleOption(), + TQStyleHintReturn * = 0, const TQWidget * = 0) const; + +private: + TQMotifStyle(const TQMotifStyle &); +}; + +%End diff --git a/sip/tqt/tqmovie.sip b/sip/tqt/tqmovie.sip new file mode 100644 index 0000000..6107321 --- /dev/null +++ b/sip/tqt/tqmovie.sip @@ -0,0 +1,98 @@ +// This is the SIP interface definition for TQMovie. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQMovie</Title> +<FuncSynopsis> + <FuncDef><Function>TQMovie</Function></FuncDef> + <ParamDef>TQDataSource *<Parameter>src</Parameter></ParamDef> + <ParamDef>int <Parameter>bufsize</Parameter> = 1024</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>pushData</Function></FuncDef> + <ParamDef>const uchar *<Parameter>data</Parameter></ParamDef> + <ParamDef>int <Parameter>length</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>length</Literal> is derived from <Literal>data</Literal> and not +passed as a parameter. (TQt v2.2.0+) +</Para> +</Sect2> +%End + + +class TQMovie +{ +%TypeHeaderCode +#include <tqmovie.h> +%End + +public: + TQMovie(); + TQMovie(int); +// TQMovie(TQDataSource *,int = 1024); + TQMovie(const TQString &,int = 1024); + TQMovie(TQByteArray,int = 1024); + TQMovie(const TQMovie &); + + int pushSpace() const; + void pushData(const uchar * /Array/,int /ArraySize/); + const TQColor &backgroundColor() const; + void setBackgroundColor(const TQColor &); + const TQRect &getValidRect() const; + const TQPixmap &framePixmap() const; + const TQImage &frameImage() const; + bool isNull() const; + int frameNumber() const; + int steps() const; + bool paused() const; + bool finished() const; + bool running() const; + void unpause(); + void pause(); + void step(); + void step(int); + void restart(); + int speed() const; + void setSpeed(int); + void connectResize(SIP_RXOBJ_CON,SIP_SLOT_CON(const TQSize &)); + void disconnectResize(SIP_RXOBJ_DIS,SIP_SLOT_DIS(const TQSize &)); + void connectUpdate(SIP_RXOBJ_CON,SIP_SLOT_CON(const TQRect &)); + void disconnectUpdate(SIP_RXOBJ_DIS,SIP_SLOT_DIS(const TQRect &)); + + enum Status { + SourceEmpty = -2, + UnrecognizedFormat = -1, + Paused = 1, + EndOfFrame = 2, + EndOfLoop = 3, + EndOfMovie = 4, + SpeedChanged = 5 + }; + + void connectStatus(SIP_RXOBJ_CON,SIP_SLOT_CON(int)); + void disconnectStatus(SIP_RXOBJ_DIS,SIP_SLOT_DIS(int)); +}; diff --git a/sip/tqt/tqmultilinedit.sip b/sip/tqt/tqmultilinedit.sip new file mode 100644 index 0000000..4b3b4f7 --- /dev/null +++ b/sip/tqt/tqmultilinedit.sip @@ -0,0 +1,134 @@ +// This is the SIP interface definition for TQMultiLineEdit. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQMultiLineEdit</Title> +<FuncSynopsis> + <FuncDef>void <Function>cursorPosition</Function> const</FuncDef> + <ParamDef>int *<Parameter>line</Parameter></ParamDef> + <ParamDef>int *<Parameter>col</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>line</Literal> and +<Literal>col</Literal> values. (TQt v1.x, TQt v2.x) +</Para> + +<FuncSynopsis> + <FuncDef>virtual void <Function>del</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delChar</Literal> in Python. (TQt v1.x, TQt v2.x) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>getCursorPosition</Function> const</FuncDef> + <ParamDef>int *<Parameter>line</Parameter></ParamDef> + <ParamDef>int *<Parameter>col</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>line</Literal> and +<Literal>col</Literal> values. (TQt v1.x, TQt v2.x) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>getMarkedRegion</Function></FuncDef> + <ParamDef>int *<Parameter>line1</Parameter></ParamDef> + <ParamDef>int *<Parameter>col1</Parameter></ParamDef> + <ParamDef>int *<Parameter>line2</Parameter></ParamDef> + <ParamDef>int *<Parameter>col2</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the bool result and the +<Literal>line1</Literal>, <Literal>col1</Literal>, <Literal>line2</Literal> and +<Literal>col2</Literal> values. +</Para> +</Sect2> +%End + + +class TQMultiLineEdit : TQTextEdit +{ +%TypeHeaderCode +#include <tqmultilineedit.h> +%End + +public: + TQMultiLineEdit(TQWidget * /TransferThis/ = 0,const char * = 0); + + TQString textLine(int) const; + int numLines() const; + + virtual void insertLine(const TQString &,int = -1); + virtual void insertAt(const TQString &,int,int); + virtual void insertAt(const TQString &,int,int,bool); + virtual void removeLine(int); + + virtual void setCursorPosition(int,int); + virtual void setCursorPosition(int,int,bool); + bool atBeginning() const; + bool atEnd() const; + + void setAlignment(int); + int alignment() const; + + void setEdited(bool); + bool edited() const; + + bool hasMarkedText() const; + TQString markedText() const; + + void cursorWordForward(bool); + void cursorWordBackward(bool); + + bool autoUpdate() const; + virtual void setAutoUpdate(bool); + + int totalWidth() const; + int totalHeight() const; + + int maxLines() const; + void setMaxLines(int); + +public slots: + void deselect(); + +protected: + TQPoint cursorPoint() const; + virtual void insertAndMark(const TQString &,bool); + virtual void newLine(); + virtual void killLine(); + virtual void pageUp(bool = 0); + virtual void pageDown(bool = 0); + virtual void cursorLeft(bool = 0,bool = 1); + virtual void cursorRight(bool = 0,bool = 1); + virtual void cursorUp(bool = 0); + virtual void cursorDown(bool = 0); + virtual void backspace(); + virtual void home(bool = 0); + virtual void end(bool = 0); + bool getMarkedRegion(int *,int *,int *,int *) const; + int lineLength(int) const; + +private: + TQMultiLineEdit(const TQMultiLineEdit &); +}; diff --git a/sip/tqt/tqmutex.sip b/sip/tqt/tqmutex.sip new file mode 100644 index 0000000..9d2051c --- /dev/null +++ b/sip/tqt/tqmutex.sip @@ -0,0 +1,74 @@ +// This is the SIP interface definition for TQMutex and TQMutexLocker. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQMutex (TQt v2.2+)</Title> +<Para> +<Literal>TQMutex</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQMutexLocker (TQt v3.1+)</Title> +<Para> +<Literal>TQMutexLocker</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_THREAD_SUPPORT) + +class TQMutex +{ +%TypeHeaderCode +#include <tqmutex.h> +%End + +public: + TQMutex(bool = 0); + + void lock() /ReleaseGIL/; + void unlock(); + bool locked(); + bool tryLock(); + +private: + TQMutex(const TQMutex &); +}; + + +class TQMutexLocker +{ +%TypeHeaderCode +#include <tqmutex.h> +%End + +public: + TQMutexLocker(TQMutex *) /ReleaseGIL/; + + TQMutex *mutex() const; + +private: + TQMutexLocker(const TQMutexLocker &); +}; + +%End diff --git a/sip/tqt/tqnamespace.sip b/sip/tqt/tqnamespace.sip new file mode 100644 index 0000000..604b42f --- /dev/null +++ b/sip/tqt/tqnamespace.sip @@ -0,0 +1,746 @@ +// This is the SIP interface definition for the TQt v2+ TQt class. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQt (TQt v2+)</Title> +<Para> +<Literal>TQt</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQt +{ +%TypeHeaderCode +#include <tqnamespace.h> +%End + +public: + static const TQColor &color0; + static const TQColor &color1; + static const TQColor &black; + static const TQColor &white; + static const TQColor &darkGray; + static const TQColor &gray; + static const TQColor &lightGray; + static const TQColor &red; + static const TQColor &green; + static const TQColor &blue; + static const TQColor &cyan; + static const TQColor &magenta; + static const TQColor &yellow; + static const TQColor &darkRed; + static const TQColor &darkGreen; + static const TQColor &darkBlue; + static const TQColor &darkCyan; + static const TQColor &darkMagenta; + static const TQColor &darkYellow; + + enum ButtonState { + NoButton, + LeftButton, + RightButton, + MidButton, + MouseButtonMask, + ShiftButton, + ControlButton, + AltButton, + MetaButton, + KeyButtonMask, + Keypad, + }; + + enum Orientation { + Horizontal, + Vertical + }; + + enum SortOrder { + Ascending, + Descending + }; + + enum AlignmentFlags { + AlignAuto, + AlignLeft, + AlignRight, + AlignHCenter, + AlignJustify, + AlignHorizontal_Mask, + AlignTop, + AlignBottom, + AlignVCenter, + AlignVertical_Mask, + AlignCenter + }; + + enum TextFlags { + SingleLine, + DontClip, + ExpandTabs, + ShowPrefix, + WordBreak, + BreakAnywhere, + DontPrint, // Internal + NoAccel + }; + + typedef uint WState; + + // WidgetState isn't part of the public API but is used in code + // generated by uic/pytquic, so we implement the minimum required. + enum WidgetState { + WState_Polished + }; + + typedef uint WFlags; + + enum WidgetFlags { + WType_TopLevel, + WType_Dialog, + WType_Popup, + WType_Desktop, + WType_Mask, + + WStyle_Customize, + WStyle_NormalBorder, + WStyle_DialogBorder, + WStyle_NoBorder, + WStyle_Title, + WStyle_SysMenu, + WStyle_Minimize, + WStyle_Maximize, + WStyle_MinMax, + WStyle_Tool, + WStyle_StaysOnTop, + WStyle_ContextHelp, + WStyle_Reserved, + WStyle_Mask, + + WDestructiveClose, + WPaintDesktop, + WPaintUnclipped, + WPaintClever, + WResizeNoErase, // Obsolete + WMouseNoMask, + WStaticContents, + WRepaintNoErase, // Obsolete + WX11BypassWM, + WWinOwnDC, + WGroupLeader, + WShowModal, + WNoMousePropagation, + WSubWindow, + WStyle_Splash, + WNoAutoErase, + }; + + enum WindowState { + WindowNoState, + WindowMinimized, + WindowMaximized, + WindowFullScreen, + WindowActive + }; + + enum ImageConversionFlags { + ColorMode_Mask, + AutoColor, + ColorOnly, + MonoOnly, + + AlphaDither_Mask, + ThresholdAlphaDither, + OrderedAlphaDither, + DiffuseAlphaDither, + + Dither_Mask, + DiffuseDither, + OrderedDither, + ThresholdDither, + + DitherMode_Mask, + AutoDither, + PreferDither, + AvoidDither + }; + + enum BGMode { + TransparentMode, + OpaqueMode + }; + + enum GUIStyle { + WindowsStyle, + MotifStyle + }; + + enum SequenceMatch { + NoMatch, + PartialMatch, + Identical + }; + + enum Modifier { + META, + SHIFT, + CTRL, + ALT, + MODIFIER_MASK, + UNICODE_ACCEL, + ASCII_ACCEL + }; + + enum Key { + Key_Escape, + Key_Tab, + Key_Backtab, + Key_BackTab, + Key_Backspace, + Key_BackSpace, + Key_Return, + Key_Enter, + Key_Insert, + Key_Delete, + Key_Pause, + Key_Print, + Key_SysReq, + Key_Clear, + + Key_Home, + Key_End, + Key_Left, + Key_Up, + Key_Right, + Key_Down, + Key_Prior, + Key_PageUp, + Key_Next, + Key_PageDown, + + Key_Shift, + Key_Control, + Key_Meta, + Key_Alt, + Key_CapsLock, + Key_NumLock, + Key_ScrollLock, + + Key_F1, + Key_F2, + Key_F3, + Key_F4, + Key_F5, + Key_F6, + Key_F7, + Key_F8, + Key_F9, + Key_F10, + Key_F11, + Key_F12, + Key_F13, + Key_F14, + Key_F15, + Key_F16, + Key_F17, + Key_F18, + Key_F19, + Key_F20, + Key_F21, + Key_F22, + Key_F23, + Key_F24, + Key_F25, + Key_F26, + Key_F27, + Key_F28, + Key_F29, + Key_F30, + Key_F31, + Key_F32, + Key_F33, + Key_F34, + Key_F35, + + Key_Super_L, + Key_Super_R, + Key_Menu, + Key_Hyper_L, + Key_Hyper_R, + Key_Help, + Key_Direction_L, + Key_Direction_R, + + Key_Space, + Key_Any, + Key_Exclam, + Key_QuoteDbl, + Key_NumberSign, + Key_Dollar, + Key_Percent, + Key_Ampersand, + Key_Apostrophe, + Key_ParenLeft, + Key_ParenRight, + Key_Asterisk, + Key_Plus, + Key_Comma, + Key_Minus, + Key_Period, + Key_Slash, + Key_0, + Key_1, + Key_2, + Key_3, + Key_4, + Key_5, + Key_6, + Key_7, + Key_8, + Key_9, + Key_Colon, + Key_Semicolon, + Key_Less, + Key_Equal, + Key_Greater, + Key_Question, + Key_At, + Key_A, + Key_B, + Key_C, + Key_D, + Key_E, + Key_F, + Key_G, + Key_H, + Key_I, + Key_J, + Key_K, + Key_L, + Key_M, + Key_N, + Key_O, + Key_P, + Key_Q, + Key_R, + Key_S, + Key_T, + Key_U, + Key_V, + Key_W, + Key_X, + Key_Y, + Key_Z, + Key_BracketLeft, + Key_Backslash, + Key_BracketRight, + Key_AsciiCircum, + Key_Underscore, + Key_QuoteLeft, + Key_BraceLeft, + Key_Bar, + Key_BraceRight, + Key_AsciiTilde, + + Key_nobreakspace, + Key_exclamdown, + Key_cent, + Key_sterling, + Key_currency, + Key_yen, + Key_brokenbar, + Key_section, + Key_diaeresis, + Key_copyright, + Key_ordfeminine, + Key_guillemotleft, + Key_notsign, + Key_hyphen, + Key_registered, + Key_macron, + Key_degree, + Key_plusminus, + Key_twosuperior, + Key_threesuperior, + Key_acute, + Key_mu, + Key_paragraph, + Key_periodcentered, + Key_cedilla, + Key_onesuperior, + Key_masculine, + Key_guillemotright, + Key_onequarter, + Key_onehalf, + Key_threequarters, + Key_questiondown, + Key_Agrave, + Key_Aacute, + Key_Acircumflex, + Key_Atilde, + Key_Adiaeresis, + Key_Aring, + Key_AE, + Key_Ccedilla, + Key_Egrave, + Key_Eacute, + Key_Ecircumflex, + Key_Ediaeresis, + Key_Igrave, + Key_Iacute, + Key_Icircumflex, + Key_Idiaeresis, + Key_ETH, + Key_Ntilde, + Key_Ograve, + Key_Oacute, + Key_Ocircumflex, + Key_Otilde, + Key_Odiaeresis, + Key_multiply, + Key_Ooblique, + Key_Ugrave, + Key_Uacute, + Key_Ucircumflex, + Key_Udiaeresis, + Key_Yacute, + Key_THORN, + Key_ssharp, + Key_agrave, + Key_aacute, + Key_acircumflex, + Key_atilde, + Key_adiaeresis, + Key_aring, + Key_ae, + Key_ccedilla, + Key_egrave, + Key_eacute, + Key_ecircumflex, + Key_ediaeresis, + Key_igrave, + Key_iacute, + Key_icircumflex, + Key_idiaeresis, + Key_eth, + Key_ntilde, + Key_ograve, + Key_oacute, + Key_ocircumflex, + Key_otilde, + Key_odiaeresis, + Key_division, + Key_oslash, + Key_ugrave, + Key_uacute, + Key_ucircumflex, + Key_udiaeresis, + Key_yacute, + Key_thorn, + Key_ydiaeresis, + + Key_Back, + Key_Forward, + Key_Stop, + Key_Refresh, + + Key_VolumeDown, + Key_VolumeMute, + Key_VolumeUp, + Key_BassBoost, + Key_BassUp, + Key_BassDown, + Key_TrebleUp, + Key_TrebleDown, + + Key_MediaPlay, + Key_MediaStop, + Key_MediaPrev, + Key_MediaNext, + Key_MediaRecord, + + Key_HomePage, + Key_Favorites, + Key_Search, + Key_Standby, + Key_OpenUrl, + + Key_LaunchMail, + Key_LaunchMedia, + Key_Launch0, + Key_Launch1, + Key_Launch2, + Key_Launch3, + Key_Launch4, + Key_Launch5, + Key_Launch6, + Key_Launch7, + Key_Launch8, + Key_Launch9, + Key_LaunchA, + Key_LaunchB, + Key_LaunchC, + Key_LaunchD, + Key_LaunchE, + Key_LaunchF, + + Key_MediaLast, + + Key_unknown + }; + + enum ArrowType { + UpArrow, + DownArrow, + LeftArrow, + RightArrow + }; + + enum RasterOp { + CopyROP, + OrROP, + XorROP, + NotAndROP, + EraseROP, + NotCopyROP, + NotOrROP, + NotXorROP, + AndROP, + NotEraseROP, + NotROP, + ClearROP, + SetROP, + NopROP, + AndNotROP, + OrNotROP, + NandROP, + NorROP, + LastROP + }; + + enum PenStyle { + NoPen, + SolidLine, + DashLine, + DotLine, + DashDotLine, + DashDotDotLine, + MPenStyle + }; + + enum PenCapStyle { + FlatCap, + SquareCap, + RoundCap, + MPenCapStyle + }; + + enum PenJoinStyle { + MiterJoin, + BevelJoin, + RoundJoin, + MPenJoinStyle + }; + + enum BrushStyle { + NoBrush, + SolidPattern, + Dense1Pattern, + Dense2Pattern, + Dense3Pattern, + Dense4Pattern, + Dense5Pattern, + Dense6Pattern, + Dense7Pattern, + HorPattern, + VerPattern, + CrossPattern, + BDiagPattern, + FDiagPattern, + DiagCrossPattern, + CustomPattern + }; + + enum MacintoshVersion { + MV_Unknown, + + MV_9, + MV_10_DOT_0, + MV_10_DOT_1, + MV_10_DOT_2, + MV_10_DOT_3, + MV_10_DOT_4, + + MV_CHEETAH, + MV_PUMA, + MV_JAGUAR, + MV_PANTHER, + MV_TIGER, + }; + + enum WindowsVersion { + WV_32s, + WV_95, + WV_98, + WV_Me, + WV_DOS_based, + + WV_NT, + WV_2000, + WV_XP, + WV_2003, + WV_VISTA, + WV_NT_based, + + WV_CE, + WV_CENET, + WV_CE_based, + }; + + enum UIEffect { + UI_General, + UI_AnimateMenu, + UI_FadeMenu, + UI_AnimateCombo, + UI_AnimateTooltip, + UI_FadeTooltip, + UI_AnimateToolBox, + }; + + enum CursorShape { + ArrowCursor, + UpArrowCursor, + CrossCursor, + WaitCursor, + IbeamCursor, + SizeVerCursor, + SizeHorCursor, + SizeBDiagCursor, + SizeFDiagCursor, + SizeAllCursor, + BlankCursor, + SplitVCursor, + SplitHCursor, + PointingHandCursor, + ForbiddenCursor, + WhatsThisCursor, + BusyCursor, + LastCursor, + BitmapCursor + }; + + static const TQCursor &arrowCursor; + static const TQCursor &upArrowCursor; + static const TQCursor &crossCursor; + static const TQCursor &waitCursor; + static const TQCursor &ibeamCursor; + static const TQCursor &sizeVerCursor; + static const TQCursor &sizeHorCursor; + static const TQCursor &sizeBDiagCursor; + static const TQCursor &sizeFDiagCursor; + static const TQCursor &sizeAllCursor; + static const TQCursor &blankCursor; + static const TQCursor &splitVCursor; + static const TQCursor &splitHCursor; + static const TQCursor &pointingHandCursor; + static const TQCursor &forbiddenCursor; + static const TQCursor &whatsThisCursor; + static const TQCursor &busyCursor; + + enum TextFormat { + PlainText, + RichText, + AutoText, + LogText, + }; + + enum AnchorAttribute { + AnchorName, + AnchorHref + }; + + enum Dock { + DockUnmanaged, + DockTornOff, + DockTop, + DockBottom, + DockRight, + DockLeft, + DockMinimized + }; + + enum DateFormat { + TextDate, + ISODate, + LocalDate + }; + + enum TimeSpec { + LocalTime, + UTC + }; + + enum BackgroundMode { + FixedColor, + FixedPixmap, + NoBackground, + PaletteForeground, + PaletteButton, + PaletteLight, + PaletteMidlight, + PaletteDark, + PaletteMid, + PaletteText, + PaletteBrightText, + PaletteBase, + PaletteBackground, + PaletteShadow, + PaletteHighlight, + PaletteHighlightedText, + PaletteButtonText, + PaletteLink, + PaletteLinkVisited, + X11ParentRelative + }; + + typedef uint ComparisonFlags; + + enum StringComparisonMode { + CaseSensitive, + BeginsWith, + EndsWith, + Contains, + ExactMatch + }; + + enum Corner { + TopLeft, + TopRight, + BottomLeft, + BottomRight + }; + +%If (WS_X11) + typedef unsigned long HANDLE; +%End +}; diff --git a/sip/tqt/tqnetworkprotocol.sip b/sip/tqt/tqnetworkprotocol.sip new file mode 100644 index 0000000..034f0f3 --- /dev/null +++ b/sip/tqt/tqnetworkprotocol.sip @@ -0,0 +1,186 @@ +// This is the SIP interface definition for TQNetworkOperation, TQNetworkProtocol +// and TQNetworkProtocolFactoryBase. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQNetworkOperation (TQt v2.1+)</Title> +<Para> +<Literal>TQNetworkOperation</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQNetworkProtocol (TQt v2.1+)</Title> +<Para> +<Literal>TQNetworkProtocol</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQNetworkProtocolFactoryBase (TQt v2.1+)</Title> +<Para> +<Literal>TQNetworkProtocolFactoryBase</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_NETWORKPROTOCOL) + +class TQNetworkProtocolFactoryBase +{ +%TypeHeaderCode +#include <tqnetworkprotocol.h> +%End + +public: + virtual TQNetworkProtocol *createObject() = 0 /Factory/; + +}; + + +class TQNetworkProtocol : TQObject +{ +%TypeHeaderCode +#include <tqnetworkprotocol.h> +%End + +public: + enum State { + StWaiting, + StInProgress, + StDone, + StFailed, + StStopped + }; + + enum Operation { + OpListChildren, + OpMkDir, + OpRemove, + OpRename, + OpGet, + OpPut + }; + + enum ConnectionState { + ConHostFound, + ConConnected, + ConClosed + }; + + enum Error { + NoError, + ErrValid, + ErrUnknownProtocol, + ErrUnsupported, + ErrParse, + ErrLoginIncorrect, + ErrHostNotFound, + ErrListChildren, + ErrMkDir, + ErrRemove, + ErrRename, + ErrGet, + ErrPut, + ErrFileNotExisting, + ErrPermissionDenied + }; + + TQNetworkProtocol(); + + virtual void setUrl(TQUrlOperator *); + + virtual void setAutoDelete(bool,int = 10000); + bool autoDelete() const; + + static void registerNetworkProtocol(const TQString &, + TQNetworkProtocolFactoryBase *); + static TQNetworkProtocol *getNetworkProtocol(const TQString &) /Factory/; + static bool hasOnlyLocalFileSystem(); + + virtual int supportedOperations() const; + virtual void addOperation(TQNetworkOperation *); + + TQUrlOperator *url() const; + TQNetworkOperation *operationInProgress() const; + virtual void clearOperationQueue(); + virtual void stop(); + +signals: + void data(const TQByteArray &,TQNetworkOperation *); + void connectionStateChanged(int,const TQString &); + void finished(TQNetworkOperation *); + void start(TQNetworkOperation *); + void newChildren(const TQValueList<TQUrlInfo> &,TQNetworkOperation *); + void newChild(const TQUrlInfo &,TQNetworkOperation *); + void createdDirectory(const TQUrlInfo &,TQNetworkOperation *); + void removed(TQNetworkOperation *); + void itemChanged(TQNetworkOperation *); + void dataTransferProgress(int,int,TQNetworkOperation *); + +protected: + virtual void processOperation(TQNetworkOperation *); + virtual void operationListChildren(TQNetworkOperation *); + virtual void operationMkDir(TQNetworkOperation *); + virtual void operationRemove(TQNetworkOperation *); + virtual void operationRename(TQNetworkOperation *); + virtual void operationGet(TQNetworkOperation *); + virtual void operationPut(TQNetworkOperation *); + virtual void operationPutChunk(TQNetworkOperation *); + virtual bool checkConnection(TQNetworkOperation *); + +private: + TQNetworkProtocol(const TQNetworkProtocol &); +}; + + +class TQNetworkOperation : TQObject +{ +%TypeHeaderCode +#include <tqnetworkprotocol.h> +%End + +public: + TQNetworkOperation(TQNetworkProtocol::Operation,const TQString &, + const TQString &,const TQString &); + TQNetworkOperation(TQNetworkProtocol::Operation,const TQByteArray &, + const TQByteArray &,const TQByteArray &); + + void setState(TQNetworkProtocol::State); + void setProtocolDetail(const TQString &); + void setErrorCode(int); + void setArg(int,const TQString &); + void setRawArg(int,const TQByteArray &); + + TQNetworkProtocol::Operation operation() const; + TQNetworkProtocol::State state() const; + TQString arg(int) const; + TQByteArray rawArg(int) const; + TQString protocolDetail() const; + int errorCode() const; + + void free(); + +private: + TQNetworkOperation(const TQNetworkOperation &); +}; + +%End diff --git a/sip/tqt/tqobject.sip b/sip/tqt/tqobject.sip new file mode 100644 index 0000000..2fb2ac2 --- /dev/null +++ b/sip/tqt/tqobject.sip @@ -0,0 +1,2086 @@ +// This is the SIP interface definition for TQObject. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQObject</Title> +<FuncSynopsis> + <FuncDef>bool <Function>disconnect</Function></FuncDef> + <ParamDef>const TQObject *<Parameter>receiver</Parameter></ParamDef> + <ParamDef>const char *<Parameter>member</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>disconnect</Function></FuncDef> + <ParamDef>const char *<Parameter>signal</Parameter> = 0</ParamDef> + <ParamDef>const TQObject *<Parameter>receiver</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>member</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>static bool <Function>disconnect</Function></FuncDef> + <ParamDef>const TQObject *<Parameter>sender</Parameter></ParamDef> + <ParamDef>const char *<Parameter>signal</Parameter></ParamDef> + <ParamDef>const TQObject *<Parameter>receiver</Parameter></ParamDef> + <ParamDef>const char *<Parameter>member</Parameter></ParamDef> +</FuncSynopsis> +<Para> +At the moment PyTQt does not support the full behaviour of the corresponding TQt +method. In particular, specifying None (ie. 0 in C++) for the +<Literal>signal</Literal> and <Literal>receiver</Literal> parameters is not yet +supported. +</Para> +</Sect2> +%End + + +class TQObject : TQt +{ +%TypeHeaderCode +#include <tqobject.h> +#include <tqapplication.h> +%End + +public: + TQObject(TQObject * /TransferThis/ = 0,const char * = 0); + +%ConvertToSubClassCode + static struct class_graph { + const char *name; + sipWrapperType **type; + int yes, no; + } graph[] = { + {sipName_TQWidget, &sipClass_TQWidget, 25, 1}, +#if defined(SIP_FEATURE_TQt_ASSISTANTCLIENT) + {sipName_TQAssistantClient, &sipClass_TQAssistantClient, -1, 2}, +#else + {NULL, NULL, -1, 2}, +#endif + {sipName_TQSessionManager, &sipClass_TQSessionManager, -1, 3}, + {sipName_TQTranslator, &sipClass_TQTranslator, -1, 4}, + {sipName_TQProcess, &sipClass_TQProcess, -1, 5}, + {sipName_TQToolTipGroup, &sipClass_TQToolTipGroup, -1, 6}, +#if defined(SIP_FEATURE_TQt_FILEDIALOG) + {sipName_TQFileIconProvider, &sipClass_TQFileIconProvider, -1, 7}, +#else + {NULL, NULL, -1, 7}, +#endif +#if defined(SIP_FEATURE_TQt_ACTION) + {sipName_TQAction, &sipClass_TQAction, 89, 8}, +#else + {NULL, NULL, -1, 8}, +#endif + {sipName_TQObjectCleanupHandler, &sipClass_TQObjectCleanupHandler, -1, 9}, + {sipName_TQTimer, &sipClass_TQTimer, -1, 10}, + {sipName_TQLayout, &sipClass_TQLayout, 90, 11}, +#if defined(SIP_FEATURE_TQt_NETWORKPROTOCOL) + {sipName_TQUrlOperator, &sipClass_TQUrlOperator, -1, 12}, +#else + {NULL, NULL, -1, 12}, +#endif + {sipName_TQStyleSheet, &sipClass_TQStyleSheet, -1, 13}, + {sipName_TQValidator, &sipClass_TQValidator, 94, 14}, +#if defined(SIP_FEATURE_TQt_NETWORKPROTOCOL) + {sipName_TQNetworkOperation, &sipClass_TQNetworkOperation, -1, 15}, +#else + {NULL, NULL, -1, 15}, +#endif + {sipName_TQAccel, &sipClass_TQAccel, -1, 16}, + {sipName_TQEventLoop, &sipClass_TQEventLoop, -1, 17}, +#if defined(SIP_FEATURE_TQt_NETWORKPROTOCOL) + {sipName_TQNetworkProtocol, &sipClass_TQNetworkProtocol, -1, 18}, +#else + {NULL, NULL, -1, 18}, +#endif +#if defined(SIP_FEATURE_TQt_SOUND) + {sipName_TQSound, &sipClass_TQSound, -1, 19}, +#else + {NULL, NULL, -1, 19}, +#endif + {sipName_TQApplication, &sipClass_TQApplication, -1, 20}, + {sipName_TQDragObject, &sipClass_TQDragObject, 97, 21}, + {sipName_TQSocketNotifier, &sipClass_TQSocketNotifier, -1, 22}, + {sipName_TQStyle, &sipClass_TQStyle, 103, 23}, + {sipName_TQSignalMapper, &sipClass_TQSignalMapper, -1, 24}, +#if defined(SIP_FEATURE_TQt_CLIPBOARD) + {sipName_TQClipboard, &sipClass_TQClipboard, -1, -1}, +#else + {NULL, NULL, -1, -1}, +#endif + {sipName_TQStatusBar, &sipClass_TQStatusBar, -1, 26}, +#if defined(SIP_FEATURE_TQt_SIZEGRIP) + {sipName_TQSizeGrip, &sipClass_TQSizeGrip, -1, 27}, +#else + {NULL, NULL, -1, 27}, +#endif + {sipName_TQTabWidget, &sipClass_TQTabWidget, -1, 28}, + {sipName_TQDateEdit, &sipClass_TQDateEdit, -1, 29}, + {sipName_TQMainWindow, &sipClass_TQMainWindow, -1, 30}, + {sipName_TQDateTimeEdit, &sipClass_TQDateTimeEdit, -1, 31}, + {sipName_TQTimeEdit, &sipClass_TQTimeEdit, -1, 32}, + {sipName_TQFrame, &sipClass_TQFrame, 46, 33}, + {sipName_TQScrollBar, &sipClass_TQScrollBar, -1, 34}, +#if defined(SIP_FEATURE_TQt_DIAL) + {sipName_TQDial, &sipClass_TQDial, -1, 35}, +#else + {NULL, NULL, -1, 35}, +#endif + {sipName_TQButton, &sipClass_TQButton, 75, 36}, + {sipName_TQTabBar, &sipClass_TQTabBar, -1, 37}, + {sipName_TQDialog, &sipClass_TQDialog, 79, 38}, + {sipName_TQComboBox, &sipClass_TQComboBox, -1, 39}, + {sipName_TQHeader, &sipClass_TQHeader, -1, 40}, + {sipName_TQDockArea, &sipClass_TQDockArea, -1, 41}, + {sipName_TQSplashScreen, &sipClass_TQSplashScreen, -1, 42}, + {sipName_TQSlider, &sipClass_TQSlider, -1, 43}, + {sipName_TQSpinBox, &sipClass_TQSpinBox, -1, 44}, +#if defined(SIP_FEATURE_TQt_WORKSPACE) + {sipName_TQWorkspace, &sipClass_TQWorkspace, -1, 45}, +#else + {NULL, NULL, -1, 45}, +#endif + {sipName_TQDesktopWidget, &sipClass_TQDesktopWidget, -1, -1}, + {sipName_TQGrid, &sipClass_TQGrid, -1, 47}, + {sipName_TQLineEdit, &sipClass_TQLineEdit, -1, 48}, + {sipName_TQToolBox, &sipClass_TQToolBox, -1, 49}, + {sipName_TQWidgetStack, &sipClass_TQWidgetStack, -1, 50}, + {sipName_TQDockWindow, &sipClass_TQDockWindow, 60, 51}, + {sipName_TQMenuBar, &sipClass_TQMenuBar, -1, 52}, + {sipName_TQLabel, &sipClass_TQLabel, -1, 53}, + {sipName_TQGroupBox, &sipClass_TQGroupBox, 61, 54}, + {sipName_TQPopupMenu, &sipClass_TQPopupMenu, -1, 55}, +#if defined(SIP_FEATURE_TQt_SPLITTER) + {sipName_TQSplitter, &sipClass_TQSplitter, -1, 56}, +#else + {NULL, NULL, -1, 56}, +#endif + {sipName_TQProgressBar, &sipClass_TQProgressBar, -1, 57}, + {sipName_TQScrollView, &sipClass_TQScrollView, 66, 58}, + {sipName_TQHBox, &sipClass_TQHBox, 74, 59}, + {sipName_TQLCDNumber, &sipClass_TQLCDNumber, -1, -1}, + {sipName_TQToolBar, &sipClass_TQToolBar, -1, -1}, + {sipName_TQButtonGroup, &sipClass_TQButtonGroup, 64, 62}, + {sipName_TQHGroupBox, &sipClass_TQHGroupBox, -1, 63}, + {sipName_TQVGroupBox, &sipClass_TQVGroupBox, -1, -1}, + {sipName_TQVButtonGroup, &sipClass_TQVButtonGroup, -1, 65}, + {sipName_TQHButtonGroup, &sipClass_TQHButtonGroup, -1, -1}, +#if defined(SIP_FEATURE_TQt_ICONVIEW) + {sipName_TQIconView, &sipClass_TQIconView, -1, 67}, +#else + {NULL, NULL, -1, 67}, +#endif + {sipName_TQListView, &sipClass_TQListView, -1, 68}, + {sipName_TQListBox, &sipClass_TQListBox, -1, 69}, + {sipName_TQGridView, &sipClass_TQGridView, -1, 70}, + {sipName_TQTextEdit, &sipClass_TQTextEdit, 71, -1}, + {sipName_TQTextBrowser, &sipClass_TQTextBrowser, -1, 72}, + {sipName_TQMultiLineEdit, &sipClass_TQMultiLineEdit, -1, 73}, + {sipName_TQTextView, &sipClass_TQTextView, -1, -1}, + {sipName_TQVBox, &sipClass_TQVBox, -1, -1}, + {sipName_TQToolButton, &sipClass_TQToolButton, -1, 76}, + {sipName_TQRadioButton, &sipClass_TQRadioButton, -1, 77}, + {sipName_TQPushButton, &sipClass_TQPushButton, -1, 78}, + {sipName_TQCheckBox, &sipClass_TQCheckBox, -1, -1}, +#if defined(WS_X11) && defined(SIP_FEATURE_TQt_PRINTDIALOG) + {sipName_TQPrintDialog, &sipClass_TQPrintDialog, -1, 80}, +#else + {NULL, NULL, -1, 80}, +#endif + {sipName_TQErrorMessage, &sipClass_TQErrorMessage, -1, 81}, +#if defined(SIP_FEATURE_TQt_INPUTDIALOG) + {sipName_TQInputDialog, &sipClass_TQInputDialog, -1, 82}, +#else + {NULL, NULL, -1, 82}, +#endif +#if defined(SIP_FEATURE_TQt_MESSAGEBOX) + {sipName_TQMessageBox, &sipClass_TQMessageBox, -1, 83}, +#else + {NULL, NULL, -1, 83}, +#endif +#if defined(SIP_FEATURE_TQt_WIZARD) + {sipName_TQWizard, &sipClass_TQWizard, -1, 84}, +#else + {NULL, NULL, -1, 84}, +#endif +#if defined(SIP_FEATURE_TQt_COLORDIALOG) + {sipName_TQColorDialog, &sipClass_TQColorDialog, -1, 85}, +#else + {NULL, NULL, -1, 85}, +#endif +#if defined(SIP_FEATURE_TQt_FONTDIALOG) + {sipName_TQFontDialog, &sipClass_TQFontDialog, -1, 86}, +#else + {NULL, NULL, -1, 86}, +#endif +#if defined(SIP_FEATURE_TQt_FILEDIALOG) + {sipName_TQFileDialog, &sipClass_TQFileDialog, -1, 87}, +#else + {NULL, NULL, -1, 87}, +#endif +#if defined(SIP_FEATURE_TQt_PROGRESSDIALOG) + {sipName_TQProgressDialog, &sipClass_TQProgressDialog, -1, 88}, +#else + {NULL, NULL, -1, 88}, +#endif +#if defined(SIP_FEATURE_TQt_TABDIALOG) + {sipName_TQTabDialog, &sipClass_TQTabDialog, -1, -1}, +#else + {NULL, NULL, -1, -1}, +#endif +#if defined(SIP_FEATURE_TQt_ACTION) + {sipName_TQActionGroup, &sipClass_TQActionGroup, -1, -1}, +#else + {NULL, NULL, -1, -1}, +#endif + {sipName_TQGridLayout, &sipClass_TQGridLayout, -1, 91}, + {sipName_TQBoxLayout, &sipClass_TQBoxLayout, 92, -1}, + {sipName_TQHBoxLayout, &sipClass_TQHBoxLayout, -1, 93}, + {sipName_TQVBoxLayout, &sipClass_TQVBoxLayout, -1, -1}, + {sipName_TQDoubleValidator, &sipClass_TQDoubleValidator, -1, 95}, + {sipName_TQIntValidator, &sipClass_TQIntValidator, -1, 96}, + {sipName_TQRegExpValidator, &sipClass_TQRegExpValidator, -1, -1}, + {sipName_TQTextDrag, &sipClass_TQTextDrag, -1, 98}, + {sipName_TQStoredDrag, &sipClass_TQStoredDrag, 101, 99}, +#if defined(SIP_FEATURE_TQt_ICONVIEW) && defined(SIP_FEATURE_TQt_DRAGANDDROP) + {sipName_TQIconDrag, &sipClass_TQIconDrag, -1, 100}, +#else + {NULL, NULL, -1, 100}, +#endif + {sipName_TQImageDrag, &sipClass_TQImageDrag, -1, -1}, + {sipName_TQColorDrag, &sipClass_TQColorDrag, -1, 102}, + {sipName_TQUriDrag, &sipClass_TQUriDrag, -1, -1}, + {sipName_TQCommonStyle, &sipClass_TQCommonStyle, 104, -1}, +#if defined(SIP_FEATURE_TQt_STYLE_WINDOWS) + {sipName_TQWindowsStyle, &sipClass_TQWindowsStyle, 106, 105}, +#else + {NULL, NULL, -1, 105}, +#endif +#if defined(SIP_FEATURE_TQt_STYLE_MOTIF) + {sipName_TQMotifStyle, &sipClass_TQMotifStyle, 107, -1}, +#else + {NULL, NULL, -1, -1}, +#endif +#if defined(SIP_FEATURE_TQt_STYLE_PLATINUM) + {sipName_TQPlatinumStyle, &sipClass_TQPlatinumStyle, -1, 110}, +#else + {NULL, NULL, -1, 110}, +#endif +#if defined(SIP_FEATURE_TQt_STYLE_CDE) + {sipName_TQCDEStyle, &sipClass_TQCDEStyle, -1, 108}, +#else + {NULL, NULL, -1, 108}, +#endif +#if defined(SIP_FEATURE_TQt_STYLE_MOTIFPLUS) + {sipName_TQMotifPlusStyle, &sipClass_TQMotifPlusStyle, -1, 109}, +#else + {NULL, NULL, -1, 109}, +#endif +#if defined(SIP_FEATURE_TQt_STYLE_SGI) + {sipName_TQSGIStyle, &sipClass_TQSGIStyle, -1, -1}, +#else + {NULL, NULL, -1, -1}, +#endif +#if defined(PYTQT_STYLE_WINDOWSXP) + {sipName_TQWindowsXPStyle, &sipClass_TQWindowsXPStyle, -1, -1}, +#else + {NULL, NULL, -1, -1}, +#endif + }; + + int i = 0; + + sipClass = NULL; + + do + { + struct class_graph *cg = &graph[i]; + + if (cg->name != NULL && sipCpp->inherits(cg->name)) + { + sipClass = *cg->type; + i = cg->yes; + } + else + i = cg->no; + } + while (i >= 0); +%End + + // This is really virtual. With the way we are implementing it doesn't + // need to be and has the advantage that the C++ implementation can be + // used in %ConvertToSubClassCode to get the C++ name for Python + // sub-classes. However, it is also means that C++ plugins can't get + // the true (Python) class name. + SIP_PYOBJECT className() const; +%MethodCode + sipRes = PyUnicode_FromString(sipSelf->ob_type->tp_name); +%End + + // Note that tr() and trUtf8() are really static methods. We pretend + // they aren't so that we can use self to get hold of the class name. + // We could mimic moc's behaviour more accurately by creating tr() and + // trUtf8() methods for a Python sub-class instance in the sub-class's + // ctor. + + TQString tr(SIP_PYOBJECT sourceText /TypeHint="str"/,const char * = 0); +%MethodCode + if (tqApp) + { + const char *source = PyTQt_tqt_encode(&a0, TQApplication::DefaultCodec); + + if (source) + { + sipRes = new TQString(tqApp->translate(Py_TYPE(sipSelf)->tp_name, source, + a1, TQApplication::DefaultCodec)); + Py_DECREF(a0); + } + else + { + sipIsErr = 1; + } + } + else + { + const char *source = sipString_AsUTF8String(&a0); + + if (source) + { + sipRes = new TQString(TQString::fromUtf8(source)); + Py_DECREF(a0); + } + else + { + sipIsErr = 1; + } + } +%End + + TQString trUtf8(SIP_PYOBJECT sourceText /TypeHint="str"/,const char * = 0); +%MethodCode + if (tqApp) + { + const char *source = PyTQt_tqt_encode(&a0, TQApplication::DefaultCodec); + + if (source) + { + sipRes = new TQString(tqApp->translate(Py_TYPE(sipSelf)->tp_name, source, + a1, TQApplication::UnicodeUTF8)); + Py_DECREF(a0); + } + else + { + sipIsErr = 1; + } + } + else + { + const char *source = sipString_AsUTF8String(&a0); + + if (source) + { + sipRes = new TQString(TQString::fromUtf8(source)); + Py_DECREF(a0); + } + else + { + sipIsErr = 1; + } + } +%End + virtual TQMetaObject *metaObject() const /AutoGen/; + virtual bool event(TQEvent *); + virtual bool eventFilter(TQObject *,TQEvent *); + + bool isA(const char *) const; +%MethodCode + // The TQt implementation doesn't know anything about Python + // sub-classes. For SIP v4 we use the Python type's name. For + // SIP v3 we use the broken TQt behaviour as it's deprecated and + // we want to keep things simple. + +#if SIP_VERSION >= 0x040000 + sipRes = (strcmp(sipSelf -> ob_type -> tp_name,a0) == 0); +#else + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp -> TQObject::isA(a0); + Py_END_ALLOW_THREADS +#endif +%End + + bool inherits(const char *) const; +%MethodCode + // The TQt implementation doesn't know anything about Python + // sub-classes. For SIP v4 we use the Python type's MRO. For + // SIP v3 we use the broken TQt behaviour as it's deprecated and + // we want to keep things simple. + +#if SIP_VERSION >= 0x040000 + PyObject *mro = sipSelf -> ob_type -> tp_mro; + + sipRes = 0; + + for (int i = 0; i < PyTuple_GET_SIZE(mro); ++i) + if (strcmp(((PyTypeObject *)PyTuple_GET_ITEM(mro,i)) -> tp_name,a0) == 0) + { + sipRes = 1; + break; + } +#else + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp -> TQObject::inherits(a0); + Py_END_ALLOW_THREADS +#endif +%End + + const char *name() const; + const char *name(const char *) const; + virtual void setName(const char *); + bool isWidgetType() const; + bool highPriority() const; + bool signalsBlocked() const; + void blockSignals(bool); + int startTimer(int); + void killTimer(int); + void killTimers(); + TQObject *child(const char *,const char * = 0,bool = 1); + const TQObjectList *children() const; + static const TQObjectList *objectTrees(); + + TQObjectList *queryList(char * = 0,char * = 0,bool = 1,bool = 1) const; +%MethodCode + // The TQt implementation doesn't know anything about Python + // sub-classes. For SIP v4 we get all classes and then use the + // Python type's MRO to weed out those we don't want. For SIP + // v3 we use the broken TQt behaviour as it's deprecated and we + // want to keep things simple. + +#if SIP_VERSION >= 0x040000 + sipRes = sipCpp -> TQObject::queryList(0, a1, a2, a3); + + if (a0 && sipRes) + { + TQObject *o = sipRes -> first(); + + while (o) + { + bool remove = TRUE; + PyObject *pyo = sipConvertFromInstance(o, sipClass_TQObject, 0); + + if (pyo) + { + PyObject *mro = pyo -> ob_type -> tp_mro; + + for (int i = 0; i < PyTuple_GET_SIZE(mro); ++i) + if (strcmp(((PyTypeObject *)PyTuple_GET_ITEM(mro,i)) -> tp_name,a0) == 0) + { + remove = FALSE; + break; + } + + Py_DECREF(pyo); + } + + if (remove) + { + sipRes -> remove(); + o = sipRes -> current(); + } + else + o = sipRes -> next(); + } + } +#else + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp -> TQObject::queryList(a0, a1, a2, a3); + Py_END_ALLOW_THREADS +#endif +%End + + virtual void insertChild(TQObject * /Transfer/); + virtual void removeChild(TQObject * /TransferBack/); + void installEventFilter(const TQObject *); + void removeEventFilter(const TQObject *); + + static SIP_PYOBJECT connect(SIP_TQOBJECT,SIP_SIGNAL,SIP_TQOBJECT,SIP_SLOT); +%MethodCode + sipRes = sipConnectRx(a0,a1,a2,a3,0); +%End + + static SIP_PYOBJECT connect(SIP_TQOBJECT,SIP_SIGNAL,SIP_PYCALLABLE); +%MethodCode + sipRes = sipConnectRx(a0,a1,a2,0,0); +%End + + SIP_PYOBJECT connect(SIP_TQOBJECT,SIP_SIGNAL,SIP_SLOT) const; +%MethodCode + sipRes = sipConnectRx(a0,a1,sipSelf,a2,0); +%End + + static SIP_PYOBJECT disconnect(SIP_TQOBJECT,SIP_SIGNAL,SIP_TQOBJECT,SIP_SLOT); +%MethodCode + sipRes = sipDisconnectRx(a0,a1,a2,a3); +%End + + static SIP_PYOBJECT disconnect(SIP_TQOBJECT,SIP_SIGNAL,SIP_PYCALLABLE); +%MethodCode + sipRes = sipDisconnectRx(a0,a1,a2,0); +%End + +// bool disconnect(const char * = 0,const TQObject * = 0,const char * = 0); +// bool disconnect(const TQObject *,const char * = 0); + void dumpObjectTree(); + void dumpObjectInfo(); + TQObject *parent() const; + + void emit(SIP_SIGNAL,SIP_PYTUPLE); +%MethodCode + if (pytqtEmitSignal(sipSelf, a0, a1) < 0) + sipIsErr = 1; +%End + +%If (TQt_PROPERTIES) + virtual bool setProperty(const char *,const TQVariant &); + virtual TQVariant property(const char *) const; +%End + +signals: + void destroyed(); + void destroyed(TQObject *); + +public slots: + void deleteLater(); + +public: + // This is actually protected, but we never need to call the real + // method. + SIP_PYOBJECT sender(); +%MethodCode + sipRes = pytqt3GetSender(); +%End + +protected: + virtual void timerEvent(TQTimerEvent *); + virtual void childEvent(TQChildEvent *); + virtual void customEvent(TQCustomEvent *); + +private: + TQObject(const TQObject &); +}; + + +SIP_PYOBJECT QT_TR_NOOP(SIP_PYOBJECT); +%MethodCode + Py_INCREF(a0); + sipRes = a0; +%End + + +SIP_PYOBJECT QT_TRANSLATE_NOOP(SIP_PYOBJECT,SIP_PYOBJECT); +%MethodCode + Py_INCREF(a1); + sipRes = a1; +%End + + +SIP_PYOBJECT SLOT(const char * /Encoding="ASCII"/) /TypeHint="TQT_SLOT"/; +%MethodCode + if (!a0) + { + PyErr_Format(PyExc_TypeError,"tqt.SLOT() slot name cannot be None"); + sipIsErr = 1; + } + else + { + int len = strlen(a0); + + if ((sipRes = PyBytes_FromStringAndSize(NULL,1 + len)) == NULL) + sipIsErr = 1; + else + { + char *dp = PyBytes_AS_STRING(sipRes); + + *dp++ = '1'; + + memcpy(dp,a0,len + 1); + } + } +%End + + +SIP_PYOBJECT SIGNAL(const char * /Encoding="ASCII"/) /TypeHint="TQT_SIGNAL"/; +%MethodCode + if (!a0) + { + PyErr_Format(PyExc_TypeError,"tqt.SIGNAL() signal cannot be None"); + sipIsErr = 1; + } + else + { + int len = strlen(a0); + + if ((sipRes = PyBytes_FromStringAndSize(NULL,1 + len)) == NULL) + sipIsErr = 1; + else + { + char *dp = PyBytes_AS_STRING(sipRes); + + *dp++ = '2'; + + memcpy(dp,a0,len + 1); + } + } +%End + + +SIP_PYOBJECT PYSIGNAL(const char * /Encoding="ASCII"/); +%MethodCode + if (!a0) + { + PyErr_Format(PyExc_TypeError,"tqt.PYSIGNAL() signal cannot be None"); + sipIsErr = 1; + } + else + { + int len = strlen(a0); + + if ((sipRes = PyBytes_FromStringAndSize(NULL,1 + len)) == NULL) + sipIsErr = 1; + else + { + char *dp = PyBytes_AS_STRING(sipRes); + + *dp++ = '9'; + + memcpy(dp,a0,len + 1); + } + } +%End + + +%ModuleHeaderCode + +int pytqtEmitSignal(PyObject *self, const char *sig, PyObject *sigargs); +PyObject *pytqt3GetSender(); + +%End + + +// This is the TQt support code for SIP v4.4 and later. +%ModuleCode + +#include <string.h> + +#include <tqobject.h> +#include <tqvariant.h> +#include <tqmetaobject.h> +#include <private/qucom_p.h> +#include <private/qucomextra_p.h> + + +// These optional parts of the legacy TQt support API for SIP are implemented. +#undef sipTQtEmitSignal +#undef sipTQtConnectPySignal +#undef sipTQtDisconnectPySignal + + +// Declare explicit C linkage. +extern "C" +{ + static void *sipTQtCreateUniversalSlot(sipWrapper *, const char *, + PyObject *, const char *, const char **, int); + static void sipTQtDestroyUniversalSlot(void *); + static void *sipTQtFindSlot(void *, const char *, PyObject *, const char *, + const char **); + static int sipTQtConnect(void *, const char *, void *, const char *, int); + static int sipTQtDisconnect(void *, const char *, void *, const char *); + static int sipTQtSameSignalSlotName(const char *, const char *); + static sipSlot *sipTQtFindSipslot(void *, void **); + static int sipTQtEmitSignal(PyObject *, const char *, PyObject *); + static int sipTQtConnectPySignal(PyObject *, const char *, PyObject *, + const char *); + static void sipTQtDisconnectPySignal(PyObject *, const char *, + PyObject *, const char *); +} + + +extern "C" { + +// The meta-type for PyTQt classes. It is just a marker type so that we can +// safely cast to get access to PyTQt3-specific data structures. +PyTypeObject pytqtWrapperType_Type = { + PyVarObject_HEAD_INIT(NULL, 0) + "tqt.pytqtWrapperType", /* tp_name */ + sizeof (sipWrapperType), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall_offset */ +#else + 0, /* tp_print */ +#endif + 0, /* tp_getattr */ + 0, /* tp_setattr */ +#if PY_VERSION_HEX >= 0x03050000 + 0, /* tp_as_async */ +#else + 0, /* tp_reserved */ +#endif + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ + 0, /* tp_del */ + 0, /* tp_version_tag */ +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ +#endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if PY_VERSION_HEX == 0x03080000 + 0, /* tp_print (deprecated) */ +#endif +}; + + +/* + * An entry in a linked list of slots. + */ +typedef struct _pytqt3SlotList { + /* The receiver. */ + sipSlot rx; + + /* Next in the list. */ + struct _pytqt3SlotList *next; +} pytqt3SlotList; + + +/* + * A Python signal. + */ +typedef struct _pytqt3PySig { + /* The name of the signal. */ + char *name; + + /* The list of receivers. */ + pytqt3SlotList *rxlist; + + /* Next in the list. */ + struct _pytqt3PySig *next; +} pytqt3PySig; + + +/* + * The C++ wrapper object used by PyTQt3. + */ +typedef struct _pytqtWrapper { + /* The super-type. */ + sipWrapper super; + + /* The list of Python signals. */ + pytqt3PySig *pySigList; +} pytqtWrapper; + + +/* + * Clear any slots connected to any Python signals. + */ +static void clear_py_signals_slots(pytqtWrapper *pw) +{ + pytqt3PySig *ps; + + for (ps = pw->pySigList; ps != NULL; ps = ps->next) + { + pytqt3SlotList *psrx; + + for (psrx = ps->rxlist; psrx != NULL; psrx = psrx->next) + sipClearAnySlotReference(&psrx->rx); + } +} + + +/* + * Find the given Python signal. + */ +static pytqt3PySig *find_py_signal(pytqtWrapper *pw, const char *sig) +{ + pytqt3PySig *ps; + + for (ps = pw->pySigList; ps != NULL; ps = ps->next) + if (sipTQtSameSignalSlotName(ps->name, sig)) + return ps; + + return 0; +} + + +/* + * Free an slot list entry. + */ +static void free_slot_list(pytqt3SlotList *sl) +{ + sipFreeSipslot(&sl->rx); + sipFree(sl); +} + + +/* + * The instance clear slot. + */ +static int pytqtWrapper_clear(pytqtWrapper *self) +{ + clear_py_signals_slots(self); + + return sipWrapper_Type->tp_clear((PyObject *)self); +} + + +/* + * The instance dealloc slot. + */ +static void pytqtWrapper_dealloc(pytqtWrapper *self) +{ + clear_py_signals_slots(self); + + while (self->pySigList != NULL) + { + pytqt3PySig *ps; + pytqt3SlotList *psrx; + + /* Take this one out of the list. */ + ps = self->pySigList; + self->pySigList = ps->next; + + while ((psrx = ps->rxlist) != NULL) + { + ps->rxlist = psrx->next; + free_slot_list(psrx); + } + + sipFree(ps->name); + sipFree(ps); + } + + sipWrapper_Type->tp_dealloc((PyObject *)self); +} + + +/* + * The instance traverse slot. + */ +static int pytqtWrapper_traverse(pytqtWrapper *self, visitproc visit, void *arg) +{ + int vret; + pytqt3PySig *ps; + + if ((vret = sipWrapper_Type->tp_traverse((PyObject *)self, visit, arg)) != 0) + return vret; + + for (ps = self->pySigList; ps != NULL; ps = ps->next) + { + pytqt3SlotList *psrx; + + for (psrx = ps->rxlist; psrx != NULL; psrx = psrx->next) + if ((vret = sipVisitSlot(&psrx->rx, visit, arg)) != 0) + return vret; + } + + return 0; +} + + +static sipWrapperType pytqtWrapper_Type = { +#if !defined(STACKLESS) + { +#endif + { + PyVarObject_HEAD_INIT(&pytqtWrapperType_Type, 0) + "tqt.pytqtWrapper", /* tp_name */ + sizeof (pytqtWrapper), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor)pytqtWrapper_dealloc, /* tp_dealloc */ +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall_offset */ +#else + 0, /* tp_print */ +#endif + 0, /* tp_getattr */ + 0, /* tp_setattr */ +#if PY_VERSION_HEX >= 0x03050000 + 0, /* tp_as_async */ +#else + 0, /* tp_reserved */ +#endif + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */ + 0, /* tp_doc */ + (traverseproc)pytqtWrapper_traverse, /* tp_traverse */ + (inquiry)pytqtWrapper_clear, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ + 0, /* tp_del */ + 0, /* tp_version_tag */ +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ +#endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if PY_VERSION_HEX == 0x03080000 + 0, /* tp_print (deprecated) */ +#endif + }, +#if !defined(STACKLESS) + }, +#endif + 0, + 0, + 0 +}; + +}; + + +// This enumerates the different dynamic signal argument types. +enum pytqt3SigArgType { + unknown_sat, + char_sat, + uchar_sat, + string_sat, + ustring_sat, + short_sat, + ushort_sat, + int_sat, + uint_sat, + long_sat, + ulong_sat, + longlong_sat, + ulonglong_sat, + float_sat, + double_sat, + enum_sat, + bool_sat, + void_sat, + class_sat, + classp_sat, + mtype_sat, + mtypep_sat, + qvariant_sat, + qvariantp_sat, + pyobject_sat, + schar_sat, + sstring_sat, + wchar_sat, + wstring_sat +}; + + +// This defines a single dynamic signal argument type. +struct pytqt3SigArg +{ + // The type. + pytqt3SigArgType atype; + + union { + // The Python type for classes. + sipWrapperType *wt; + + // The data for mapped types. + const sipTypeDef *mt; + + // The Python type for named enums. + PyTypeObject *et; + } u; +}; + + +// A parsed signal signature. +struct pytqt3Signature { + // The number of arguments. + int sg_nrargs; + + // The parsed arguments (heap). + pytqt3SigArg *sg_args; + + // The unparsed signature (heap). + char *sg_signature; + + // The next in the list. + pytqt3Signature *sg_next; +}; + + +// A connection to a universal slot. +struct pytqt3SlotConnection +{ + // The transmitter TQObject. + void *sc_transmitter; + + // The parsed signature. + const pytqt3Signature *sc_signature; + + // The slot. + sipSlot sc_slot; +}; + + +// This class is used as a slot on behalf of connections to a Python callable. +// It is derived from TQObject but is not run through moc. Instead the normal +// moc-generated methods are handwritten in order to implement a universal +// slot. This requires some knowledge of the internal implementation of +// signals and slots but it is likely that they will only change between major +// TQt versions. +class UniversalSlot : public TQObject +{ +public: + UniversalSlot(TQObject *tqtx, pytqt3SlotConnection *conn, const char **member); + ~UniversalSlot(); + + virtual TQMetaObject *metaObject() const + { + return staticMetaObject(); + } + + virtual bool tqt_invoke(int, TQUObject *args); + static TQMetaObject *staticMetaObject(); + + static TQObject *lastSender; + + static UniversalSlot *unislots; + UniversalSlot *nextus, *prevus; + pytqt3SlotConnection conn; + +private: + static TQMetaObject *metaObj; +}; + + +// Create a universal slot. Note that this will leak if there is no signal +// transmitter (ie. no parent) - TQTimer.singleShot() for example. +UniversalSlot::UniversalSlot(TQObject *tqtx, pytqt3SlotConnection *connection, const char **member) : TQObject() +{ + // Save the connection. + conn = *connection; + + // Detect when the transmitter is destroyed. + if (tqtx) + connect(tqtx, SIGNAL(destroyed(TQObject *)), SLOT(deleteLater())); + + // Return the slot to connect to. + *member = SLOT(unislot()); + + // Add this one to the global list. + nextus = unislots; + + if (nextus) + nextus -> prevus = this; + + prevus = 0; + unislots = this; +} + + +// Destroy a universal slot. +UniversalSlot::~UniversalSlot() +{ + SIP_BLOCK_THREADS + sipFreeSipslot(&conn.sc_slot); + SIP_UNBLOCK_THREADS + + // Remove this one from the global list. + if (nextus) + nextus -> prevus = prevus; + + if (prevus) + prevus -> nextus = nextus; + else + unislots = nextus; +} + + +// The last Python signal sender. +static PyObject *py_sender = 0; + + +TQMetaObject *UniversalSlot::metaObj = 0; + +static TQMetaObjectCleanUp cleanUp_UniversalSlot("UniversalSlot", &UniversalSlot::staticMetaObject); + +TQObject *UniversalSlot::lastSender = 0; +UniversalSlot *UniversalSlot::unislots = 0; + + +TQMetaObject *UniversalSlot::staticMetaObject() +{ + if (metaObj) + return metaObj; + + // Define a single slot that takes no arguments and so will accept any + // connection. + static const TQUMethod slot = {"unislot", 0, 0}; + static const TQMetaData slot_tbl[] = { + {"unislot()", &slot, TQMetaData::Public} + }; + + metaObj = TQMetaObject::new_metaobject( + "UniversalSlot", TQObject::staticMetaObject(), + slot_tbl, 1, + 0, 0, +#ifndef TQT_NO_PROPERTIES + 0, 0, + 0, 0, +#endif + 0, 0); + + cleanUp_UniversalSlot.setMetaObject(metaObj); + + return metaObj; +} + + +bool UniversalSlot::tqt_invoke(int id, TQUObject *qargs) +{ + if (id - staticMetaObject()->slotOffset() != 0) + return TQObject::tqt_invoke(id, qargs); + + bool ok = TRUE; + const pytqt3Signature *psig = conn.sc_signature; + TQVariant *qv; + + // Save in case it is asked for later. + lastSender = const_cast<TQObject *>(sender()); + + // If the sender was a TQSignal then the single argument will be wrapped + // in a TQVariant instance. At the moment we handle int argument as + // that is all that is needed by PyTQt (and PyKDE). + if (lastSender->inherits("TQSignal")) + qv = &static_QUType_TQVariant.get(qargs + 1); + else + qv = 0; + +#ifdef WITH_THREAD + PyGILState_STATE state = PyGILState_Ensure(); +#endif + + PyObject *argtup = PyTuple_New(psig->sg_nrargs); + + if (!argtup) + ok = FALSE; + else + { + for (int a = 0; a < psig->sg_nrargs; ++a) + { + PyObject *arg; + + ++qargs; + + switch (psig->sg_args[a].atype) + { + case char_sat: + case schar_sat: + case uchar_sat: + arg = PyBytes_FromStringAndSize((char *)static_QUType_ptr.get(qargs), 1); + break; + + case string_sat: + case sstring_sat: + case ustring_sat: + arg = PyBytes_FromString((char *)static_QUType_ptr.get(qargs)); + break; + + case short_sat: + arg = PyLong_FromLong(*(short *)static_QUType_ptr.get(qargs)); + break; + + case ushort_sat: + arg = PyLong_FromUnsignedLong(*(unsigned short *)static_QUType_ptr.get(qargs)); + break; + + case int_sat: + if (qv) + arg = PyLong_FromLong(qv -> asInt()); + else + arg = PyLong_FromLong(static_QUType_int.get(qargs)); + break; + + case uint_sat: + arg = PyLong_FromUnsignedLong(*(unsigned *)static_QUType_ptr.get(qargs)); + break; + + case long_sat: + arg = PyLong_FromLong(*(long *)static_QUType_ptr.get(qargs)); + break; + + case ulong_sat: + arg = PyLong_FromUnsignedLong(*(unsigned long *)static_QUType_ptr.get(qargs)); + break; + + case longlong_sat: + arg = PyLong_FromLongLong(*(PY_LONG_LONG *)static_QUType_ptr.get(qargs)); + break; + + case ulonglong_sat: + arg = PyLong_FromUnsignedLongLong(*(unsigned PY_LONG_LONG *)static_QUType_ptr.get(qargs)); + break; + + case float_sat: + arg = PyFloat_FromDouble(*(float *)static_QUType_ptr.get(qargs)); + break; + + case double_sat: + arg = PyFloat_FromDouble(static_QUType_double.get(qargs)); + break; + + case enum_sat: + arg = sipConvertFromNamedEnum(*(int *)static_QUType_ptr.get(qargs), psig->sg_args[a].u.et); + break; + + case bool_sat: + arg = PyLong_FromLong(static_QUType_bool.get(qargs)); + break; + + case void_sat: + arg = sipConvertFromVoidPtr((void *)static_QUType_ptr.get(qargs)); + break; + + case class_sat: + case classp_sat: + arg = sipConvertFromInstance((void *)static_QUType_ptr.get(qargs),psig->sg_args[a].u.wt,0); + break; + + case mtype_sat: + case mtypep_sat: + arg = sipConvertFromMappedType((void *)static_QUType_ptr.get(qargs),psig->sg_args[a].u.mt,0); + break; + + case qvariant_sat: + case qvariantp_sat: + arg = sipConvertFromInstance((void *)&static_QUType_TQVariant.get(qargs),sipClass_TQVariant,0); + break; + + case pyobject_sat: + arg = (PyObject *)static_QUType_ptr.get(qargs); + break; + + default: + arg = Py_NotImplemented; + Py_INCREF(Py_NotImplemented); + } + + PyTuple_SET_ITEM(argtup, a, arg); + } + + // Dispatch to the real slot. + if (ok) + { + PyObject *res = sipInvokeSlot(&conn.sc_slot, argtup); + + if (res) + Py_DECREF(res); + else + ok = FALSE; + } + + Py_DECREF(argtup); + } + + if (!ok) + PyErr_Print(); + +#ifdef WITH_THREAD + PyGILState_Release(state); +#endif + + return ok; +} + + +static pytqt3Signature *parseSignature(const char *sig); +static void parseType(const char *type, pytqt3SigArg *arg); + + +// Factory function to create a universal slot instance. Returns a pointer to +// the instance or 0 if there was an error. +static void *sipTQtCreateUniversalSlot(sipWrapper *tx, const char *sig, + PyObject *rxObj, const char *slot, const char **member, int) +{ + pytqt3SlotConnection conn; + + /* Initialise the connection. */ + if (tx && sipGetAddress(&tx->super) == NULL) + { + conn.sc_transmitter = 0; + } + else + { + conn.sc_transmitter = (tx ? sipGetCppPtr(&tx->super, 0) : 0); + } + + /* Save the real slot. */ + if (sipSaveSlot(&conn.sc_slot, rxObj, slot) < 0) + return 0; + + /* Parse the signature and create the universal slot. */ + if ((conn.sc_signature = parseSignature(sig)) == NULL) + { + sipFreeSipslot(&conn.sc_slot); + return 0; + } + + TQObject *tqtx = 0; + + // See if the transmitter is a TQObject in which case we will connect + // to it's destroyed signal so that the universal slot can be destroyed + // at the same time. (Note that we used to do this by making the + // universal slot a child of the transmitter. This doesn't work as + // expected because TQWidget destroys its children before emitting the + // destroyed signal.) + if (tx && PyObject_TypeCheck((PyObject *)tx, (PyTypeObject *)sipClass_TQObject)) + tqtx = reinterpret_cast<TQObject *>(conn.sc_transmitter); + + return new UniversalSlot(tqtx, &conn, member); +} + + +// Parse the signal arguments for a connection. +static pytqt3Signature *parseSignature(const char *sig) +{ + static pytqt3Signature *psig_list = NULL; + pytqt3Signature *psig; + const char *sp, *ep; + + // First see if it has already been parsed. Note that both sides of a + // connection will probably be parsed twice because the function names will + // be different even though the signatures will probably be the same. We + // could be more clever, the most saving is when repeatedly emitting a + // signal for which this is sufficient. + for (psig = psig_list; psig != NULL; psig = psig->sg_next) + if (sipTQtSameSignalSlotName(psig->sg_signature, sig)) + return psig; + + // Create a new one including space for the copy of the signature. + if ((psig = (pytqt3Signature *)sipMalloc(sizeof (pytqt3Signature) + strlen(sig) + 1)) == NULL) + return NULL; + + psig->sg_signature = (char *)&psig[1]; + psig->sg_nrargs = 0; + psig->sg_args = 0; + + // Find the start and end of the arguments. + sp = strchr(sig, '('); + ep = strrchr(sig, ')'); + + // If the signal isn't well formed we assume TQt will pick it up. + if (sp && ep && sp < ep) + { + // Copy the signature arguments while counting them and removing + // non-significant spaces. Each argument is left as a '\0' terminated + // string. + char *dp = psig->sg_signature; + int depth = 0, nrcommas = 0, argstart = TRUE; + + for (;;) + { + char ch = *++sp; + + if (strchr(",*&)<>", ch)) + { + // Backup over any previous trailing space. + if (dp > psig->sg_signature && dp[-1] == ' ') + --dp; + + if (sp == ep) + { + *dp = '\0'; + break; + } + + if (ch == ',' && depth == 0) + { + *dp++ = '\0'; + ++nrcommas; + argstart = TRUE; + } + else + { + *dp++ = ch; + + // Make sure commas in template arguments are ignored. + if (ch == '<') + ++depth; + else if (ch == '>') + --depth; + } + } + else if (ch == ' ') + { + // Ignore leading and multiple spaces. + if (!argstart && dp[-1] != ' ') + *dp++ = ch; + } + else + { + *dp++ = ch; + argstart = FALSE; + } + } + + // Handle the arguments now they are in a normal form. + if (*psig->sg_signature) + { + char *arg = psig->sg_signature; + int a; + + // Allocate the space. + psig->sg_nrargs = nrcommas + 1; + + if ((psig->sg_args = (pytqt3SigArg *)sipMalloc(sizeof (pytqt3SigArg) * psig->sg_nrargs)) == NULL) + { + sipFree(psig); + return NULL; + } + + for (a = 0; a < psig->sg_nrargs; ++a) + { + parseType(arg, &psig->sg_args[a]); + + // Move to the start of the next argument. + arg += strlen(arg) + 1; + } + } + } + + // Make a deep copy of the signal. + strcpy(psig->sg_signature, sig); + + // Add it to the list so it can be re-used. + psig->sg_next = psig_list; + psig_list = psig; + + return psig; +} + + +// Parse a single type. +static void parseType(const char *type, pytqt3SigArg *arg) +{ + size_t btlen = 0; + int unsup, isref = FALSE, indir = 0; + const char *ep; + pytqt3SigArgType sat = unknown_sat; + + // Find the start of the significant part of the type. + if (strncmp(type, "const ", 6) == 0) + type += 6; + + // Find the length of the base type, the number of indirections and if it + // is a reference. + for (ep = type; *ep; ++ep) + if (*ep == '&') + isref = TRUE; + else if (*ep == '*') + ++indir; + else + ++btlen; + + // Extract the base type as a separate string. + char type_str[btlen + 1]; + + strncpy(type_str, type, btlen); + type_str[btlen] = '\0'; + + // Resolve any typedef which may mean more indirection. + type = sipResolveTypedef(type_str); + + // See if we need to make another copy. + bool copy = false; + + if (type) + { + btlen = strlen(type); + + // Remove any additional indirection. + while (btlen) + { + if (type[--btlen] == '*') + { + copy = true; + ++indir; + } + } + } + else + type = type_str; + + // Make sure this doesn't go out of scope while it is being used. + char base_type_str[btlen + 1]; + + if (copy) + { + // Extract the base type again. + strncpy(base_type_str, type, btlen); + base_type_str[btlen] = '\0'; + type = base_type_str; + } + + // Assume that anything other than a base type is unsupported. + unsup = (isref || indir); + + // Parse the base type. + switch (btlen) + { + case 3: + if (strcmp(type, "int") == 0) + sat = int_sat; + break; + + case 4: + if (strcmp(type, "bool") == 0) + sat = bool_sat; + else if (strcmp(type, "long") == 0) + sat = long_sat; + else if (strcmp(type, "char") == 0) + { + sat = (indir ? string_sat : char_sat); + unsup = (isref || indir > 1); + } + else if (strcmp(type, "void") == 0) + { + sat = void_sat; + unsup = (isref || indir != 1); + } + break; + + case 5: + if (strcmp(type, "float") == 0) + sat = float_sat; + else if (strcmp(type, "short") == 0) + sat = short_sat; + break; + + case 6: + if (strcmp(type, "double") == 0) + sat = double_sat; + break; + + case 7: + if (strcmp(type, "__int64") == 0) + sat = longlong_sat; + else if (strcmp(type, "wchar_t") == 0) + { + sat = (indir ? wstring_sat : wchar_sat); + unsup = (isref || indir > 1); + } + break; + + case 8: + if (strcmp(type, "unsigned") == 0) + sat = uint_sat; + else if (strcmp(type, "TQVariant") == 0) + { + if (indir == 0) + { + sat = qvariant_sat; + unsup = FALSE; + } + else if (indir == 1) + { + sat = qvariantp_sat; + unsup = FALSE; + } + } + break; + + case 9: + if (strcmp(type, "long long") == 0) + sat = longlong_sat; + break; + + case 11: + if (strcmp(type, "signed char") == 0) + { + sat = (indir ? sstring_sat : schar_sat); + unsup = (isref || indir > 1); + } + break; + + case 12: + if (strcmp(type, "unsigned int") == 0) + sat = uint_sat; + break; + + case 13: + if (strcmp(type, "unsigned long") == 0) + sat = ulong_sat; + else if (strcmp(type, "unsigned char") == 0) + { + sat = (indir ? ustring_sat : uchar_sat); + unsup = (isref || indir > 1); + } + else if (strcmp(type, "PyTQt_PyObject") == 0 && indir == 0) + { + sat = pyobject_sat; + unsup = FALSE; + } + break; + + case 14: + if (strcmp(type, "unsigned short") == 0) + sat = ushort_sat; + break; + + case 16: + if (strcmp(type, "unsigned __int64") == 0) + sat = ulonglong_sat; + break; + + case 18: + if (strcmp(type, "unsigned long long") == 0) + sat = ulonglong_sat; + break; + } + + if (sat == unknown_sat) + { + const sipTypeDef *td = sipFindType(type); + + if (td) + { + if (sipTypeIsClass(td)) + { + if (indir == 0) + sat = class_sat; + else if (indir == 1) + sat = classp_sat; + + arg->u.wt = (sipWrapperType *)sipTypeAsPyTypeObject(td); + } + else if (sipTypeIsMapped(td)) + { + if (indir == 0) + sat = mtype_sat; + else if (indir == 1) + sat = mtypep_sat; + + arg->u.mt = td; + } + else if (sipTypeIsEnum(td)) + { + if (indir == 0) + sat = enum_sat; + + arg->u.et = sipTypeAsPyTypeObject(td); + } + } + } + else if (unsup) + sat = unknown_sat; + + arg->atype = sat; +} + + +// Dispose of a receiver that might be a universal slot. +static void sipTQtDestroyUniversalSlot(void *rx) +{ + for (UniversalSlot *us = UniversalSlot::unislots; us; us = us->nextus) + if (us == reinterpret_cast<TQObject *>(rx)) + { + delete us; + break; + } +} + + +// Search for the universal slot connected to a particular TQt signal. +static void *sipTQtFindSlot(void *tx, const char *sig, PyObject *rxObj, + const char *slot, const char **member) +{ + for (UniversalSlot *us = UniversalSlot::unislots; us; us = us->nextus) + { + pytqt3SlotConnection *conn = &us->conn; + + if (conn->sc_transmitter != tx) + continue; + + if (!sipTQtSameSignalSlotName(conn->sc_signature->sg_signature, sig)) + continue; + + if (sipSameSlot(&conn->sc_slot, rxObj, slot)) + { + *member = SLOT(unislot()); + return us; + } + } + + return 0; +} + + +// Connect a TQt signal to a TQt slot. +static int sipTQtConnect(void *tx, const char *sig, void *rx, const char *slot, int) +{ + return TQObject::connect(reinterpret_cast<TQObject *>(tx), sig, + reinterpret_cast<TQObject *>(rx), slot); +} + + +// Disconnect a TQt signal from a TQt slot. +static int sipTQtDisconnect(void *tx, const char *sig, void *rx, const char *slot) +{ + return TQObject::disconnect(reinterpret_cast<TQObject *>(tx), sig, + reinterpret_cast<TQObject *>(rx), slot); +} + + +// See if two signal or slot names are the same. +static int sipTQtSameSignalSlotName(const char *s1, const char *s2) +{ + // moc formats signal names, so we should first convert the supplied + // string to the same format before comparing them. Instead we just + // compare them as they are, but ignoring all spaces - this will have + // the same result. + do + { + // Skip any spaces. + + while (*s1 == ' ') + ++s1; + + while (*s2 == ' ') + ++s2; + + if (*s1++ != *s2) + return 0; + } + while (*s2++ != '\0'); + + return 1; +} + + +// Return the next slot for a particular transmitter. This will be called with +// the GIL locked. +static sipSlot *sipTQtFindSipslot(void *tx, void **context) +{ + UniversalSlot *us = *reinterpret_cast<UniversalSlot **>(context); + + if (!us) + us = UniversalSlot::unislots; + + sipSlot *slot = 0; + + while (us) + { + pytqt3SlotConnection *this_conn = &us->conn; + + us = us->nextus; + + if (this_conn->sc_transmitter == tx) + { + slot = &this_conn->sc_slot; + break; + } + } + + *context = us; + + return slot; +} + + +// Connect a slot from a Python signal. +static int sipTQtConnectPySignal(PyObject *txObj, const char *sig, + PyObject *rxObj, const char *slot) +{ + pytqt3PySig *ps; + pytqt3SlotList *psrx; + pytqtWrapper *pw = (pytqtWrapper *)txObj; + + /* Create a new one if necessary. */ + if ((ps = find_py_signal(pw, sig)) == NULL) + { + if ((ps = (pytqt3PySig *)sipMalloc(sizeof (pytqt3PySig))) == NULL) + return -1; + + if ((ps->name = (char *)sipMalloc(strlen(sig) + 1)) == NULL) + { + sipFree(ps); + return -1; + } + + strcpy(ps->name, sig); + + ps->rxlist = NULL; + ps->next = pw->pySigList; + + pw->pySigList = ps; + } + + /* Create the new receiver. */ + if ((psrx = (pytqt3SlotList *)sipMalloc(sizeof (pytqt3SlotList))) == NULL) + return -1; + + if (sipSaveSlot(&psrx->rx, rxObj, slot) < 0) + { + sipFree(psrx); + return -1; + } + + psrx->next = ps->rxlist; + ps->rxlist = psrx; + + return 0; +} + + +// Disconnect a slot from a Python signal. +static void sipTQtDisconnectPySignal(PyObject *txObj, const char *sig, + PyObject *rxObj, const char *slot) +{ + pytqt3PySig *ps; + + if ((ps = find_py_signal((pytqtWrapper *)txObj, sig)) != NULL) + { + pytqt3SlotList **psrxp; + + for (psrxp = &ps->rxlist; *psrxp != NULL; psrxp = &(*psrxp)->next) + { + pytqt3SlotList *psrx = *psrxp; + + if (sipSameSlot(&psrx->rx, rxObj, slot)) + { + *psrxp = psrx->next; + free_slot_list(psrx); + break; + } + } + } +} + + +// Emit a signal for the sip module. +static int sipTQtEmitSignal(PyObject *self, const char *sig, PyObject *sigargs) +{ + return pytqtEmitSignal(self, sig, sigargs); +} + + +// Emit a Python or TQt signal. +int pytqtEmitSignal(PyObject *self, const char *sig, PyObject *sigargs) +{ + // Don't do anything if signals are blocked. TQt signals would be blocked + // anyway, but this blocks Python signals as well. + void *tx = sipGetCppPtr((sipSimpleWrapper *)self, sipType_TQObject); + + if (!tx) + return 0; + + if (reinterpret_cast<TQObject *>(tx)->signalsBlocked()) + return 0; + + // See if it is a TQt signal. + if (*sig == '2') + { + pytqtTQtSignal *tab; + + // Search the table. + for (tab = ((pytqtClassTypeDef *)((sipWrapperType *)(self->ob_type))->type)->tqt_emit; tab->st_name != NULL; ++tab) + { + const char *sp, *tp; + bool found; + + // Compare only the base name. + sp = &sig[1]; + tp = tab->st_name; + + found = true; + + while (*sp != '\0' && *sp != '(' && *tp != '\0') + if (*sp++ != *tp++) + { + found = false; + break; + } + + if (found) + return (*tab->st_emitfunc)((sipSimpleWrapper *)self, sigargs); + } + + // It wasn't found if we got this far. + PyErr_Format(PyExc_NameError, "Invalid signal %s", &sig[1]); + + return -1; + } + + pytqt3PySig *ps = find_py_signal((pytqtWrapper *)self, sig); + + if (ps) + { + int rc = 0; + pytqt3SlotList *rxlist = ps->rxlist; + + // Forget the last TQt sender and remember this one. + UniversalSlot::lastSender = 0; + py_sender = self; + + // Apply the arguments to each slot method. + while (rxlist && rc >= 0) + { + pytqt3SlotList *next; + PyObject *res; + + // We get the next in the list before calling the slot in case the + // list gets changed by the slot - usually because the slot + // disconnects itself. + next = rxlist->next; + + res = sipInvokeSlot(&rxlist->rx, sigargs); + + if (res) + Py_DECREF(res); + else + rc = -1; + + rxlist = next; + } + + // Forget this as a sender. + py_sender = NULL; + + return rc; + } + + return 0; +} + + +// Return the most recent signal sender. +PyObject *pytqt3GetSender() +{ + PyObject *sender; + + // If there is a TQt sender then it is more recent than the last Python + // sender, so use it instead. + if (UniversalSlot::lastSender) + { + sender = sipConvertFromType(UniversalSlot::lastSender, sipType_TQObject, + NULL); + } + else + { + sender = (py_sender ? py_sender : Py_None); + Py_INCREF(sender); + } + + return sender; +} + +%End + +%InitialisationCode + // Initialise the meta-type. + pytqtWrapperType_Type.tp_base = sipWrapperType_Type; + + if (PyType_Ready(&pytqtWrapperType_Type) < 0) + Py_FatalError("tqt: Failed to initialise pytqtWrapperType type"); + + // Register the meta-type. + if (sipRegisterPyType((PyTypeObject *)&pytqtWrapperType_Type) < 0) + Py_FatalError("tqt: Failed to register pytqtWrapperType type"); + + // Initialise the super-type. + pytqtWrapper_Type.super.ht_type.tp_base = sipWrapper_Type; + + if (PyType_Ready((PyTypeObject *)&pytqtWrapper_Type) < 0) + Py_FatalError("tqt: Failed to initialise pytqtWrapper type"); + + // Register the super-type. + if (sipRegisterPyType((PyTypeObject *)&pytqtWrapper_Type) < 0) + Py_FatalError("tqt: Failed to register pytqtWrapper type"); +%End diff --git a/sip/tqt/tqobjectcleanuphandler.sip b/sip/tqt/tqobjectcleanuphandler.sip new file mode 100644 index 0000000..f633e3b --- /dev/null +++ b/sip/tqt/tqobjectcleanuphandler.sip @@ -0,0 +1,45 @@ +// This is the SIP interface definition for TQObjectCleanupHandler. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQObjectCleanupHandler (TQt v3+)</Title> +<Para> +<Literal>TQObjectCleanupHandler</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQObjectCleanupHandler : TQObject +{ +%TypeHeaderCode +#include <tqobjectcleanuphandler.h> +%End + +public: + TQObjectCleanupHandler(); + + TQObject *add(TQObject *); + void remove(TQObject *); + bool isEmpty() const; + void clear(); +}; diff --git a/sip/tqt/tqobjectlist.sip b/sip/tqt/tqobjectlist.sip new file mode 100644 index 0000000..c0b2b48 --- /dev/null +++ b/sip/tqt/tqobjectlist.sip @@ -0,0 +1,107 @@ +// This is the SIP interface definition for TQObjectList. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQObjectList</Title> +<Para> +This class isn't implemented. Whenever a <Literal>TQObjectList</Literal> is the +return type of a function or the type of an argument, a Python list of +<Literal>TQObject</Literal> instances is used instead. +</Para> +</Sect2> +%End + + +%MappedType TQObjectList +{ +%TypeHeaderCode +#include <tqobjectlist.h> +%End + +%ConvertFromTypeCode + // Convert the list. + + PyObject *pl; + TQObject *obj; + + if ((pl = PyList_New(0)) == NULL) + return NULL; + + for (TQObjectListIt it(*sipCpp); (obj = it.current()) != NULL; ++it) + { + PyObject *inst; + + if ((inst = sipConvertFromInstance(obj,sipClass_TQObject,sipTransferObj)) == NULL || PyList_Append(pl,inst) < 0) + { + Py_XDECREF(inst); + Py_DECREF(pl); + + return NULL; + } + + Py_DECREF(inst); + } + + return pl; +%End + +%ConvertToTypeCode + // Convert a Python list of TQObject instances to a TQObjectList on the + // heap. + + if (sipIsErr == NULL) + { + if (!PyList_Check(sipPy)) + return 0; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_TQObject,0)) + return 0; + + return 1; + } + + TQObjectList *tqol = new TQObjectList; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + TQObject *tqobj; + + // We apply the transfer to the list itself, not the elements. + // Note that any temporary element will never be destroyed. + // There is nothing that can be done about this. + tqobj = reinterpret_cast<TQObject *>(sipConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_TQObject,0,0,0,sipIsErr)); + + if (*sipIsErr) + { + delete tqol; + return 0; + } + + tqol -> append(tqobj); + } + + *sipCppPtr = tqol; + + return sipGetState(sipTransferObj); +%End +}; diff --git a/sip/tqt/tqpaintdevice.sip b/sip/tqt/tqpaintdevice.sip new file mode 100644 index 0000000..80a2765 --- /dev/null +++ b/sip/tqt/tqpaintdevice.sip @@ -0,0 +1,170 @@ +// This is the SIP interface definition for TQPaintDevice. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQPaintDevice</Title> +<FuncSynopsis> + <FuncDef>virtual bool <Function>cmd</Function></FuncDef> + <ParamDef>int</ParamDef> + <ParamDef>TQPainter *</ParamDef> + <ParamDef>TQPDevCmdParam *</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +%End + + +%ModuleHeaderCode +#include <tqpaintdevice.h> +%End + + +void bitBlt(TQPaintDevice *,int,int,const TQPaintDevice *,int = 0,int = 0, + int = -1,int = -1,TQt::RasterOp = TQt::CopyROP,bool = 0); +void bitBlt(TQPaintDevice *,int,int,const TQImage *,int = 0,int = 0,int = -1, + int = -1,int = 0); +void bitBlt(TQPaintDevice *,const TQPoint &,const TQPaintDevice *, + const TQRect & = TQRect(0,0,-1,-1),TQt::RasterOp = TQt::CopyROP, + bool = 0); + + +class TQPaintDevice +{ +%TypeHeaderCode +#include <tqpaintdevice.h> +%End + +public: + int devType() const; + bool isExtDev() const; + bool paintingActive() const; + + virtual void setResolution(int); + virtual int resolution() const; + +%If (WS_X11) + TQt::HANDLE handle() const; + TQt::HANDLE x11RenderHandle() const; + Display *x11Display() const; + int x11Screen() const; + int x11Depth() const; + int x11Cells() const; + TQt::HANDLE x11Colormap() const; + bool x11DefaultColormap() const; + void *x11Visual() const; + bool x11DefaultVisual() const; + + static Display *x11AppDisplay(); + static int x11AppScreen(); + + static int x11AppDpiX(); + static int x11AppDpiY(); + static void x11SetAppDpiX(int); + static void x11SetAppDpiY(int); + static int x11AppDepth(); + static int x11AppCells(); + static TQt::HANDLE x11AppRootWindow(); + static TQt::HANDLE x11AppColormap(); + static bool x11AppDefaultColormap(); + static void *x11AppVisual(); + static bool x11AppDefaultVisual(); + + static int x11AppDepth(int); + static int x11AppCells(int); + static TQt::HANDLE x11AppRootWindow(int); + static TQt::HANDLE x11AppColormap(int); + static void *x11AppVisual(int); + static bool x11AppDefaultColormap(int); + static bool x11AppDefaultVisual(int); + static int x11AppDpiX(int); + static int x11AppDpiY(int); + static void x11SetAppDpiX(int,int); + static void x11SetAppDpiY(int,int); +%End + + enum PDevCmd + { + PdcNOP, + PdcDrawPoint, + PdcDrawFirst, + PdcMoveTo, + PdcLineTo, + PdcDrawLine, + PdcDrawRect, + PdcDrawRoundRect, + PdcDrawEllipse, + PdcDrawArc, + PdcDrawPie, + PdcDrawChord, + PdcDrawLineSegments, + PdcDrawPolyline, + PdcDrawPolygon, + PdcDrawCubicBezier, + PdcDrawText, + PdcDrawTextFormatted, + PdcDrawPixmap, + PdcDrawImage, + PdcDrawText2, + PdcDrawText2Formatted, + PdcDrawTextItem, + PdcDrawLast, + + PdcBegin, + PdcEnd, + PdcSave, + PdcRestore, + PdcSetdev, + PdcSetBkColor, + PdcSetBkMode, + PdcSetROP, + PdcSetBrushOrigin, + PdcSetFont, + PdcSetPen, + PdcSetBrush, + PdcSetTabStops, + PdcSetTabArray, + PdcSetUnit, + PdcSetVXform, + PdcSetWindow, + PdcSetViewport, + PdcSetWXform, + PdcSetWMatrix, + PdcSaveWMatrix, + PdcRestoreWMatrix, + PdcSetClip, + PdcSetClipRegion, + PdcReservedStart, + PdcReservedStop + }; + +protected: + TQPaintDevice(uint); +// virtual bool cmd(int,TQPainter *,TQPDevCmdParam *); +// virtual int metric(int) const; +// virtual int fontMet(TQFont *,int,const char *,int = 0) const; +// virtual int fontInf(TQFont *,int) const; + +private: + TQPaintDevice(const TQPaintDevice &); +}; diff --git a/sip/tqt/tqpaintdevicemetrics.sip b/sip/tqt/tqpaintdevicemetrics.sip new file mode 100644 index 0000000..a0358c8 --- /dev/null +++ b/sip/tqt/tqpaintdevicemetrics.sip @@ -0,0 +1,51 @@ +// This is the SIP interface definition for TQPaintDeviceMetrics. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQPaintDeviceMetrics</Title> +<Para> +<Literal>TQPaintDeviceMetrics</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQPaintDeviceMetrics +{ +%TypeHeaderCode +#include <tqpaintdevicemetrics.h> +%End + +public: + TQPaintDeviceMetrics(const TQPaintDevice *); + + int width() const; + int height() const; + int widthMM() const; + int heightMM() const; + int logicalDpiX() const; + int logicalDpiY() const; + int physicalDpiX() const; + int physicalDpiY() const; + int numColors() const; + int depth() const; +}; diff --git a/sip/tqt/tqpainter.sip b/sip/tqt/tqpainter.sip new file mode 100644 index 0000000..8111400 --- /dev/null +++ b/sip/tqt/tqpainter.sip @@ -0,0 +1,360 @@ +// This is the SIP interface definition for TQPainter. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQPainter</Title> +<FuncSynopsis> + <FuncDef>TQRect <Function>boundingRect</Function></FuncDef> + <ParamDef>int <Parameter>x</Parameter></ParamDef> + <ParamDef>int <Parameter>y</Parameter></ParamDef> + <ParamDef>int <Parameter>w</Parameter></ParamDef> + <ParamDef>int <Parameter>h</Parameter></ParamDef> + <ParamDef>int <Parameter>flags</Parameter></ParamDef> + <ParamDef>const char *<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>len</Parameter> = -1</ParamDef> + <ParamDef>char **<Parameter>intern</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>intern</Literal> parameter is not supported. +</Para> + +<FuncSynopsis> + <FuncDef>TQRect <Function>boundingRect</Function></FuncDef> + <ParamDef>const TQRect&</ParamDef> + <ParamDef>int <Parameter>flags</Parameter></ParamDef> + <ParamDef>const char *<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>len</Parameter> = -1</ParamDef> + <ParamDef>char **<Parameter>intern</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>intern</Literal> parameter is not supported. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>drawText</Function></FuncDef> + <ParamDef>int <Parameter>x</Parameter></ParamDef> + <ParamDef>int <Parameter>y</Parameter></ParamDef> + <ParamDef>int <Parameter>w</Parameter></ParamDef> + <ParamDef>int <Parameter>h</Parameter></ParamDef> + <ParamDef>int <Parameter>flags</Parameter></ParamDef> + <ParamDef>const char *<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>len</Parameter> = -1</ParamDef> + <ParamDef>TQRect *<Parameter>br</Parameter> = 0</ParamDef> + <ParamDef>char **<Parameter>intern</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>intern</Literal> parameter is not supported. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>drawText</Function></FuncDef> + <ParamDef>const TQRect&</ParamDef> + <ParamDef>int <Parameter>flags</Parameter></ParamDef> + <ParamDef>const char *<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>len</Parameter> = -1</ParamDef> + <ParamDef>TQRect *<Parameter>br</Parameter> = 0</ParamDef> + <ParamDef>char **<Parameter>intern</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>intern</Literal> parameter is not supported. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>setTabArray</Function></FuncDef> + <ParamDef>int *<Parameter>ta</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single parameter which is a list of tab stops. +</Para> + +<FuncSynopsis> + <FuncDef>int *<Function>tabArray</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This returns a list of tab stops. +</Para> +</Sect2> +%End + + +class TQPainter : TQt +{ +%TypeHeaderCode +#include <tqpainter.h> +%End + +public: + enum CoordinateMode { + CoordDevice, + CoordPainter + }; + + TQPainter(); + TQPainter(const TQPaintDevice *,bool = 0); + TQPainter(const TQPaintDevice *,const TQWidget *,bool = 0); + + bool begin(const TQPaintDevice *,bool = 0); + bool begin(const TQPaintDevice *,const TQWidget *,bool = 0); + bool end(); + TQPaintDevice *device() const; + + static void redirect(TQPaintDevice *,TQPaintDevice *); + + bool isActive() const; + + void flush(const TQRegion &,CoordinateMode = CoordDevice); + void flush(); + void save(); + void restore(); + + TQFontMetrics fontMetrics() const; + TQFontInfo fontInfo() const; + + const TQFont &font() const; + void setFont(const TQFont&); + const TQPen &pen() const; + void setPen(const TQPen &); + void setPen(PenStyle); + void setPen(const TQColor &); + const TQBrush &brush() const; + void setBrush(const TQBrush &); + void setBrush(BrushStyle); + void setBrush(const TQColor &); + + const TQColor &backgroundColor() const; + void setBackgroundColor(const TQColor &); + BGMode backgroundMode() const; + void setBackgroundMode(BGMode); + RasterOp rasterOp() const; + void setRasterOp(RasterOp); + const TQPoint &brushOrigin() const; + void setBrushOrigin(int,int); + void setBrushOrigin(const TQPoint &); + + bool hasViewXForm() const; + bool hasWorldXForm() const; + +%If (TQt_TRANSFORMATIONS) + void setViewXForm(bool); + TQRect window() const; + void setWindow(const TQRect &); + void setWindow(int,int,int,int); + TQRect viewport() const; + void setViewport(const TQRect &); + void setViewport(int,int,int,int); + + void setWorldXForm(bool); + const TQWMatrix &worldMatrix() const; + void setWorldMatrix(const TQWMatrix &,bool = 0); + + void saveWorldMatrix(); + void restoreWorldMatrix(); + + void scale(double,double); + void shear(double,double); + void rotate(double); +%End + void translate(double,double); + void resetXForm(); + double translationX() const; + double translationY() const; + + TQPoint xForm(const TQPoint &) const; + TQRect xForm(const TQRect &) const; + TQPointArray xForm(const TQPointArray &) const; + TQPointArray xForm(const TQPointArray &,int,int) const; + TQPoint xFormDev(const TQPoint &) const; + TQRect xFormDev(const TQRect &) const; + TQPointArray xFormDev(const TQPointArray &) const; + TQPointArray xFormDev(const TQPointArray &,int,int) const; + + void setClipping(bool); + bool hasClipping() const; + TQRegion clipRegion(CoordinateMode = CoordDevice) const; + void setClipRect(const TQRect &,CoordinateMode = CoordDevice); + void setClipRect(int,int,int,int,CoordinateMode = CoordDevice); + void setClipRegion(const TQRegion &,CoordinateMode = CoordDevice); + + void drawPoint(int,int); + void drawPoint(const TQPoint &); + void drawPoints(const TQPointArray &,int,int = -1); + void moveTo(int,int); + void moveTo(const TQPoint &); + void lineTo(int,int); + void lineTo(const TQPoint &); + void drawLine(int,int,int,int); + void drawLine(const TQPoint &,const TQPoint &); + void drawRect(int,int,int,int); + void drawRect(const TQRect &); + void drawWinFocusRect(int,int,int,int); + void drawWinFocusRect(int,int,int,int,const TQColor &); + void drawWinFocusRect(const TQRect &); + void drawWinFocusRect(const TQRect &,const TQColor &); + void drawRoundRect(int,int,int,int,int = 25,int = 25); + void drawRoundRect(const TQRect &,int = 25,int = 25); + void drawEllipse(int,int,int,int); + void drawEllipse(const TQRect &); + void drawArc(int,int,int,int,int,int); + void drawArc(const TQRect &,int,int); + void drawPie(int,int,int,int,int,int); + void drawPie(const TQRect &,int,int); + void drawChord(int,int,int,int,int,int); + void drawChord(const TQRect &,int,int); + void drawLineSegments(const TQPointArray &,int = 0,int = -1); + void drawPolyline(const TQPointArray &,int = 0,int = -1); + void drawPolygon(const TQPointArray &,bool = 0,int = 0,int = -1); + void drawConvexPolygon(const TQPointArray &,int = 0,int = -1); + void drawCubicBezier(const TQPointArray &,int = 0); + void drawPixmap(int,int,const TQPixmap &,int = 0,int = 0,int = -1, + int = -1); + void drawPixmap(const TQPoint &,const TQPixmap &,const TQRect &); + void drawPixmap(const TQPoint &,const TQPixmap &); + void drawPixmap(const TQRect &,const TQPixmap &); + void drawImage(int,int,const TQImage &,int = 0,int = 0,int = -1, + int = -1,int = 0); + void drawImage(const TQPoint &,const TQImage &,const TQRect &,int = 0); + void drawImage(const TQPoint &,const TQImage &,int = 0); + void drawImage(const TQRect &,const TQImage &); + void drawTiledPixmap(int,int,int,int,const TQPixmap &,int = 0,int = 0); + void drawTiledPixmap(const TQRect &,const TQPixmap &,const TQPoint &); + void drawTiledPixmap(const TQRect &,const TQPixmap &); +%If (TQt_PICTURE) + void drawPicture(const TQPicture &); + void drawPicture(int,int,const TQPicture &); + void drawPicture(const TQPoint &,const TQPicture &); +%End + + void fillRect(int,int,int,int,const TQBrush &); + void fillRect(const TQRect &,const TQBrush &); + void eraseRect(int,int,int,int); + void eraseRect(const TQRect &); + + enum TextDirection { + Auto, + RTL, + LTR + }; + + void drawText(int,int,const TQString &,int = -1,TextDirection = Auto); + void drawText(const TQPoint &,const TQString &,int = -1, + TextDirection = Auto); + void drawText(int,int,const TQString &,int,int,TextDirection = Auto); + void drawText(const TQPoint &,const TQString &,int,int, + TextDirection = Auto); + void drawText(int,int,int,int,int,const TQString &,int = -1,TQRect * = 0); + void drawText(const TQRect &,int,const TQString &,int = -1,TQRect * = 0); + + TQRect boundingRect(int,int,int,int,int,const TQString &,int = -1); + TQRect boundingRect(const TQRect &,int,const TQString &,int = -1); + int tabStops() const; + void setTabStops(int); + + SIP_PYLIST tabArray() const; +%MethodCode + int *tabs; + + Py_BEGIN_ALLOW_THREADS + tabs = sipCpp -> tabArray(); + Py_END_ALLOW_THREADS + + int len = 0; + + if (tabs) + { + int *tp = tabs; + + do + ++len; + while (*tp++ != 0); + } + + if ((sipRes = PyList_New(len)) == NULL) + sipIsErr = 1; + else if (tabs) + { + int *tp = tabs; + + len = 0; + + do + { + if (PyList_SetItem(sipRes,len,PyLong_FromLong((long)*tp)) < 0) + { + Py_DECREF(sipRes); + sipIsErr = 1; + break; + } + + ++len; + } + while (*tp++ != 0); + } +%End + + void setTabArray(SIP_PYLIST); +%MethodCode + int len, *tabs; + + len = PyList_GET_SIZE(a0); + + // Allocate space for the array. Note, this memory is never + // reclaimed. + if ((tabs = (int *)sipMalloc(len * sizeof (int))) == NULL) + sipIsErr = 1; + else + { + // Convert the list. + + int *tp = tabs; + + for (int i = 0; i < len; ++i) + { + *tp++ = (int)PyLong_AsLong(PyList_GET_ITEM(a0,i)); + + if (PyErr_Occurred() != NULL) + { + sipFree((void *)tabs); + sipIsErr = 1; + break; + } + } + + if (!sipIsErr) + { + Py_BEGIN_ALLOW_THREADS + sipCpp -> setTabArray(tabs); + Py_END_ALLOW_THREADS + } + } +%End + +%If (WS_X11) + HANDLE handle() const; +%End + + static void initialize(); + static void cleanup(); + +private: + TQPainter(const TQPainter &); +}; diff --git a/sip/tqt/tqpair.sip b/sip/tqt/tqpair.sip new file mode 100644 index 0000000..1744b58 --- /dev/null +++ b/sip/tqt/tqpair.sip @@ -0,0 +1,79 @@ +// This is the SIP interface definition for all types based on the TQPair +// template. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQPair<type,type> (TQt v3+)</Title> +<Para> +Types based on the <Literal>TQPair</Literal> template are automatically +converted to and from Python tuples of two elements. +</Para> +</Sect2> +%End + + +%MappedType TQPair<int,int> +{ +%TypeHeaderCode +#include <tqpair.h> +%End + +%ConvertFromTypeCode + // Convert to a Python list of integers. + + PyObject *t; + + // Create the tuple. + + if ((t = PyTuple_New(2)) == NULL) + return NULL; + + // Fill it. + + PyTuple_SET_ITEM(t,0,PyLong_FromLong((long)sipCpp -> first)); + PyTuple_SET_ITEM(t,1,PyLong_FromLong((long)sipCpp -> second)); + + return t; +%End + +%ConvertToTypeCode + // Convert a Python tuple of integers to a TQPair<int,int> on the heap. + + if (sipIsErr == NULL) + return (PyTuple_Size(sipPy) == 2); + + PyErr_Clear(); + + int fst = (int)PyLong_AsLong(PyTuple_GET_ITEM(sipPy,0)); + int sec = (int)PyLong_AsLong(PyTuple_GET_ITEM(sipPy,1)); + + if (PyErr_Occurred() != NULL) + { + *sipIsErr = 1; + return 0; + } + + *sipCppPtr = new TQPair<int,int>(fst,sec); + + return 1; +%End +}; diff --git a/sip/tqt/tqpalette.sip b/sip/tqt/tqpalette.sip new file mode 100644 index 0000000..6e4bd98 --- /dev/null +++ b/sip/tqt/tqpalette.sip @@ -0,0 +1,82 @@ +// This is the SIP interface definition for TQPalette. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQPalette</Title> +<Para> +<Literal>TQPalette</Literal> is fully implemented, including the Python +<Literal>==</Literal> and <Literal>!=</Literal> operators. +</Para> +</Sect2> +%End + + +class TQPalette +{ +%TypeHeaderCode +#include <tqpalette.h> +%End + +public: + TQPalette(); + TQPalette(const TQColor &); + TQPalette(const TQColor &,const TQColor &); + TQPalette(const TQColorGroup &,const TQColorGroup &,const TQColorGroup &); + TQPalette(const TQPalette &); + + enum ColorGroup { + Normal, + Disabled, + Active, + Inactive, + NColorGroups + }; + + const TQColor &color(ColorGroup,TQColorGroup::ColorRole) const; + const TQBrush &brush(ColorGroup,TQColorGroup::ColorRole) const; + void setColor(ColorGroup,TQColorGroup::ColorRole,const TQColor &); + void setBrush(ColorGroup,TQColorGroup::ColorRole,const TQBrush &); + void setColor(TQColorGroup::ColorRole,const TQColor &); + void setBrush(TQColorGroup::ColorRole,const TQBrush &); + + TQPalette copy() const; + + const TQColorGroup &active() const; + const TQColorGroup &disabled() const; + const TQColorGroup &inactive() const; + const TQColorGroup &normal() const; + + void setActive(const TQColorGroup &); + void setDisabled(const TQColorGroup &); + void setInactive(const TQColorGroup &); + void setNormal(const TQColorGroup &); + + bool operator==(const TQPalette &) const; + bool operator!=(const TQPalette &) const; + + bool isCopyOf(const TQPalette &); + int serialNumber() const; + + // These are defined in TQt3, but don't appear in the documentation. + //static TQColorGroup::ColorRole foregroundRoleFromMode(TQt::BackgroundMode); + //static TQColorGroup::ColorRole backgroundRoleFromMode(TQt::BackgroundMode); +}; diff --git a/sip/tqt/tqpen.sip b/sip/tqt/tqpen.sip new file mode 100644 index 0000000..b80752b --- /dev/null +++ b/sip/tqt/tqpen.sip @@ -0,0 +1,59 @@ +// This is the SIP interface definition for TQPen. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQPen</Title> +<Para> +<Literal>TQPen</Literal> is fully implemented, including the Python +<Literal>==</Literal> and <Literal>!=</Literal> operators. +</Para> +</Sect2> +%End + + +class TQPen : TQt +{ +%TypeHeaderCode +#include <tqpen.h> +%End + +public: + TQPen(); + TQPen(PenStyle); + TQPen(const TQColor &,uint = 0,PenStyle = SolidLine); + TQPen(const TQColor &,uint,PenStyle,PenCapStyle,PenJoinStyle); + TQPen(const TQPen &); + + PenStyle style() const; + void setStyle(PenStyle); + uint width() const; + void setWidth(uint); + const TQColor &color() const; + void setColor(const TQColor &); + PenCapStyle capStyle() const; + void setCapStyle(PenCapStyle); + PenJoinStyle joinStyle() const; + void setJoinStyle(PenJoinStyle); + + bool operator==(const TQPen &) const; + bool operator!=(const TQPen &) const; +}; diff --git a/sip/tqt/tqpicture.sip b/sip/tqt/tqpicture.sip new file mode 100644 index 0000000..9bcd839 --- /dev/null +++ b/sip/tqt/tqpicture.sip @@ -0,0 +1,81 @@ +// This is the SIP interface definition for TQPicture. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQPicture</Title> +<FuncSynopsis> + <FuncDef>const char *<Function>data</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>setData</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>uint <Parameter>size</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>size</Literal> is derived from <Literal>data</Literal> and not passed +as a parameter. +</Para> +</Sect2> +%End + + +%If (TQt_PICTURE) + +class TQPicture : TQPaintDevice +{ +%TypeHeaderCode +#include <tqpicture.h> +%End + +public: + TQPicture(int = -1); + TQPicture(const TQPicture &); + + bool isNull() const; + + uint size() const; +// const char *data() const; + virtual void setData(const char * /Array/,uint /ArraySize/); + + bool play(TQPainter *); + + bool load(TQIODevice *,const char * = 0); + bool load(const TQString &,const char * = 0); + bool save(TQIODevice *,const char * = 0); + bool save(const TQString &,const char * = 0); + + TQRect boundingRect() const; + void setBoundingRect(const TQRect &); + +protected: + void detach(); + TQPicture copy() const; + +private: +}; + +%End diff --git a/sip/tqt/tqpixmap.sip b/sip/tqt/tqpixmap.sip new file mode 100644 index 0000000..0c06601 --- /dev/null +++ b/sip/tqt/tqpixmap.sip @@ -0,0 +1,165 @@ +// This is the SIP interface definition for TQPixmap. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQPixmap</Title> +<FuncSynopsis> + <FuncDef><Function>TQPixmap</Function></FuncDef> + <ParamDef>const char *<Parameter>xpm</Parameter>[]</ParamDef> +</FuncSynopsis> +<Para> +This takes a list of strings as its parameter. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>loadFromData</Function></FuncDef> + <ParamDef>const uchar *<Parameter>buf</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> + <ParamDef>const char *<Parameter>format</Parameter> = 0</ParamDef> + <ParamDef>ColorMode <Parameter>mode</Parameter> = Auto</ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>buf</Literal> and not passed as +a parameter. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>loadFromData</Function></FuncDef> + <ParamDef>const uchar *<Parameter>buf</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> + <ParamDef>const char *<Parameter>format</Parameter></ParamDef> + <ParamDef>int <Parameter>conversion_flags</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +%End + + +class TQPixmap : TQPaintDevice, TQt +{ +%TypeHeaderCode +#include <tqpixmap.h> +%End + +public: + enum ColorMode + { + Auto, + Color, + Mono + }; + + enum Optimization + { + DefaultOptim, + NoOptim, + MemoryOptim, + NormalOptim, + BestOptim + }; + + TQPixmap(); + TQPixmap(const TQImage &); + TQPixmap(int,int,int = -1,Optimization = DefaultOptim); + TQPixmap(const TQSize &,int = -1,Optimization = DefaultOptim); + TQPixmap(const TQString &,const char * = 0,ColorMode = Auto); + TQPixmap(const TQString &,const char *,int); + + TQPixmap(SIP_PYLIST) [(const char **)]; +%MethodCode + // The Python interface is a list of strings that make up the + // image. + + const char **str; + + if ((str = PyTQt_tqt_ListToArray(a0)) == NULL) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipCpp = new sipTQPixmap(str); + Py_END_ALLOW_THREADS + + sipFree((void *)str); + } +%End + + TQPixmap(const TQByteArray &); + TQPixmap(const TQPixmap &); + + bool isNull() const; + int width() const; + int height() const; + TQSize size() const; + TQRect rect() const; + int depth() const; + static int defaultDepth(); + void fill(const TQColor & = TQt::white); + void fill(const TQWidget *,int,int); + void fill(const TQWidget *,const TQPoint &); + void resize(int,int); + void resize(const TQSize &); + const TQBitmap *mask() const; + void setMask(const TQBitmap &); + bool selfMask() const; + bool hasAlpha() const; + bool hasAlphaChannel() const; + TQBitmap createHeuristicMask(bool = 1) const; + static TQPixmap fromMimeSource(const TQString &); + static TQPixmap grabWindow(WId,int = 0,int = 0,int = -1,int = -1); + static TQPixmap grabWidget(TQWidget *,int = 0,int = 0,int = -1,int = -1); + + TQPixmap xForm(const TQWMatrix &) const; + static TQWMatrix trueMatrix(const TQWMatrix &,int,int); + TQImage convertToImage() const; + bool convertFromImage(const TQImage &,ColorMode = Auto); + bool convertFromImage(const TQImage &,int); + static const char *imageFormat(const TQString &); + bool load(const TQString &,const char * = 0,ColorMode = Auto); + bool load(const TQString &,const char *,int); + bool loadFromData(const uchar * /Array/,uint /ArraySize/, + const char * = 0,ColorMode = Auto); +// bool loadFromData(const uchar *,uint,const char *,int); + bool loadFromData(TQByteArray,const char * = 0,int = 0); + bool save(const TQString &,const char *,int = -1) const; + bool save(TQIODevice *,const char *,int = -1) const; + int serialNumber() const; + Optimization optimization() const; + void setOptimization(Optimization); + static Optimization defaultOptimization(); + static void setDefaultOptimization(Optimization); + virtual void detach(); + bool isTQBitmap() const; + +%If (WS_X11) + static int x11SetDefaultScreen(int); + void x11SetScreen(int); +%End + +protected: + TQPixmap(int,int,const uchar *,bool); +}; + +void copyBlt(TQPixmap *,int,int,const TQPixmap *,int = 0,int = 0,int = -1, + int = -1); diff --git a/sip/tqt/tqpixmapcache.sip b/sip/tqt/tqpixmapcache.sip new file mode 100644 index 0000000..c8a6c30 --- /dev/null +++ b/sip/tqt/tqpixmapcache.sip @@ -0,0 +1,47 @@ +// This is the SIP interface definition for TQPixmapCache. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQPixmapCache (TQt v3+)</Title> +<Para> +<Literal>TQPixmapCache</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQPixmapCache +{ +%TypeHeaderCode +#include <tqpixmapcache.h> +%End + +public: + static int cacheLimit(); + static void setCacheLimit(int); + static TQPixmap *find(const TQString &); + static bool find(const TQString &,TQPixmap &); +// static bool insert(const TQString &,TQPixmap *); + static bool insert(const TQString &,const TQPixmap &); + static void remove(const TQString &); + static void clear(); +}; diff --git a/sip/tqt/tqplatinumstyle.sip b/sip/tqt/tqplatinumstyle.sip new file mode 100644 index 0000000..78da451 --- /dev/null +++ b/sip/tqt/tqplatinumstyle.sip @@ -0,0 +1,85 @@ +// This is the SIP interface definition for TQPlatinumStyle. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQPlatinumStyle (TQt v2+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const TQTabBar *<Parameter>sb</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>sb</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +(TQt v2) +</Para> +</Sect2> +%End + + +%If (TQt_STYLE_PLATINUM) + +class TQPlatinumStyle : TQWindowsStyle +{ +%TypeHeaderCode +#include <tqplatinumstyle.h> +%End + +public: + TQPlatinumStyle(); + + void drawPrimitive(PrimitiveElement,TQPainter *,const TQStyleControlElementData&,ControlElementFlags,const TQRect &, + const TQColorGroup &,SFlags = Style_Default, + const TQStyleOption & = TQStyleOption()) const; + + void drawControl(ControlElement,TQPainter *,const TQStyleControlElementData&,ControlElementFlags, + const TQRect &,const TQColorGroup &, + SFlags = Style_Default, + const TQStyleOption & = TQStyleOption(), const TQWidget *=0) const; + + void drawComplexControl(ComplexControl,TQPainter *,const TQStyleControlElementData&,ControlElementFlags, + const TQRect &,const TQColorGroup &, + SFlags = Style_Default,SCFlags = SC_All, + SCFlags = SC_None, + const TQStyleOption & = TQStyleOption(),const TQWidget *=0) const; + + TQRect querySubControlMetrics(ComplexControl,const TQStyleControlElementData&,ControlElementFlags,SubControl, + const TQStyleOption & = TQStyleOption(), const TQWidget *=0) const; + + int pixelMetric(PixelMetric,const TQStyleControlElementData&,ControlElementFlags,const TQWidget * = 0) const; + + TQRect subRect(SubRect,const TQStyleControlElementData&, const ControlElementFlags,const TQWidget *) const; + +protected: + TQColor mixedColor(const TQColor &,const TQColor &) const; + void drawRiffles(TQPainter *,int,int,int,int,const TQColorGroup &, + bool) const; + +private: + TQPlatinumStyle(const TQPlatinumStyle &); +}; + +%End diff --git a/sip/tqt/tqpoint.sip b/sip/tqt/tqpoint.sip new file mode 100644 index 0000000..d82f529 --- /dev/null +++ b/sip/tqt/tqpoint.sip @@ -0,0 +1,98 @@ +// This is the SIP interface definition for TQPoint. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQPoint</Title> +<Para> +The Python +<Literal>+</Literal>, <Literal>+=</Literal>, +<Literal>-</Literal>, <Literal>-=</Literal>, unary <Literal>-</Literal>, +<Literal>*</Literal>, <Literal>*=</Literal>, +<Literal>/</Literal>, <Literal>/=</Literal>, +<Literal>==</Literal>, <Literal>!=</Literal> and <Literal>__nonzero__</Literal> +operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>TQCOORD &<Function>rx</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>TQCOORD &<Function>ry</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +%End + + +class TQPoint +{ +%TypeHeaderCode +#include <tqpoint.h> +%End + +public: + TQPoint(); + TQPoint(int,int); + + bool isNull() const; + int x() const; + int y() const; + void setX(int); + void setY(int); + int manhattanLength() const; +// TQCOORD &rx(); +// TQCOORD &ry(); + + TQPoint &operator+=(const TQPoint &); + TQPoint &operator-=(const TQPoint &); + TQPoint &operator*=(int /Constrained/); + TQPoint &operator*=(double); + TQPoint &operator/=(int /Constrained/); + TQPoint &operator/=(double); + + int __nonzero__(); +%MethodCode + sipRes = !sipCpp -> isNull(); +%End + + const TQPoint __neg__(); +%MethodCode + sipRes = new TQPoint(-(*sipCpp)); +%End +}; + +bool operator==(const TQPoint &,const TQPoint &); +bool operator!=(const TQPoint &,const TQPoint &); +const TQPoint operator+(const TQPoint &,const TQPoint &); +const TQPoint operator-(const TQPoint &,const TQPoint &); +const TQPoint operator*(const TQPoint &,int /Constrained/); +const TQPoint operator*(const TQPoint &,double); +const TQPoint operator/(const TQPoint &,int /Constrained/); +const TQPoint operator/(const TQPoint &,double); diff --git a/sip/tqt/tqpointarray.sip b/sip/tqt/tqpointarray.sip new file mode 100644 index 0000000..e0c83b8 --- /dev/null +++ b/sip/tqt/tqpointarray.sip @@ -0,0 +1,230 @@ +// This is the SIP interface definition for TQPointArray. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQPointArray</Title> +<FuncSynopsis> + <FuncDef><Function>TQPointArray</Function></FuncDef> + <ParamDef>int <Parameter>nPoints</Parameter></ParamDef> + <ParamDef>const TQCOORD *<Parameter>points</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single parameter which is a list of points. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>point</Function></FuncDef> + <ParamDef>uint <Parameter>i</Parameter></ParamDef> + <ParamDef>int *<Parameter>x</Parameter></ParamDef> + <ParamDef>int *<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the single parameter <Literal>i</Literal> and returns the +<Literal>x</Literal> and <Literal>y</Literal> values as a tuple. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>putPoints</Function></FuncDef> + <ParamDef>int <Parameter>index</Parameter></ParamDef> + <ParamDef>int <Parameter>nPoints</Parameter></ParamDef> + <ParamDef>const TQCOORD *<Parameter>points</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes two parameters, <Literal>index</Literal> and a list of points. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>putPoints</Function></FuncDef> + <ParamDef>int <Parameter>index</Parameter></ParamDef> + <ParamDef>int <Parameter>nPoints</Parameter></ParamDef> + <ParamDef>int <Parameter>firstx</Parameter></ParamDef> + <ParamDef>int <Parameter>firsty</Parameter></ParamDef> + <ParamDef>...</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setPoints</Function></FuncDef> + <ParamDef>int <Parameter>nPoints</Parameter></ParamDef> + <ParamDef>const TQCOORD *<Parameter>points</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single parameter which is a list of points. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setPoints</Function></FuncDef> + <ParamDef>int <Parameter>nPoints</Parameter></ParamDef> + <ParamDef>int <Parameter>firstx</Parameter></ParamDef> + <ParamDef>int <Parameter>firsty</Parameter></ParamDef> + <ParamDef>...</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +%End + + +class TQPointArray +{ +%TypeHeaderCode +#include <tqpointarray.h> +%End + +%TypeCode +// Convert a list of numbers to an array on TQCOORDs on the heap. + +static TQCOORD *getPoints(int nrpnts,PyObject *pntlist) +{ + TQCOORD *pnts, *pp; + + if ((pnts = (TQCOORD *)sipMalloc(nrpnts * sizeof (TQCOORD))) == NULL) + return NULL; + + // Convert the list. + + pp = pnts; + + for (int i = 0; i < nrpnts; ++i) + { + *pp++ = (TQCOORD)PyLong_AsLong(PyList_GetItem(pntlist,i)); + + if (PyErr_Occurred() != NULL) + { + sipFree((void *)pnts); + return NULL; + } + } + + return pnts; +} +%End + +public: + TQPointArray(); + TQPointArray(int); + TQPointArray(const TQPointArray &); + TQPointArray(const TQRect &,bool = 0); + + TQPointArray(SIP_PYLIST) [(int,const TQCOORD *)]; +%MethodCode + // The Python interface is a list of TQCOORDs. + + int nrpnts; + TQCOORD *pnts; + + nrpnts = PyList_GET_SIZE(a0); + + if ((pnts = getPoints(nrpnts,a0)) == NULL) + sipIsErr = 1; + else + { + // No wrapper class for TQPointArray. + + Py_BEGIN_ALLOW_THREADS + sipCpp = new TQPointArray(nrpnts / 2,pnts); + Py_END_ALLOW_THREADS + + sipFree((void *)pnts); + } +%End + + TQPointArray copy() const; + void translate(int,int); + TQRect boundingRect() const; + + void point(uint,int *,int *) const; + // This is hidden by the above. It would probably be better to remove + // the one above, but that would break backwards compatibility. + //TQPoint point(uint) const; + void setPoint(uint,int,int); + void setPoint(uint,const TQPoint &); + + bool setPoints(SIP_PYLIST); +%MethodCode + int nrpnts; + TQCOORD *pnts; + + nrpnts = PyList_GET_SIZE(a0); + + if ((pnts = getPoints(nrpnts,a0)) == NULL) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp -> setPoints(nrpnts / 2,pnts); + Py_END_ALLOW_THREADS + + sipFree((void *)pnts); + } +%End + +// bool setPoints(int,int,int,...); + + bool putPoints(int,SIP_PYLIST); +%MethodCode + int nrpnts; + TQCOORD *pnts; + + nrpnts = PyList_GET_SIZE(a1); + + if ((pnts = getPoints(nrpnts,a1)) == NULL) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp -> putPoints(a0,nrpnts / 2,pnts); + Py_END_ALLOW_THREADS + + sipFree((void *)pnts); + } +%End + +// bool putPoints(int,int,int,int,...); + bool putPoints(int,int,const TQPointArray &,int = 0); + + void makeArc(int,int,int,int,int,int); + void makeEllipse(int,int,int,int); +%If (TQt_TRANSFORMATIONS) + void makeArc(int,int,int,int,int,int,const TQWMatrix &); +%End + TQPointArray cubicBezier() const; + + // These are actually in TQArray, which isn't implemented so pretend + // they are here. + + uint nrefs() const; + bool isEmpty() const; + bool isNull() const; + bool resize(uint); + uint size() const; + bool truncate(uint); + bool fill(const TQPoint &,int = -1); + TQPoint &at(uint) const; + void sort(); + int bsearch(const TQPoint &) const; + int find(const TQPoint &,uint = 0) const; + int contains(const TQPoint &) const; +}; diff --git a/sip/tqt/tqpopupmenu.sip b/sip/tqt/tqpopupmenu.sip new file mode 100644 index 0000000..0e08bf5 --- /dev/null +++ b/sip/tqt/tqpopupmenu.sip @@ -0,0 +1,166 @@ +// This is the SIP interface definition for TQPopupMenu. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQPopupMenu</Title> +<FuncSynopsis> + <FuncDef>int <Function>exec</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>exec_loop</Literal> in Python. +</Para> +<Para> +This method also causes ownership of the underlying C++ menu to be transfered +to Python. This means that the C++ menu will be deleted when the Python +wrapper is garbage collected. Although this is a little inconsistent, it +ensures that the menu is deleted without having to explicity code it using +<Literal>TQObject.deleteLater()</Literal> or other techniques. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>exec</Function></FuncDef> + <ParamDef>const TQPoint &<Parameter>pos</Parameter></ParamDef> + <ParamDef>int <Parameter>indexAtPoint</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>exec_loop</Literal> in Python. +</Para> +<Para> +This method also causes ownership of the underlying C++ menu to be transfered +to Python. This means that the C++ menu will be deleted when the Python +wrapper is garbage collected. Although this is a little inconsistent, it +ensures that the menu is deleted without having to explicity code it using +<Literal>TQObject.deleteLater()</Literal> or other techniques. +</Para> +</Sect2> +%End + + +class TQPopupMenu : TQFrame, TQMenuData +{ +%TypeHeaderCode +#include <tqpopupmenu.h> +%End + +public: + TQPopupMenu(TQWidget * /TransferThis/ = 0,const char * = 0); + + void popup(const TQPoint &,int = -1); + void updateItem(int); + + virtual void setCheckable(bool); + bool isCheckable() const; + + void setFont(const TQFont &); + void show(); + void hide(); + + int exec() /PyName=exec_loop, ReleaseGIL, + PreHook=__pyTQtPreEventLoopHook__, + PostHook=__pyTQtPostEventLoopHook__/; +%MethodCode + // Transfer ownership back to Python (a modal menu will + // probably have the main window as it's parent). This means + // the TQt menu will be deleted when the Python wrapper is + // garbage collected. Although this is a little inconsistent, + // it saves having to code it explicitly to avoid the memory + // leak. + sipTransferBack(sipSelf); + + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp->TQPopupMenu::exec(); + Py_END_ALLOW_THREADS +%End + + int exec(const TQPoint &,int = 0) /PyName=exec_loop, ReleaseGIL, + PreHook=__pyTQtPreEventLoopHook__, + PostHook=__pyTQtPostEventLoopHook__/; +%MethodCode + // Transfer ownership back to Python (a modal menu will + // probably have the main window as it's parent). This means + // the TQt menu will be deleted when the Python wrapper is + // garbage collected. Although this is a little inconsistent, + // it saves having to code it explicitly to avoid the memory + // leak. + sipTransferBack(sipSelf); + + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp->TQPopupMenu::exec(*a0,a1); + Py_END_ALLOW_THREADS +%End + + virtual void setActiveItem(int); + TQSize sizeHint() const; + + int idAt(int) const; + int idAt(const TQPoint &) const; + + bool customWhatsThis() const; + + int insertTearOffHandle(int = -1,int = -1); + + void activateItemAt(int); + TQRect itemGeometry(int); + +signals: + void activated(int); + void highlighted(int); + void activatedRedirect(int); + void highlightedRedirect(int); + void aboutToShow(); + void aboutToHide(); + +protected: + int itemHeight(int) const; + int itemHeight(TQMenuItem *) const; + void drawItem(TQPainter *,int,TQMenuItem *,bool,int,int,int,int); + + void drawContents(TQPainter *); + + void closeEvent(TQCloseEvent *); + void paintEvent(TQPaintEvent *); + void mousePressEvent(TQMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); + void mouseMoveEvent(TQMouseEvent *); + void keyPressEvent(TQKeyEvent *); + void focusInEvent(TQFocusEvent *); + void focusOutEvent(TQFocusEvent *); + void timerEvent(TQTimerEvent *); + void leaveEvent(TQEvent *); + void styleChange(TQStyle &); + void enabledChange(bool); + int columns() const; + + bool focusNextPrevChild(bool); + + int itemAtPos(const TQPoint &,bool = 1) const; + +private: + TQPopupMenu(const TQPopupMenu &); + + void menuContentsChanged(); + void menuStateChanged(); + void menuInsPopup(TQPopupMenu *); + void menuDelPopup(TQPopupMenu *); + void frameChanged(); +}; diff --git a/sip/tqt/tqprintdialog.sip b/sip/tqt/tqprintdialog.sip new file mode 100644 index 0000000..ad2e952 --- /dev/null +++ b/sip/tqt/tqprintdialog.sip @@ -0,0 +1,57 @@ +// This is the SIP interface definition for TQPrintDialog. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQPrintDialog (X11)</Title> +<Para> +<Literal>TQPrintDialog</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (WS_X11) +%If (TQt_PRINTDIALOG) + +class TQPrintDialog : TQDialog +{ +%TypeHeaderCode +#include <tqprintdialog.h> +%End + +public: + TQPrintDialog(TQPrinter *,TQWidget * /TransferThis/ = 0,const char * = 0); + + static bool getPrinterSetup(TQPrinter *,TQWidget * = 0); + static void setGlobalPrintDialog(TQPrintDialog *); + + void setPrinter(TQPrinter *,bool = 0); + TQPrinter *printer() const; + + void addButton(TQPushButton *); + +private: + TQPrintDialog(const TQPrintDialog &); +}; + +%End +%End diff --git a/sip/tqt/tqprinter.sip b/sip/tqt/tqprinter.sip new file mode 100644 index 0000000..fbe7709 --- /dev/null +++ b/sip/tqt/tqprinter.sip @@ -0,0 +1,174 @@ +// This is the SIP interface definition for TQPrinter. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQPrinter</Title> +<Para> +<Literal>TQPrinter</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_PRINTER) + +class TQPrinter : TQPaintDevice +{ +%TypeHeaderCode +#include <tqprinter.h> +%End + +public: + enum PrinterMode { + ScreenResolution, + PrinterResolution, + HighResolution, + Compatible + }; + + TQPrinter(PrinterMode = ScreenResolution); + + enum Orientation { + Portrait, + Landscape + }; + + enum PageSize { + A4, B5, Letter, Legal, Executive, A0, A1, A2, A3, A5, A6, A7, + A8, A9, B0, B1, B10, B2, B3, B4, B6, B7, B8, B9, C5E, Comm10E, + DLE, Folio, Ledger, Tabloid, + Custom, + NPageSize + }; + + enum PageOrder { + FirstPageFirst, + LastPageFirst + }; + + enum ColorMode { + GrayScale, + Color + }; + + enum PaperSource { + OnlyOne, + Lower, + Middle, + Manual, + Envelope, + EnvelopeManual, + Auto, + Tractor, + SmallFormat, + LargeFormat, + LargeCapacity, + Cassette, + FormSource + }; + + enum PrintRange { + AllPages, + Selection, + PageRange + }; + + enum PrinterOption { + PrintToFile, + PrintSelection, + PrintPageRange + }; + + TQString printerName() const; + virtual void setPrinterName(const TQString &); + bool outputToFile() const; + virtual void setOutputToFile(bool); + TQString outputFileName() const; + virtual void setOutputFileName(const TQString &); + + TQString printProgram() const; + virtual void setPrintProgram(const TQString &); + + TQString printerSelectionOption() const; + virtual void setPrinterSelectionOption(const TQString &); + + TQString docName() const; + virtual void setDocName(const TQString &); + TQString creator() const; + virtual void setCreator(const TQString &); + + Orientation orientation() const; + virtual void setOrientation(Orientation); + PageSize pageSize() const; + virtual void setPageSize(PageSize); + + virtual void setPageOrder(PageOrder); + PageOrder pageOrder() const; + + void setResolution(int); + int resolution() const; + + virtual void setColorMode(ColorMode); + ColorMode colorMode() const; + + virtual void setFullPage(bool); + bool fullPage() const; + TQSize margins() const; + + void setMargins(uint,uint,uint,uint); +// void margins(uint *,uint *,uint *,uint *) const; + + int fromPage() const; + int toPage() const; + virtual void setFromTo(int,int); + int minPage() const; + int maxPage() const; + virtual void setMinMax(int,int); + int numCopies() const; + virtual void setNumCopies(int); + + bool collateCopiesEnabled() const; + void setCollateCopiesEnabled(bool); + + bool collateCopies() const; + void setCollateCopies(bool); + + PrintRange printRange() const; + void setPrintRange(PrintRange); + + bool newPage(); + bool abort(); + bool aborted() const; + + bool setup(TQWidget * = 0); + + PaperSource paperSource() const; + virtual void setPaperSource(PaperSource); + + void setOptionEnabled(PrinterOption,bool); + bool isOptionEnabled(PrinterOption); + +private: + TQPrinter(const TQPrinter &); +}; + +%End diff --git a/sip/tqt/tqprocess.sip b/sip/tqt/tqprocess.sip new file mode 100644 index 0000000..8581534 --- /dev/null +++ b/sip/tqt/tqprocess.sip @@ -0,0 +1,106 @@ +// This is the SIP interface definition for TQProcess. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQProcess (TQt v3+)</Title> +<Para> +<Literal>TQProcess</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQProcess : TQObject +{ +%TypeHeaderCode +#include <tqprocess.h> +%End + +public: + TQProcess(TQObject * /TransferThis/ = 0,const char * = 0); + TQProcess(const TQString &,TQObject * /TransferThis/ = 0, + const char * = 0); + TQProcess(const TQStringList &,TQObject * /TransferThis/ = 0, + const char * = 0); + + TQStringList arguments() const; + void clearArguments(); + virtual void setArguments(const TQStringList &); + virtual void addArgument(const TQString &); + TQDir workingDirectory() const; + virtual void setWorkingDirectory(const TQDir &); + + enum Communication { + Stdin, + Stdout, + Stderr, + DupStderr + }; + + void setCommunication(int); + int communication() const; + + virtual bool start(TQStringList * = 0); + virtual bool launch(const TQString &, TQStringList * = 0 ); + virtual bool launch(const TQByteArray &,TQStringList * = 0 ); + + bool isRunning() const; + bool normalExit() const; + int exitStatus() const; + + virtual TQByteArray readStdout() /ReleaseGIL/; + virtual TQByteArray readStderr() /ReleaseGIL/; + bool canReadLineStdout() const; + bool canReadLineStderr() const; + virtual TQString readLineStdout() /ReleaseGIL/; + virtual TQString readLineStderr() /ReleaseGIL/; + +%If (WS_X11 || WS_MACX || WS_QWS) + typedef long PID; +%End + + PID processIdentifier(); + + void flushStdin(); + +signals: + void readyReadStdout(); + void readyReadStderr(); + void processExited(); + void wroteToStdin(); + void launchFinished(); + +public slots: + void tryTerminate() const; + void kill() const; + + virtual void writeToStdin(const TQByteArray &); + virtual void writeToStdin(const TQString &); + virtual void closeStdin(); + +protected: + void connectNotify(const char *); + void disconnectNotify(const char *); + +private: + TQProcess(const TQProcess &); +}; diff --git a/sip/tqt/tqprogressbar.sip b/sip/tqt/tqprogressbar.sip new file mode 100644 index 0000000..0bae238 --- /dev/null +++ b/sip/tqt/tqprogressbar.sip @@ -0,0 +1,73 @@ +// This is the SIP interface definition for TQProgressBar. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQProgressBar</Title> +<Para> +<Literal>TQProgressBar</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQProgressBar : TQFrame +{ +%TypeHeaderCode +#include <tqprogressbar.h> +%End + +public: + TQProgressBar(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + TQProgressBar(int,TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + int totalSteps() const; + int progress() const; + const TQString &progressString() const; + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + + void setCenterIndicator(bool); + bool centerIndicator() const; + + void setIndicatorFollowsStyle(bool); + bool indicatorFollowsStyle() const; + + bool percentageVisible() const; + void setPercentageVisible(bool); + + void show(); + +public slots: + void reset(); + virtual void setTotalSteps(int); + virtual void setProgress(int); + void setProgress(int,int); + +protected: + void drawContents(TQPainter *); + virtual bool setIndicator(TQString &,int,int); + void styleChange(TQStyle &); + +private: + TQProgressBar(const TQProgressBar &); +}; diff --git a/sip/tqt/tqprogressdialog.sip b/sip/tqt/tqprogressdialog.sip new file mode 100644 index 0000000..4b21b55 --- /dev/null +++ b/sip/tqt/tqprogressdialog.sip @@ -0,0 +1,97 @@ +// This is the SIP interface definition for TQProgressDialog. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQProgressDialog</Title> +<Para> +<Literal>TQProgressDialog</Literal> is fully implemented. +value. +</Para> +</Sect2> +%End + + +%If (TQt_PROGRESSDIALOG) + +class TQProgressDialog : TQDialog +{ +%TypeHeaderCode +#include <tqprogressdialog.h> +%End + +public: + TQProgressDialog(TQWidget * /TransferThis/ = 0,const char * = 0,bool = 0, + WFlags = 0); + TQProgressDialog(const TQString &,const TQString &,int, + TQWidget * /TransferThis/ = 0,const char * = 0,bool = 0, + WFlags = 0); + + void setLabel(TQLabel *); + void setCancelButton(TQPushButton *); + void setBar(TQProgressBar *); + + bool wasCancelled() const; + bool wasCanceled() const; + + int totalSteps() const; + int progress() const; + + TQSize sizeHint() const; + + int minimumDuration() const; + + TQString labelText() const; + + void setAutoReset(bool); + bool autoReset() const; + void setAutoClose(bool); + bool autoClose() const; + +public slots: + void cancel(); + void reset(); + void setTotalSteps(int); + void setProgress(int); + void setProgress(int,int); + void setLabelText(const TQString &); + void setCancelButtonText(const TQString &); + + void setMinimumDuration(int); + +signals: + void cancelled(); + void canceled(); + +protected: + void resizeEvent(TQResizeEvent *); + void closeEvent(TQCloseEvent *); + void styleChange(TQStyle &); + void showEvent(TQShowEvent *); + +protected slots: + void forceShow(); + +private: + TQProgressDialog(const TQProgressDialog &); +}; + +%End diff --git a/sip/tqt/tqptrlist.sip b/sip/tqt/tqptrlist.sip new file mode 100644 index 0000000..5250eb8 --- /dev/null +++ b/sip/tqt/tqptrlist.sip @@ -0,0 +1,107 @@ +// This is the SIP interface definition for all types based on the TQPtrList +// template. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQPtrList<type> (TQt v2+)</Title> +<Para> +Types based on the <Literal>TQPtrList</Literal> template are automatically +converted to and from Python lists of the type. +</Para> +</Sect2> +%End + + +template<Type> +%MappedType TQPtrList<Type> +{ +%TypeHeaderCode +#include <tqptrlist.h> +%End + +%ConvertFromTypeCode + Type *dw; + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + + for (dw = sipCpp -> first(); dw != NULL; dw = sipCpp -> next()) + { + PyObject *dwobj; + + if ((dwobj = sipConvertFromInstance(dw,sipClass_Type,sipTransferObj)) == NULL || PyList_SetItem(l,i,dwobj) < 0) + { + Py_XDECREF(dwobj); + Py_DECREF(l); + + return NULL; + } + + ++i; + } + + return l; +%End + +%ConvertToTypeCode + if (sipIsErr == NULL) + { + if (!PyList_Check(sipPy)) + return 0; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_Type,0)) + return 0; + + return 1; + } + + TQPtrList<Type> *qpl = new TQPtrList<Type>; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + // We apply the transfer to the list itself, not the elements. + // Note that any temporary element will never be destroyed. + // There is nothing that can be done about this. + qpl -> append(reinterpret_cast<Type *>(sipConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_Type,0,0,0,sipIsErr))); + + if (*sipIsErr) + { + delete qpl; + + return 0; + } + } + + *sipCppPtr = qpl; + + return sipGetState(sipTransferObj); +%End +}; diff --git a/sip/tqt/tqpushbutton.sip b/sip/tqt/tqpushbutton.sip new file mode 100644 index 0000000..77c4d7a --- /dev/null +++ b/sip/tqt/tqpushbutton.sip @@ -0,0 +1,83 @@ +// This is the SIP interface definition for TQPushButton. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +%DefaultEncoding "UTF-8" + +%ExportedDoc +<Sect2><Title>TQPushButton</Title> +<Para> +<Literal>TQPushButton</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQPushButton : TQButton +{ +%TypeHeaderCode +#include <tqpushbutton.h> +%End + +public: + TQPushButton(TQWidget * /TransferThis/,const char * = 0); + TQPushButton(const TQString &,TQWidget * /TransferThis/,const char * = 0); + TQPushButton(const TQIconSet &,const TQString &,TQWidget * /TransferThis/,const char * = 0); + + TQSize sizeHint() const; + + void move(int,int); + void move(const TQPoint &); + void resize(int,int); + void resize(const TQSize &); + void setGeometry(int,int,int,int); + + void setGeometry(const TQRect &); + + void setToggleButton(bool); + + bool autoDefault() const; + virtual void setAutoDefault(bool); + bool isDefault() const; + virtual void setDefault(bool); + + void setPopup(TQPopupMenu *); + TQPopupMenu *popup() const; + + void setIconSet(const TQIconSet &); + TQIconSet *iconSet() const; + + void setFlat(bool); + bool isFlat() const; + +public slots: + virtual void setOn(bool); + +protected: + void drawButton(TQPainter *); + void drawButtonLabel(TQPainter *); + void focusInEvent(TQFocusEvent *); + void focusOutEvent(TQFocusEvent *); + void resizeEvent(TQResizeEvent *); + void updateMask(); + +private: + TQPushButton(const TQPushButton &); +}; diff --git a/sip/tqt/tqradiobutton.sip b/sip/tqt/tqradiobutton.sip new file mode 100644 index 0000000..ea5c5d3 --- /dev/null +++ b/sip/tqt/tqradiobutton.sip @@ -0,0 +1,59 @@ +// This is the SIP interface definition for TQRadioButton. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQRadioButton</Title> +<Para> +<Literal>TQRadioButton</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQRadioButton : TQButton +{ +%TypeHeaderCode +#include <tqradiobutton.h> +%End + +public: + TQRadioButton(TQWidget * /TransferThis/,const char * = 0); + TQRadioButton(const TQString &,TQWidget * /TransferThis/,const char * = 0); + + bool isChecked() const; + + TQSize sizeHint() const; + +public slots: + virtual void setChecked(bool); + +protected: + bool hitButton(const TQPoint &) const; + void drawButton(TQPainter *); + void drawButtonLabel(TQPainter *); + void updateMask(); + + void resizeEvent(TQResizeEvent *); + +private: + TQRadioButton(const TQRadioButton &); +}; diff --git a/sip/tqt/tqrangecontrol.sip b/sip/tqt/tqrangecontrol.sip new file mode 100644 index 0000000..f6e760d --- /dev/null +++ b/sip/tqt/tqrangecontrol.sip @@ -0,0 +1,73 @@ +// This is the SIP interface definition for TQRangeControl. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQRangeControl</Title> +<Para> +<Literal>TQRangeControl</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQRangeControl +{ +%TypeHeaderCode +#include <tqrangecontrol.h> +%End + +public: + TQRangeControl(); + TQRangeControl(int,int,int,int,int); + + int value() const; + void setValue(int); + void addPage(); + void subtractPage(); + void addLine(); + void subtractLine(); + + int minValue() const; + int maxValue() const; + void setRange(int,int); + void setMinValue(int); + void setMaxValue(int); + + int lineStep() const; + int pageStep() const; + void setSteps(int,int); + + int bound(int) const; + +protected: + int positionFromValue(int,int) const; + int valueFromPosition(int,int) const; + void directSetValue(int); + int prevValue() const; + + virtual void valueChange(); + virtual void rangeChange(); + virtual void stepChange(); + +private: + TQRangeControl(const TQRangeControl &); +}; diff --git a/sip/tqt/tqrect.sip b/sip/tqt/tqrect.sip new file mode 100644 index 0000000..f045752 --- /dev/null +++ b/sip/tqt/tqrect.sip @@ -0,0 +1,194 @@ +// This is the SIP interface definition for TQRect. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQRect</Title> +<Para> +The Python +<Literal>&</Literal>, <Literal>&=</Literal>, +<Literal>|</Literal>, <Literal>|=</Literal>, +<Literal>==</Literal>, <Literal>!=</Literal>, <Literal>in</Literal> and +<Literal>__nonzero__</Literal> operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>coords</Function></FuncDef> + <ParamDef>int *<Parameter>x1</Parameter></ParamDef> + <ParamDef>int *<Parameter>y1</Parameter></ParamDef> + <ParamDef>int *<Parameter>x2</Parameter></ParamDef> + <ParamDef>int *<Parameter>y2</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple containing the four values. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>rect</Function></FuncDef> + <ParamDef>int *<Parameter>x</Parameter></ParamDef> + <ParamDef>int *<Parameter>y</Parameter></ParamDef> + <ParamDef>int *<Parameter>w</Parameter></ParamDef> + <ParamDef>int *<Parameter>h</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple containing the four values. +</Para> + +<FuncSynopsis> + <FuncDef>TQCOORD &<Function>rBottom</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. (TQt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>TQCOORD &<Function>rLeft</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. (TQt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>TQCOORD &<Function>rRight</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. (TQt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>TQCOORD &<Function>rTop</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. (TQt v2+) +</Para> +</Sect2> +%End + + +class TQRect +{ +%TypeHeaderCode +#include <tqrect.h> +%End + +public: + TQRect(); + TQRect(const TQPoint &,const TQPoint &); + TQRect(const TQPoint &,const TQSize &); + TQRect(int,int,int,int); + + bool isNull() const; + bool isEmpty() const; + bool isValid() const; + TQRect normalize() const; + + int left() const; + int top() const; + int right() const; + int bottom() const; + +// TQCOORD &rLeft(); +// TQCOORD &rTop(); +// TQCOORD &rRight(); +// TQCOORD &rBottom(); + + int x() const; + int y() const; + void setLeft(int); + void setTop(int); + void setRight(int); + void setBottom(int); + void setX(int); + void setY(int); + + void setTopLeft(const TQPoint &); + void setBottomRight(const TQPoint &); + void setTopRight(const TQPoint &); + void setBottomLeft(const TQPoint &); + + TQPoint topLeft() const; + TQPoint bottomRight() const; + TQPoint topRight() const; + TQPoint bottomLeft() const; + TQPoint center() const; + + void rect(int *,int *,int *,int *) const; + void coords(int *,int *,int *,int *) const; + + void moveLeft(int); + void moveTop(int); + void moveRight(int); + void moveBottom(int); + void moveTopLeft(const TQPoint &); + void moveBottomLeft(const TQPoint &); + void moveTopRight(const TQPoint &); + void moveBottomRight(const TQPoint &); + void moveCenter(const TQPoint &); + void moveBy(int,int); + + void setRect(int,int,int,int); + void setCoords(int,int,int,int); + void addCoords(int,int,int,int); + + TQSize size() const; + int width() const; + int height() const; + void setWidth(int); + void setHeight(int); + void setSize(const TQSize &); + + TQRect operator|(const TQRect &) const; + TQRect operator&(const TQRect &) const; + TQRect &operator|=(const TQRect &); + TQRect &operator&=(const TQRect &); + + int __nonzero__() const; +%MethodCode + sipRes = sipCpp -> isValid(); +%End + + bool contains(const TQPoint &,bool = 0) const; + + int __contains__(const TQPoint &) const; +%MethodCode + sipRes = sipCpp -> contains(*a0); +%End + + bool contains(int,int) const; + bool contains(int,int,bool) const; + bool contains(const TQRect &,bool = 0) const; + + int __contains__(const TQRect &) const; +%MethodCode + sipRes = sipCpp -> contains(*a0); +%End + + TQRect unite(const TQRect &) const; + TQRect intersect(const TQRect &) const; + bool intersects(const TQRect &) const; +}; + +bool operator==(const TQRect &,const TQRect &); +bool operator!=(const TQRect &,const TQRect &); diff --git a/sip/tqt/tqregexp.sip b/sip/tqt/tqregexp.sip new file mode 100644 index 0000000..02feb48 --- /dev/null +++ b/sip/tqt/tqregexp.sip @@ -0,0 +1,102 @@ +// This is the SIP interface definition for TQRegExp. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQRegExp</Title> +<Para> +The Python <Literal>==</Literal> and <Literal>!=</Literal> operators are +supported. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>match</Function></FuncDef> + <ParamDef>const char *<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>index</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>len</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes <Literal>str</Literal> and <Literal>index</Literal> parameters and +returns a tuple of the <Literal>int</Literal> result and the +<Literal>len</Literal> value. (TQt v1.x) +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>match</Function></FuncDef> + <ParamDef>const TQString &<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>index</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>len</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes <Literal>str</Literal> and <Literal>index</Literal> parameters and +returns a tuple of the <Literal>int</Literal> result and the +<Literal>len</Literal> value. (TQt v2+) +</Para> +</Sect2> +%End + + +class TQRegExp +{ +%TypeHeaderCode +#include <tqregexp.h> +%End + +public: + enum CaretMode { + CaretAtZero, + CaretAtOffset, + CaretWontMatch + }; + + TQRegExp(); + TQRegExp(const TQString &,bool = 1,bool = 0); + TQRegExp(const TQRegExp &); + + bool operator==(const TQRegExp &) const; + bool operator!=(const TQRegExp &) const; + + bool isEmpty() const; + bool isValid() const; + TQString pattern() const; + void setPattern(const TQString &); + bool caseSensitive() const; + void setCaseSensitive(bool); + bool wildcard() const; + void setWildcard(bool); + bool minimal() const; + void setMinimal(bool); + + bool exactMatch(const TQString &) const; + + int search(const TQString &,int = 0) const; + int search(const TQString &,int,CaretMode) const; + int searchRev(const TQString &,int = -1) const; + int searchRev(const TQString &,int,CaretMode) const; + int matchedLength() const; + int numCaptures() const; + TQStringList capturedTexts(); + TQString cap(int = 0); + int pos(int = 0); + TQString errorString(); + + static TQString escape(const TQString &); +}; diff --git a/sip/tqt/tqregion.sip b/sip/tqt/tqregion.sip new file mode 100644 index 0000000..9ac4b3f --- /dev/null +++ b/sip/tqt/tqregion.sip @@ -0,0 +1,122 @@ +// This is the SIP interface definition for TQRegion. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQRegion</Title> +<Para> +The Python +<Literal>|</Literal>, <Literal>|=</Literal>, +<Literal>+</Literal>, <Literal>+=</Literal>, +<Literal>&</Literal>, <Literal>&=</Literal>, +<Literal>-</Literal>, <Literal>-=</Literal>, +<Literal>^</Literal>, <Literal>^=</Literal>, +<Literal>==</Literal>, <Literal>!=</Literal>, <Literal>in</Literal> and +<Literal>__nonzero__</Literal> operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>TQArray<TQRect> <Function>rects</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>setRects</Function></FuncDef> + <ParamDef>TQRect *<Parameter>rects</Parameter></ParamDef> + <ParamDef>int <Parameter>num</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (TQt v2.2+) +</Para> +</Sect2> +%End + + +class TQRegion +{ +%TypeHeaderCode +#include <tqregion.h> +%End + +public: + enum RegionType + { + Rectangle, + Ellipse + }; + + TQRegion(); + TQRegion(int,int,int,int,RegionType = Rectangle); + TQRegion(const TQRect &,RegionType = Rectangle); + TQRegion(const TQPointArray &,bool = 0); + TQRegion(const TQRegion &); + TQRegion(const TQBitmap &); + + bool isNull() const; + bool isEmpty() const; + + bool contains(const TQPoint &) const; + + int __contains__(const TQPoint &) const; +%MethodCode + sipRes = sipCpp -> contains(*a0); +%End + + bool contains(const TQRect &) const; + + int __contains__(const TQRect &) const; +%MethodCode + sipRes = sipCpp -> contains(*a0); +%End + + void translate(int,int); + + TQRegion unite(const TQRegion &) const; + TQRegion intersect(const TQRegion &) const; + TQRegion subtract(const TQRegion &) const; + TQRegion eor(const TQRegion &) const; + + TQRect boundingRect() const; + TQMemArray<TQRect> rects() const; +// void setRects(const TQRect *,int); + + const TQRegion operator|(const TQRegion &) const; + const TQRegion operator+(const TQRegion &) const; + const TQRegion operator&(const TQRegion &) const; + const TQRegion operator-(const TQRegion &) const; + const TQRegion operator^(const TQRegion &) const; + TQRegion &operator|=(const TQRegion &); + TQRegion &operator+=(const TQRegion &); + TQRegion &operator&=(const TQRegion &); + TQRegion &operator-=(const TQRegion &); + TQRegion &operator^=(const TQRegion &); + + int __nonzero__() const; +%MethodCode + sipRes = !sipCpp -> isNull(); +%End + + bool operator==(const TQRegion &) const; + bool operator!=(const TQRegion &) const; +}; diff --git a/sip/tqt/tqscrollbar.sip b/sip/tqt/tqscrollbar.sip new file mode 100644 index 0000000..dc6a096 --- /dev/null +++ b/sip/tqt/tqscrollbar.sip @@ -0,0 +1,102 @@ +// This is the SIP interface definition for TQScrollBar. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQScrollBar</Title> +<Para> +<Literal>TQScrollBar</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQScrollBar : TQWidget, TQRangeControl +{ +%TypeHeaderCode +#include <tqscrollbar.h> +%End + +public: + TQScrollBar(TQWidget * /TransferThis/,const char * = 0); + TQScrollBar(Orientation,TQWidget * /TransferThis/,const char * = 0); + TQScrollBar(int,int,int,int,int,Orientation,TQWidget * /TransferThis/, + const char * = 0); + + virtual void setOrientation(Orientation); + Orientation orientation() const; + virtual void setTracking(bool); + bool tracking() const; + bool draggingSlider() const; + + virtual void setPalette(const TQPalette &); + virtual TQSize sizeHint() const; + virtual void setSizePolicy(TQSizePolicy); + void setSizePolicy(TQSizePolicy::SizeType,TQSizePolicy::SizeType, + bool = 0); + + int minValue() const; + int maxValue() const; + void setMinValue(int); + void setMaxValue(int); + int lineStep() const; + int pageStep() const; + void setLineStep(int); + void setPageStep(int); + int value() const; + + int sliderStart() const; + TQRect sliderRect() const; + +public slots: + void setValue(int); + +signals: + void valueChanged(int); + void sliderPressed(); + void sliderMoved(int); + void sliderReleased(); + void nextLine(); + void prevLine(); + void nextPage(); + void prevPage(); + +protected: + void wheelEvent(TQWheelEvent *); + void keyPressEvent(TQKeyEvent *); + void resizeEvent(TQResizeEvent *); + void paintEvent(TQPaintEvent *); + + void mousePressEvent(TQMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); + void mouseMoveEvent(TQMouseEvent *); + void contextMenuEvent(TQContextMenuEvent *); + void hideEvent(TQHideEvent *); + + void valueChange(); + void stepChange(); + void rangeChange(); + + void styleChange(TQStyle &); + +private: + TQScrollBar(const TQScrollBar &); +}; diff --git a/sip/tqt/tqscrollview.sip b/sip/tqt/tqscrollview.sip new file mode 100644 index 0000000..91a4a16 --- /dev/null +++ b/sip/tqt/tqscrollview.sip @@ -0,0 +1,230 @@ +// This is the SIP interface definition for TQScrollView. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQScrollView</Title> +<FuncSynopsis> + <FuncDef>void <Function>contentsToViewport</Function></FuncDef> + <ParamDef>int <Parameter>x</Parameter></ParamDef> + <ParamDef>int <Parameter>y</Parameter></ParamDef> + <ParamDef>int &<Parameter>vx</Parameter></ParamDef> + <ParamDef>int &<Parameter>vy</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>x</Literal> and <Literal>y</Literal> parameters and +returns a tuple containing the <Literal>vx</Literal> and <Literal>vy</Literal> +values. (TQt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>viewportToContents</Function></FuncDef> + <ParamDef>int <Parameter>vx</Parameter></ParamDef> + <ParamDef>int <Parameter>vy</Parameter></ParamDef> + <ParamDef>int &<Parameter>x</Parameter></ParamDef> + <ParamDef>int &<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>vx</Literal> and <Literal>vy</Literal> parameters and +returns a tuple containing the <Literal>x</Literal> and <Literal>y</Literal> +values. (TQt v2+) +</Para> +</Sect2> +%End + + +class TQScrollView : TQFrame +{ +%TypeHeaderCode +#include <tqscrollview.h> +%End + +public: + TQScrollView(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + enum ResizePolicy { + Default, + Manual, + AutoOne, + AutoOneFit, + }; + + virtual void setResizePolicy(ResizePolicy); + ResizePolicy resizePolicy() const; + + void styleChange(TQStyle &); + // The child was reparented when it was added, and it stays that way, + // so we don't transfer it back here. + void removeChild(TQWidget *); + virtual void addChild(TQWidget * /Transfer/,int = 0,int = 0); + virtual void moveChild(TQWidget *,int,int); + int childX(TQWidget *); + int childY(TQWidget *); + + enum ScrollBarMode { + Auto, + AlwaysOff, + AlwaysOn + }; + + ScrollBarMode vScrollBarMode() const; + virtual void setVScrollBarMode(ScrollBarMode); + + ScrollBarMode hScrollBarMode() const; + virtual void setHScrollBarMode(ScrollBarMode); + + TQWidget *cornerWidget() const; + virtual void setCornerWidget(TQWidget * /Transfer/); + + TQScrollBar *horizontalScrollBar() const; + TQScrollBar *verticalScrollBar() const; + TQWidget *viewport() const; + TQWidget *clipper() const; + + int visibleWidth() const; + int visibleHeight() const; + + int contentsWidth() const; + int contentsHeight() const; + int contentsX() const; + int contentsY() const; + + void resize(int,int); + void resize(const TQSize &); + void show(); + + void updateContents(int,int,int,int); + void updateContents(const TQRect &); + void updateContents(); + void repaintContents(int,int,int,int,bool = 1); + void repaintContents(const TQRect &,bool = 1); + void repaintContents(bool = 1); + + // Note that this wasn't actually const until TQt v3.0.0. + void contentsToViewport(int,int,int &,int &) const; + + // Note that this wasn't actually const until TQt v3.0.0. + void viewportToContents(int,int,int &,int &) const; + + TQPoint contentsToViewport(const TQPoint &) const; + TQPoint viewportToContents(const TQPoint &) const; + void enableClipper(bool); + + void setStaticBackground(bool); + bool hasStaticBackground() const; + + TQSize viewportSize(int,int) const; + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + + void removeChild(TQObject * /TransferBack/); + + bool isHorizontalSliderPressed(); + bool isVerticalSliderPressed(); + +%If (TQt_DRAGANDDROP) + virtual void setDragAutoScroll(bool); + bool dragAutoScroll() const; +%End + +signals: + void contentsMoving(int,int); + void horizontalSliderPressed(); + void horizontalSliderReleased(); + void verticalSliderPressed(); + void verticalSliderReleased(); + +public slots: + virtual void resizeContents(int,int); + void scrollBy(int,int); + virtual void setContentsPos(int,int); + void ensureVisible(int,int); + void ensureVisible(int,int,int,int); + void center(int,int); + void center(int,int,float,float); + + void updateScrollBars(); + void setEnabled(bool); + +protected: + virtual void drawContents(TQPainter *,int,int,int,int); + virtual void drawContentsOffset(TQPainter *,int,int,int,int,int,int); + + virtual void contentsMousePressEvent(TQMouseEvent *); + virtual void contentsMouseReleaseEvent(TQMouseEvent *); + virtual void contentsMouseDoubleClickEvent(TQMouseEvent *); + virtual void contentsMouseMoveEvent(TQMouseEvent *); +%If (TQt_DRAGANDDROP) + virtual void contentsDragEnterEvent(TQDragEnterEvent *); + virtual void contentsDragMoveEvent(TQDragMoveEvent *); + virtual void contentsDragLeaveEvent(TQDragLeaveEvent *); + virtual void contentsDropEvent(TQDropEvent *); +%End + virtual void contentsWheelEvent(TQWheelEvent *); + virtual void contentsContextMenuEvent(TQContextMenuEvent *); + + virtual void viewportPaintEvent(TQPaintEvent *); + virtual void viewportResizeEvent(TQResizeEvent *); + virtual void viewportMousePressEvent(TQMouseEvent *); + virtual void viewportMouseReleaseEvent(TQMouseEvent *); + virtual void viewportMouseDoubleClickEvent(TQMouseEvent *); + virtual void viewportMouseMoveEvent(TQMouseEvent *); +%If (TQt_DRAGANDDROP) + virtual void viewportDragEnterEvent(TQDragEnterEvent *); + virtual void viewportDragMoveEvent(TQDragMoveEvent *); + virtual void viewportDragLeaveEvent(TQDragLeaveEvent *); + virtual void viewportDropEvent(TQDropEvent *); +%End + virtual void viewportWheelEvent(TQWheelEvent *); + virtual void viewportContextMenuEvent(TQContextMenuEvent *); + + void frameChanged(); + + virtual void setMargins(int,int,int,int); + int leftMargin() const; + int topMargin() const; + int rightMargin() const; + int bottomMargin() const; + + bool focusNextPrevChild(bool); + + virtual void setHBarGeometry(TQScrollBar &,int,int,int,int); + virtual void setVBarGeometry(TQScrollBar &,int,int,int,int); + + void resizeEvent(TQResizeEvent *); + void mousePressEvent(TQMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); + void mouseDoubleClickEvent(TQMouseEvent *); + void mouseMoveEvent(TQMouseEvent *); + void wheelEvent(TQWheelEvent *); + void contextMenuEvent(TQContextMenuEvent *); + bool eventFilter(TQObject *,TQEvent *); + + void setCachedSizeHint(const TQSize &) const; + TQSize cachedSizeHint() const; + void fontChange(const TQFont &); + +private: + TQScrollView(const TQScrollView &); + +public: + void disableSizeHintCaching(); +}; diff --git a/sip/tqt/tqsemaphore.sip b/sip/tqt/tqsemaphore.sip new file mode 100644 index 0000000..d164046 --- /dev/null +++ b/sip/tqt/tqsemaphore.sip @@ -0,0 +1,84 @@ +// This is the SIP interface definition for TQSemaphore. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQSemaphore (TQt v2.2+)</Title> +<Para> +<Literal>TQSemaphore</Literal> is fully implemented. The <Literal>+=</Literal> +and <Literal>-=</Literal> operators have also been implemented, but require +Python v2.0 or later. +</Para> +</Sect2> +%End + + +%If (TQt_THREAD_SUPPORT) + +class TQSemaphore +{ +%TypeHeaderCode +#include <tqsemaphore.h> +%End + +public: + TQSemaphore(int); + + int available() const; + int total() const; + + TQSemaphore &operator+=(int); +%MethodCode + // Some versions of TQt v3 under Windows have a bug where the += + // operator doesn't work properly (but ++ does). This way we + // make sure that the most common value of n (ie. 1) works + // properly with the buggy version. + + Py_BEGIN_ALLOW_THREADS + if (a0 == 1) + (*sipCpp)++; + else + (*sipCpp) += a0; + Py_END_ALLOW_THREADS +%End + + TQSemaphore &operator-=(int); +%MethodCode + // Some versions of TQt v3 under Windows have a bug where the -= + // operator doesn't work properly (but -- does). This way we + // make sure that the most common value of n (ie. 1) works + // properly with the buggy version. + + Py_BEGIN_ALLOW_THREADS + if (a0 == 1) + (*sipCpp)--; + else + (*sipCpp) -= a0; + Py_END_ALLOW_THREADS +%End + + bool tryAccess(int); + +private: + TQSemaphore(const TQSemaphore &); +}; + +%End diff --git a/sip/tqt/tqsessionmanager.sip b/sip/tqt/tqsessionmanager.sip new file mode 100644 index 0000000..e282963 --- /dev/null +++ b/sip/tqt/tqsessionmanager.sip @@ -0,0 +1,72 @@ +// This is the SIP interface definition for TQSessionManager. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQSessionManager (TQt v2+)</Title> +<Para> +<Literal>TQSessionManager</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQSessionManager : TQObject +{ +%TypeHeaderCode +#include <tqsessionmanager.h> +%End + +public: + TQString sessionId() const; + TQString sessionKey() const; + + bool allowsInteraction(); + bool allowsErrorInteraction(); + void release(); + + void cancel(); + + enum RestartHint { + RestartIfRunning, + RestartAnyway, + RestartImmediately, + RestartNever + }; + + void setRestartHint(RestartHint); + RestartHint restartHint() const; + + void setRestartCommand(const TQStringList &); + TQStringList restartCommand() const; + void setDiscardCommand(const TQStringList &); + TQStringList discardCommand() const; + + void setManagerProperty(const TQString &,const TQString &); + void setManagerProperty(const TQString &,const TQStringList &); + + bool isPhase2() const; + void requestPhase2(); + +private: + TQSessionManager(TQApplication * /TransferThis/,TQString &,TQString &); + ~TQSessionManager(); +}; diff --git a/sip/tqt/tqsettings.sip b/sip/tqt/tqsettings.sip new file mode 100644 index 0000000..3831bfd --- /dev/null +++ b/sip/tqt/tqsettings.sip @@ -0,0 +1,163 @@ +// This is the SIP interface definition for TQSettings. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQSettings (TQt v3+)</Title> +<FuncSynopsis> + <FuncDef>bool <Function>readBoolEntry</Function></FuncDef> + <ParamDef>const TQString &<Parameter>key</Parameter></ParamDef> + <ParamDef>bool <Parameter>def</Parameter> = 0</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>bool</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> +<FuncDef>double <Function>readDoubleEntry</Function></FuncDef> + <ParamDef>const TQString &<Parameter>key</Parameter></ParamDef> + <ParamDef>double <Parameter>def</Parameter> = 0</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>double</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> +<FuncDef>TQString <Function>readEntry</Function></FuncDef> + <ParamDef>const TQString &<Parameter>key</Parameter></ParamDef> + <ParamDef>const TQString &<Parameter>def</Parameter> = TQString::null</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>TQString</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> +<FuncDef>TQStringList <Function>readListEntry</Function></FuncDef> + <ParamDef>const TQString &<Parameter>key</Parameter></ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>TQStringList</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> +<FuncDef>TQStringList <Function>readListEntry</Function></FuncDef> + <ParamDef>const TQString &<Parameter>key</Parameter></ParamDef> + <ParamDef>const TQChar &<Parameter>separator</Parameter></ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>TQStringList</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> +<FuncDef>int <Function>readNumEntry</Function></FuncDef> + <ParamDef>const TQString &<Parameter>key</Parameter></ParamDef> + <ParamDef>int <Parameter>def</Parameter> = 0</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>int</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>writeEntry</Function></FuncDef> + <ParamDef>const TQString &<Parameter>key</Parameter></ParamDef> + <ParamDef>bool <Parameter>value</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +%End + + +class TQSettings +{ +%TypeHeaderCode +#include <tqsettings.h> +%End + +public: + enum Format { + Native, + Ini + }; + + enum System { + Unix, + Windows, + Mac + }; + + enum Scope { + User, + Global + }; + + TQSettings(); + TQSettings(Format); + +// bool writeEntry(const TQString &,bool); + bool writeEntry(const TQString &,int /Constrained/); + bool writeEntry(const TQString &,double); +// bool writeEntry(const TQString &,const char *); + bool writeEntry(const TQString &,const TQString &); + bool writeEntry(const TQString &,const TQStringList &); + bool writeEntry(const TQString &,const TQStringList &,const TQChar &); + + TQStringList entryList(const TQString &) const; + TQStringList subkeyList(const TQString &) const; + + TQStringList readListEntry(const TQString &,bool * = 0); + TQStringList readListEntry(const TQString &,const TQChar &,bool * = 0); + TQString readEntry(const TQString &,const TQString & = TQString::null, + bool * = 0); + int readNumEntry(const TQString &,int = 0,bool * = 0); + double readDoubleEntry(const TQString &,double = 0,bool * = 0); + bool readBoolEntry(const TQString &,bool = 0,bool * = 0); + + bool removeEntry(const TQString &); + + void insertSearchPath(System,const TQString &); + void removeSearchPath(System,const TQString &); + + void setPath(const TQString &,const TQString &,Scope = Global); + + void beginGroup(const TQString &); + void endGroup(); + void resetGroup(); + TQString group() const; + + bool sync(); + +private: + TQSettings(const TQSettings &); +}; diff --git a/sip/tqt/tqsgistyle.sip b/sip/tqt/tqsgistyle.sip new file mode 100644 index 0000000..0dbba8f --- /dev/null +++ b/sip/tqt/tqsgistyle.sip @@ -0,0 +1,92 @@ +// This is the SIP interface definition for TQSGIStyle. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQSGIStyle (TQt v2.2+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const TQScrollBar *<Parameter>sb</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>sb</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +(TQt v2) +</Para> +</Sect2> +%End + + +%If (TQt_STYLE_SGI) + +class TQSGIStyle : TQMotifStyle +{ +%TypeHeaderCode +#include <tqsgistyle.h> +%End + +public: + TQSGIStyle(bool = 0); + + void polish( const TQStyleControlElementData&, ControlElementFlags, void * ); + void unPolish( const TQStyleControlElementData&, ControlElementFlags, void * ); + void applicationPolish( const TQStyleControlElementData&, ControlElementFlags, void * ); + void applicationUnPolish( const TQStyleControlElementData&, ControlElementFlags, void * ); + + void drawPrimitive(PrimitiveElement,TQPainter *,const TQStyleControlElementData&,ControlElementFlags,const TQRect &, + const TQColorGroup &,SFlags = Style_Default, + const TQStyleOption & = TQStyleOption()) const; + + void drawControl(ControlElement,TQPainter *,const TQStyleControlElementData&,ControlElementFlags, + const TQRect &,const TQColorGroup &, + SFlags = Style_Default, + const TQStyleOption & = TQStyleOption(), const TQWidget *=0) const; + + void drawComplexControl(ComplexControl,TQPainter *,const TQStyleControlElementData&,ControlElementFlags, + const TQRect &,const TQColorGroup &, + SFlags = Style_Default,SCFlags = SC_All, + SCFlags = SC_None, + const TQStyleOption & = TQStyleOption(),const TQWidget *=0) const; + + int pixelMetric(PixelMetric,const TQStyleControlElementData&,ControlElementFlags,const TQWidget * = 0) const; + + TQSize sizeFromContents(ContentsType,const TQStyleControlElementData&,ControlElementFlags,const TQSize &, + const TQStyleOption & = TQStyleOption(),const TQWidget *=0) const; + + TQRect subRect(SubRect,const TQStyleControlElementData&, const ControlElementFlags,const TQWidget *) const; + + TQRect querySubControlMetrics(ComplexControl,const TQStyleControlElementData&,ControlElementFlags, + SubControl, + const TQStyleOption & = TQStyleOption(), const TQWidget *=0) const; + +protected: + bool eventFilter(TQObject *,TQEvent *); + +private: + TQSGIStyle(const TQSGIStyle &); +}; + +%End diff --git a/sip/tqt/tqsignalmapper.sip b/sip/tqt/tqsignalmapper.sip new file mode 100644 index 0000000..2ac99e6 --- /dev/null +++ b/sip/tqt/tqsignalmapper.sip @@ -0,0 +1,51 @@ +// This is the SIP interface definition for TQSignalMapper +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQSignalMapper</Title> +<Para> +<Literal>TQSignalMapper</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQSignalMapper : TQObject +{ +%TypeHeaderCode +#include <tqsignalmapper.h> +%End + +public: + TQSignalMapper(TQObject * /TransferThis/,const char * = 0); + + virtual void setMapping(const TQObject *,int); + virtual void setMapping(const TQObject *,const TQString &); + void removeMappings(const TQObject *); + +signals: + void mapped(int); + void mapped(const TQString &); + +public slots: + void map(); +}; diff --git a/sip/tqt/tqsimplerichtext.sip b/sip/tqt/tqsimplerichtext.sip new file mode 100644 index 0000000..cc21df5 --- /dev/null +++ b/sip/tqt/tqsimplerichtext.sip @@ -0,0 +1,64 @@ +// This is the SIP interface definition for TQSimpleRichText. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQSimpleRichText (TQt v2+)</Title> +<Para> +<Literal>TQSimpleRichText</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQSimpleRichText +{ +%TypeHeaderCode +#include <tqsimplerichtext.h> +%End + +public: + TQSimpleRichText(const TQString &,const TQFont &, + const TQString & = TQString::null, + const TQStyleSheet * = 0); + TQSimpleRichText(const TQString &,const TQFont &,const TQString &, + const TQStyleSheet *,const TQMimeSourceFactory *, + int = -1,const TQColor & = TQt::blue,bool = 1); + + void setWidth(int); + void setWidth(TQPainter *,int); + void setDefaultFont(const TQFont &); + int width() const; + int widthUsed() const; + int height() const; + void adjustSize(); + + void draw(TQPainter *,int,int,const TQRect &,const TQColorGroup &, + const TQBrush * = 0) const; + + TQString context() const; + TQString anchorAt(const TQPoint &) const; + + bool inText(const TQPoint &) const; + +private: + TQSimpleRichText(const TQSimpleRichText &); +}; diff --git a/sip/tqt/tqsize.sip b/sip/tqt/tqsize.sip new file mode 100644 index 0000000..c5d34ef --- /dev/null +++ b/sip/tqt/tqsize.sip @@ -0,0 +1,108 @@ +// This is the SIP interface definition for TQSize. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQSize</Title> +<Para> +The Python +<Literal>+</Literal>, <Literal>+=</Literal>, +<Literal>-</Literal>, <Literal>-=</Literal>, +<Literal>*</Literal>, <Literal>*=</Literal>, +<Literal>/</Literal>, <Literal>/=</Literal>, +<Literal>==</Literal>, <Literal>!=</Literal> and <Literal>__nonzero__</Literal> +operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>TQCOORD &<Function>rheight</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>TQCOORD &<Function>rwidth</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +%End + + +class TQSize +{ +%TypeHeaderCode +#include <tqsize.h> +%End + +public: + enum ScaleMode { + ScaleFree, + ScaleMin, + ScaleMax + }; + + TQSize(); + TQSize(int,int); + + bool isNull() const; + bool isEmpty() const; + bool isValid() const; + + int width() const; + int height() const; + void setWidth(int); + void setHeight(int); + void transpose(); + + void scale(int,int,ScaleMode); + void scale(const TQSize &,ScaleMode); + + TQSize expandedTo(const TQSize &) const; + TQSize boundedTo(const TQSize &) const; +// TQCOORD &rwidth(); +// TQCOORD &rheight(); + + TQSize &operator+=(const TQSize &); + TQSize &operator-=(const TQSize &); + TQSize &operator*=(int /Constrained/); + TQSize &operator*=(double); + TQSize &operator/=(int /Constrained/); + TQSize &operator/=(double); + + int __nonzero__() const; +%MethodCode + sipRes = sipCpp -> isValid(); +%End +}; + +bool operator==(const TQSize &,const TQSize &); +bool operator!=(const TQSize &,const TQSize &); +const TQSize operator+(const TQSize &,const TQSize &); +const TQSize operator-(const TQSize &,const TQSize &); +const TQSize operator*(const TQSize &,int /Constrained/); +const TQSize operator*(const TQSize &,double); +const TQSize operator/(const TQSize &,int /Constrained/); +const TQSize operator/(const TQSize &,double); diff --git a/sip/tqt/tqsizegrip.sip b/sip/tqt/tqsizegrip.sip new file mode 100644 index 0000000..505f90b --- /dev/null +++ b/sip/tqt/tqsizegrip.sip @@ -0,0 +1,53 @@ +// This is the SIP interface definition for TQSizeGrip. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQSizeGrip (TQt v2+)</Title> +<Para> +<Literal>TQSizeGrip</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_SIZEGRIP) + +class TQSizeGrip : TQWidget +{ +%TypeHeaderCode +#include <tqsizegrip.h> +%End + +public: + TQSizeGrip(TQWidget * /TransferThis/,const char * = 0); + + TQSize sizeHint() const; + +protected: + void paintEvent(TQPaintEvent *); + void mousePressEvent(TQMouseEvent *); + void mouseMoveEvent(TQMouseEvent *); + + bool eventFilter(TQObject *,TQEvent *); +}; + +%End diff --git a/sip/tqt/tqsizepolicy.sip b/sip/tqt/tqsizepolicy.sip new file mode 100644 index 0000000..4f981e4 --- /dev/null +++ b/sip/tqt/tqsizepolicy.sip @@ -0,0 +1,85 @@ +// This is the SIP interface definition for TQSizePolicy. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQSizePolicy (TQt v2+)</Title> +<Para> +<Literal>TQSizePolicy</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQSizePolicy +{ +%TypeHeaderCode +#include <tqsizepolicy.h> +%End + +public: + enum SizeType + { + Fixed, + Minimum, + Maximum, + Preferred, + MinimumExpanding, + Expanding, + Ignored + }; + + enum ExpandData + { + NoDirection, + Horizontally, + Vertically, + BothDirections + }; + + TQSizePolicy(); + TQSizePolicy(SizeType,SizeType,bool = 0); + // Note that TQt defines the 2nd and 3rd parameters as uchar, but it's + // really using them as numbers, not characters. + TQSizePolicy(SizeType,SizeType,uint,uint,bool = 0); + + SizeType horData() const; + SizeType verData() const; + + bool mayShrinkHorizontally() const; + bool mayShrinkVertically() const; + bool mayGrowHorizontally() const; + bool mayGrowVertically() const; + + ExpandData expanding() const; + + void setHorData(SizeType); + void setVerData(SizeType); + + void setHeightForWidth(bool); + bool hasHeightForWidth() const; + + uint horStretch() const; + uint verStretch() const; + void setHorStretch(uint); + void setVerStretch(uint); + void transpose(); +}; diff --git a/sip/tqt/tqslider.sip b/sip/tqt/tqslider.sip new file mode 100644 index 0000000..28d42e5 --- /dev/null +++ b/sip/tqt/tqslider.sip @@ -0,0 +1,119 @@ +// This is the SIP interface definition for TQSlider. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQSlider</Title> +<Para> +<Literal>TQSlider</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQSlider : TQWidget, TQRangeControl +{ +%TypeHeaderCode +#include <tqslider.h> +%End + +public: + + enum TickSetting { + NoMarks = 0, + Above = 1, + Left = Above, + Below = 2, + Right = Below, + Both = 3 + }; + + TQSlider(TQWidget * /TransferThis/,const char * = 0); + TQSlider(Orientation,TQWidget * /TransferThis/,const char * = 0); + TQSlider(int,int,int,int,Orientation,TQWidget * /TransferThis/,const char * = 0); + + virtual void setOrientation(Orientation); + Orientation orientation() const; + virtual void setTracking(bool); + bool tracking() const; + virtual void setPalette(const TQPalette &); + + int sliderStart() const; + TQRect sliderRect() const; + TQSize sizeHint() const; + void setSizePolicy(TQSizePolicy); + void setSizePolicy(TQSizePolicy::SizeType,TQSizePolicy::SizeType, + bool = 0); + TQSizePolicy sizePolicy() const; + TQSize minimumSizeHint() const; + + virtual void setTickmarks(TickSetting); + TickSetting tickmarks() const; + + virtual void setTickInterval(int); + int tickInterval() const; + + int minValue() const; + int maxValue() const; + void setMinValue(int); + void setMaxValue(int); + int lineStep() const; + int pageStep() const; + void setLineStep(int); + void setPageStep(int); + int value() const; + +public slots: + virtual void setValue(int); + void addStep(); + void subtractStep(); + void addLine(); + void subtractLine(); + +signals: + void valueChanged(int); + void sliderPressed(); + void sliderMoved(int); + void sliderReleased(); + +protected: + void resizeEvent(TQResizeEvent *); + void paintEvent(TQPaintEvent *); + + void keyPressEvent(TQKeyEvent *); + void mousePressEvent(TQMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); + void mouseMoveEvent(TQMouseEvent *); + void wheelEvent(TQWheelEvent *); + void focusInEvent(TQFocusEvent *); + void focusOutEvent(TQFocusEvent *); + + void styleChange(TQStyle &); + + void valueChange(); + void rangeChange(); + +private: + int positionFromValue(int) const; + int valueFromPosition(int) const; + + TQSlider(const TQSlider &); +}; diff --git a/sip/tqt/tqsocketnotifier.sip b/sip/tqt/tqsocketnotifier.sip new file mode 100644 index 0000000..0f2d27d --- /dev/null +++ b/sip/tqt/tqsocketnotifier.sip @@ -0,0 +1,61 @@ +// This is the SIP interface definition for TQSocketNotifier. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQSocketNotifier</Title> +<Para> +<Literal>TQSocketNotifier</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQSocketNotifier : TQObject +{ +%TypeHeaderCode +#include <tqsocketnotifier.h> +%End + +public: + enum Type { + Read, + Write, + Exception + }; + + TQSocketNotifier(int,Type,TQObject * /TransferThis/ = 0,const char * = 0); + + int socket() const; + Type type() const; + + bool isEnabled() const; + virtual void setEnabled(bool); + +signals: + void activated(int); + +protected: + bool event(TQEvent *); + +private: + TQSocketNotifier(const TQSocketNotifier &); +}; diff --git a/sip/tqt/tqsound.sip b/sip/tqt/tqsound.sip new file mode 100644 index 0000000..d0c442e --- /dev/null +++ b/sip/tqt/tqsound.sip @@ -0,0 +1,58 @@ +// This is the SIP interface definition for TQSound. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQSound (TQt v2.2+)</Title> +<Para> +<Literal>TQSound</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_SOUND) + +class TQSound : TQObject +{ +%TypeHeaderCode +#include <tqsound.h> +%End + +public: + TQSound(const TQString &,TQObject * /TransferThis/ = 0,const char * = 0); + + static bool isAvailable(); + static void play(const TQString &); + + int loops() const; + int loopsRemaining() const; + void setLoops(int); + TQString fileName() const; + + bool isFinished() const; + +public slots: + void play(); + void stop(); +}; + +%End diff --git a/sip/tqt/tqspinbox.sip b/sip/tqt/tqspinbox.sip new file mode 100644 index 0000000..447ec7c --- /dev/null +++ b/sip/tqt/tqspinbox.sip @@ -0,0 +1,122 @@ +// This is the SIP interface definition for TQSpinBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQSpinBox</Title> +<FuncSynopsis> + <FuncDef>virtual int <Function>mapTextToValue</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>int</Literal> result and the modified +<Literal>ok</Literal> value. +</Para> +</Sect2> +%End + + +class TQSpinBox : TQWidget, TQRangeControl +{ +%TypeHeaderCode +#include <tqspinbox.h> +%End + +public: + TQSpinBox(TQWidget * /TransferThis/ = 0,const char * = 0); + TQSpinBox(int,int,int = 1,TQWidget * /TransferThis/ = 0,const char * = 0); + + TQString text() const; + + virtual TQString prefix() const; + virtual TQString suffix() const; + virtual TQString cleanText() const; + + virtual void setSpecialValueText(const TQString &); + TQString specialValueText() const; + + virtual void setWrapping(bool); + bool wrapping() const; + + enum ButtonSymbols { + UpDownArrows, + PlusMinus + }; + + virtual void setButtonSymbols(ButtonSymbols); + ButtonSymbols buttonSymbols() const; + + virtual void setValidator(const TQValidator *); + const TQValidator *validator() const; + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + + int minValue() const; + int maxValue() const; + void setMinValue(int); + void setMaxValue(int); + int lineStep() const; + void setLineStep(int); + int value() const; + + TQRect upRect() const; + TQRect downRect() const; + +public slots: + virtual void setValue(int); + virtual void setPrefix(const TQString &); + virtual void setSuffix(const TQString &); + virtual void stepUp(); + virtual void stepDown(); + virtual void setEnabled(bool); + virtual void selectAll(); + +signals: + void valueChanged(int); + void valueChanged(const TQString &); + +protected: + virtual TQString mapValueToText(int); + virtual int mapTextToValue(bool *); + TQString currentValueText(); + + virtual void updateDisplay(); + virtual void interpretText(); + + TQLineEdit *editor() const; + + virtual void valueChange(); + virtual void rangeChange(); + + bool eventFilter(TQObject *,TQEvent *); + void resizeEvent(TQResizeEvent *); + void wheelEvent(TQWheelEvent *); + void leaveEvent(TQEvent *); + + void styleChange(TQStyle &); + +protected slots: + void textChanged(); + +private: + TQSpinBox(const TQSpinBox &); +}; diff --git a/sip/tqt/tqsplashscreen.sip b/sip/tqt/tqsplashscreen.sip new file mode 100644 index 0000000..5ef5433 --- /dev/null +++ b/sip/tqt/tqsplashscreen.sip @@ -0,0 +1,57 @@ +// This is the SIP interface definition for TQSplashScreen. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQSplashScreen (TQt v3.2.0+)</Title> +<Para> +<Literal>TQSplashScreen</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQSplashScreen : TQWidget +{ +%TypeHeaderCode +#include <tqsplashscreen.h> +%End + +public: + TQSplashScreen(const TQPixmap & = TQPixmap(),WFlags = 0); + virtual ~TQSplashScreen(); + + void setPixmap(const TQPixmap &); + TQPixmap *pixmap() const; + void finish(TQWidget *); + void repaint(); + +public slots: + void message(const TQString &,int = AlignLeft,const TQColor & = TQt::black); + void clear(); + +signals: + void messageChanged(const TQString &); + +protected: + virtual void drawContents(TQPainter *); + void mousePressEvent(TQMouseEvent *); +}; diff --git a/sip/tqt/tqsplitter.sip b/sip/tqt/tqsplitter.sip new file mode 100644 index 0000000..182b706 --- /dev/null +++ b/sip/tqt/tqsplitter.sip @@ -0,0 +1,102 @@ +// This is the SIP interface definition for TQSplitter. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQSplitter</Title> +<FuncSynopsis> + <FuncDef>void <Function>getRange</Function></FuncDef> + <ParamDef>int <Parameter>id</Parameter></ParamDef> + <ParamDef>int *<Parameter>min</Parameter></ParamDef> + <ParamDef>int *<Parameter>max</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>id</Literal> parameter and returns the +<Literal>min</Literal> and <Literal>max</Literal> values as a tuple. (TQt v2+) +</Para> +</Sect2> +%End + + +%If (TQt_SPLITTER) + +class TQSplitter : TQFrame +{ +%TypeHeaderCode +#include <tqsplitter.h> +%End + +public: + enum ResizeMode { + Stretch, + KeepSize, + FollowSizeHint, + Auto + }; + + TQSplitter(TQWidget * /TransferThis/ = 0,const char * = 0); + TQSplitter(Orientation,TQWidget * /TransferThis/ = 0,const char * = 0); + + virtual void setOrientation(Orientation); + Orientation orientation() const; + + void setChildrenCollapsible(bool); + bool childrenCollapsible() const; + + void setCollapsible(TQWidget *,bool); + + virtual void setResizeMode(TQWidget *,ResizeMode); + virtual void setOpaqueResize(bool = 1); + bool opaqueResize() const; + + void moveToFirst(TQWidget *); + void moveToLast(TQWidget *); + + void refresh(); + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + + TQValueList<int> sizes() const; + void setSizes(TQValueList<int>); + + int handleWidth() const; + void setHandleWidth(int); + +protected: + void childEvent(TQChildEvent *); + + bool event(TQEvent *); + void resizeEvent(TQResizeEvent *); + + int idAfter(TQWidget *) const; + + void moveSplitter(TQCOORD,int); + virtual void drawSplitter(TQPainter *,TQCOORD,TQCOORD,TQCOORD,TQCOORD); + void styleChange(TQStyle &); + int adjustPos(int,int); + virtual void setRubberband(int); + void getRange(int,int *,int *); + +private: + TQSplitter(const TQSplitter &); +}; + +%End diff --git a/sip/tqt/tqstatusbar.sip b/sip/tqt/tqstatusbar.sip new file mode 100644 index 0000000..d1fadcf --- /dev/null +++ b/sip/tqt/tqstatusbar.sip @@ -0,0 +1,65 @@ +// This is the SIP interface definition for TQStatusBar. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQStatusBar</Title> +<Para> +<Literal>TQStatusBar</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQStatusBar : TQWidget +{ +%TypeHeaderCode +#include <tqstatusbar.h> +%End + +public: + TQStatusBar(TQWidget * /TransferThis/ = 0,const char * = 0); + + virtual void addWidget(TQWidget * /Transfer/,int = 0,bool = 0); + virtual void removeWidget(TQWidget * /TransferBack/); + + void setSizeGripEnabled(bool); + bool isSizeGripEnabled() const; + +public slots: + void message(const TQString &); + void message(const TQString &,int); + void clear(); + +signals: + void messageChanged(const TQString &); + +protected: + void paintEvent(TQPaintEvent *); + void resizeEvent(TQResizeEvent *); + + void reformat(); + void hideOrShow(); + bool event(TQEvent *); + +private: + TQStatusBar(const TQStatusBar &); +}; diff --git a/sip/tqt/tqstring.sip b/sip/tqt/tqstring.sip new file mode 100644 index 0000000..116140e --- /dev/null +++ b/sip/tqt/tqstring.sip @@ -0,0 +1,946 @@ +// This is the SIP interface definition for TQChar and TQString. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQChar (TQt v2+)</Title> +<FuncSynopsis> + <FuncDef>uchar &<Function>cell</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>uchar &<Function>row</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> + +<Sect2><Title>TQString</Title> +<Para> +A Python string object (or Unicode object) can be used whenever a +<Literal>TQString</Literal> can be used. A <Literal>TQString</Literal> can be +converted to a Python string object using the Python <Literal>str()</Literal> +function, and to a Python Unicode object using the Python +<Literal>unicode()</Literal> function. +</Para> + +<Para> +The Python <Literal>+</Literal>, <Literal>+=</Literal>, <Literal>*</Literal>, +<Literal>*=</Literal>, <Literal>len</Literal>, <Literal>[]</Literal> +(for reading slices and individual characters), <Literal>in</Literal> and +comparison operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>TQCharRef <Function>at</Function></FuncDef> + <ParamDef>uint <Parameter>i</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (TQt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>TQChar <Function>constref</Function> const</FuncDef> + <ParamDef>uint <Parameter>i</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (TQt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>TQChar &<Function>ref</Function></FuncDef> + <ParamDef>uint <Parameter>i</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (TQt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>TQString &<Function>setUnicodeCodes</Function></FuncDef> + <ParamDef>const ushort *<Parameter>unicode_as_shorts</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (TQt v2.1+) +</Para> + +<FuncSynopsis> + <FuncDef>TQString &<Function>sprintf</Function></FuncDef> + <ParamDef>const char *<Parameter>format</Parameter></ParamDef> + <ParamDef>...</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>short <Function>toShort</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>short</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>ushort <Function>toUShort</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>ushort</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>toInt</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>int</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>uint <Function>toUInt</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>uint</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>long <Function>toLong</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>long</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>ulong <Function>toULong</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>ulong</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>float <Function>toFloat</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>float</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>double <Function>toDouble</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>double</Literal> result and the +<Literal>ok</Literal> value. +</Para> +</Sect2> +%End + + +class TQChar +{ +%TypeHeaderCode +#include <tqstring.h> +%End + +public: + TQChar(); + TQChar(char); +// TQChar(uchar); + TQChar(uchar,uchar); + TQChar(const TQChar &); +// TQChar(ushort); +// TQChar(short); +// TQChar(uint); + TQChar(int); + + static const TQChar null; + static const TQChar replacement; + static const TQChar byteOrderMark; + static const TQChar byteOrderSwapped; + static const TQChar nbsp; + + enum Category { + NoCategory, + + Mark_NonSpacing, + Mark_SpacingCombining, + Mark_Enclosing, + + Number_DecimalDigit, + Number_Letter, + Number_Other, + + Separator_Space, + Separator_Line, + Separator_Paragraph, + + Other_Control, + Other_Format, + Other_Surrogate, + Other_PrivateUse, + Other_NotAssigned, + + Letter_Uppercase, + Letter_Lowercase, + Letter_Titlecase, + Letter_Modifier, + Letter_Other, + + Punctuation_Connector, + Punctuation_Dash, + Punctuation_Open, + Punctuation_Close, + Punctuation_InitialQuote, + Punctuation_FinalQuote, + Punctuation_Other, + + Symbol_Math, + Symbol_Currency, + Symbol_Modifier, + Symbol_Other + }; + + enum Direction { + DirL, + DirR, + DirEN, + DirES, + DirET, + DirAN, + DirCS, + DirB, + DirS, + DirWS, + DirON, + DirLRE, + DirLRO, + DirAL, + DirRLE, + DirRLO, + DirPDF, + DirNSM, + DirBN + }; + + enum Decomposition { + Single, + Canonical, + Font, + NoBreak, + Initial, + Medial, + Final, + Isolated, + Circle, + Super, + Sub, + Vertical, + Wide, + Narrow, + Small, + Square, + Compat, + Fraction + }; + + enum Joining { + OtherJoining, + Dual, + Right, + Center + }; + + enum CombiningClass { + Combining_BelowLeftAttached, + Combining_BelowAttached, + Combining_BelowRightAttached, + Combining_LeftAttached, + Combining_RightAttached, + Combining_AboveLeftAttached, + Combining_AboveAttached, + Combining_AboveRightAttached, + + Combining_BelowLeft, + Combining_Below, + Combining_BelowRight, + Combining_Left, + Combining_Right, + Combining_AboveLeft, + Combining_Above, + Combining_AboveRight, + + Combining_DoubleBelow, + Combining_DoubleAbove, + Combining_IotaSubscript + }; + + int digitValue() const; + TQChar lower() const; + TQChar upper() const; + + Category category() const; + Direction direction() const; + Joining joining() const; + bool mirrored() const; + TQChar mirroredChar() const; + const TQString &decomposition() const; + Decomposition decompositionTag() const; + unsigned char combiningClass() const; + + char latin1() const; + ushort unicode() const; + + bool isNull() const; + bool isPrint() const; + bool isPunct() const; + bool isSpace() const; + bool isMark() const; + bool isLetter() const; + bool isNumber() const; + bool isLetterOrNumber() const; + bool isDigit() const; + bool isSymbol() const; + +// uchar& cell(); +// uchar& row(); + uchar cell() const; + uchar row() const; + void setCell(uchar); + void setRow(uchar); + + static bool networkOrdered(); +}; + +bool operator==(TQChar,char); +bool operator==(TQChar,TQChar); +bool operator!=(TQChar,TQChar); +bool operator!=(TQChar,char); +bool operator<=(TQChar,char); +bool operator<=(TQChar,TQChar); +bool operator>=(TQChar,char); +bool operator>=(TQChar,TQChar); +bool operator<(TQChar,char); +bool operator<(TQChar,TQChar); +bool operator>(TQChar,char); +bool operator>(TQChar,TQChar); + + +class TQString +{ +%TypeHeaderCode +#include <tqstring.h> +#include <tqtextcodec.h> +%End + +public: + TQString(); + TQString(TQChar); + TQString(const TQString &); + TQString(const TQByteArray &); +// TQString(const TQChar *,uint); +// TQString(const char *); + + // This is how we implement TQUrl::operator TQString() const. + TQString(const TQUrl &); + + // This is how we implement TQKeySequence::operator TQString() const. + TQString(const TQKeySequence &); + + // This is how we implement TQUuid::operator TQString() const. + TQString(const TQUuid &); + + static const TQString null; + + bool isNull() const; + bool isEmpty() const; + uint length() const; + void truncate(uint); + TQString &fill(TQChar,int = -1); + TQString copy() const; + + TQString arg(int /Constrained/,int = 0,int = 10) const; + TQString arg(double /Constrained/,int = 0,char = 'g',int = -1) const; +// TQString arg(TQ_LLONG,int = 0,int = 10) const; +// TQString arg(TQ_ULLONG,int = 0,int = 10) const; + TQString arg(long,int = 0,int = 10) const; + TQString arg(ulong,int = 0,int = 10) const; +// TQString arg(uint,int = 0,int = 10) const; +// TQString arg(short,int = 0,int = 10) const; +// TQString arg(ushort,int = 0,int = 10) const; + TQString arg(char,int = 0) const; + TQString arg(TQChar,int = 0) const; + TQString arg(const TQString&,int = 0) const; + TQString arg(const TQString &,const TQString &) const; + TQString arg(const TQString &,const TQString &,const TQString &) const; + TQString arg(const TQString &,const TQString &,const TQString &, + const TQString &) const; + +// TQString &sprintf(const char *,...); + + int find(TQChar,int = 0,bool = 1) const; + int find(char,int = 0,bool = 1) const; + int find(const TQString &,int = 0,bool = 1) const; + int find(const TQRegExp &,int = 0) const; +// int find(const char *,int = 0) const; + int findRev(TQChar,int = -1,bool = 1) const; + int findRev(char,int = -1,bool = 1) const; + int findRev(const TQString &,int = -1,bool = 1) const; + int findRev(const TQRegExp &,int = -1) const; +// int findRev(const char *,int = -1) const; + int contains(TQChar,bool = 1) const; + int contains(char,bool = 1) const; +// int contains(const char *,bool = 1) const; + int contains(const TQString &,bool = 1) const; + int contains(const TQRegExp &) const; + + enum SectionFlags { + SectionDefault, + SectionSkipEmpty, + SectionIncludeLeadingSep, + SectionIncludeTrailingSep, + SectionCaseInsensitiveSeps + }; + + TQString section(TQChar,int,int = 0xffffffff,int = SectionDefault) const; +// TQString section(char,int,int = 0xffffffff,int = SectionDefault) const; +// TQString section(const char *,int,int = 0xffffffff, +// int = SectionDefault) const; + TQString section(const TQString &,int,int = 0xffffffff, + int = SectionDefault) const; + TQString section(const TQRegExp &,int,int = 0xffffffff, + int = SectionDefault) const; + + TQString left(uint) const; + TQString right(uint) const; + TQString mid(uint,uint = 0xffffffff) const; + TQString leftJustify(uint,TQChar = ' ',bool = 0) const; + TQString rightJustify(uint,TQChar = ' ',bool = 0) const; + TQString lower() const; + TQString upper() const; + TQString stripWhiteSpace() const; + TQString simplifyWhiteSpace() const; + + TQString &insert(uint,const TQString &); + TQString &insert(uint,const TQByteArray &); +// TQString &insert(uint,const char *); + TQString &insert(uint,TQChar *,uint); + TQString &insert(uint,TQChar); + TQString &insert(uint,char); + + TQString &append(char); + TQString &append(TQChar); + TQString &append(const TQString &); + TQString &prepend(char); + TQString &prepend(TQChar); + TQString &prepend(const TQString &); + TQString &remove(uint,uint); + TQString &remove(const TQString &); + TQString &remove(const TQString &,bool); + TQString &remove(TQChar); + TQString &remove(char); + TQString &remove(const TQRegExp &); + TQString &replace(uint,uint,const TQString &); + TQString &replace(uint,uint,const TQChar *,uint); + TQString &replace(uint,uint,TQChar); + TQString &replace(uint,uint,char); + TQString &replace(TQChar,const TQString &); + TQString &replace(TQChar,const TQString &,bool); + TQString &replace(char,const TQString &); + TQString &replace(char,const TQString &,bool); + TQString &replace(const TQString &,const TQString &); + TQString &replace(const TQString &,const TQString &,bool); + TQString &replace(const TQRegExp &,const TQString &); + TQString &replace(TQChar,TQChar); + + short toShort(bool * = 0,int = 10) const; + ushort toUShort(bool * = 0,int = 10) const; + int toInt(bool * = 0,int = 10) const; + uint toUInt(bool * = 0,int = 10) const; + long toLong(bool * = 0,int = 10) const; + ulong toULong(bool * = 0,int = 10) const; +// TQ_LLONG toLongLong(bool * = 0,int = 10) const; +// TQ_ULLONG toULongLong(bool * = 0,int = 10) const; + float toFloat(bool * = 0) const; + double toDouble(bool * = 0) const; + + TQString &setNum(int /Constrained/,int = 10); + TQString &setNum(double /Constrained/,char = 'g',int = 6); +// TQString &setNum(short,int = 10); +// TQString &setNum(ushort,int = 10); +// TQString &setNum(uint,int = 10); + TQString &setNum(long,int = 10); + TQString &setNum(ulong,int = 10); +// TQString &setNum(TQ_LLONG,int = 10); +// TQString &setNum(TQ_ULLONG,int = 10); +// TQString &setNum(float,char = 'g',int = 6); + + static TQString number(int /Constrained/,int = 10); + static TQString number(double /Constrained/,char = 'g',int = 6); + static TQString number(long,int = 10); + static TQString number(ulong,int = 10); +// static TQString number(TQ_LLONG,int = 10); +// static TQString number(TQ_ULLONG,int = 10); +// static TQString number(uint,int = 10); + + void setExpand(uint,TQChar); + + TQString &operator+=(const TQString &); + TQString &operator+=(const TQByteArray &); + TQString &operator+=(TQChar); + //TQString &operator+=(char); + + TQString operator*(int); +%MethodCode + sipRes = new TQString(); + + while (a0-- > 0) + *sipRes += *sipCpp; +%End + + TQString &operator*=(int); +%MethodCode + TQString orig(*sipCpp); + + sipCpp -> truncate(0); + + while (a0-- > 0) + *sipCpp += orig; +%End + + TQChar at(uint) const; +// TQCharRef at(uint); +// TQChar constref(uint) const; +// TQChar &ref(uint); +// const TQChar *unicode() const; + const char *ascii() const; + static TQString fromAscii(const char *,int = -1); + const char *latin1() const; + static TQString fromLatin1(const char *,int = -1); + TQCString utf8() const; + static TQString fromUtf8(const char *,int = -1); + TQCString local8Bit() const; + static TQString fromLocal8Bit(const char *,int = -1); + +// static TQString fromUcs2(const unsigned short *); +// const unsigned short *ucs2() const; + +// TQString &setUnicode(const TQChar *,uint); +// TQString &setUnicodeCodes(const ushort *,uint); + TQString &setAscii(const char *,int = -1); + TQString &setLatin1(const char *,int = -1); + + int compare(const TQString &) const; + static int compare(const TQString &,const TQString &); + + int localeAwareCompare(const TQString &) const; + static int localeAwareCompare(const TQString &,const TQString &); + + void compose(); + bool startsWith(const TQString &) const; + bool startsWith(const TQString &,bool) const; + bool endsWith(const TQString &) const; + bool endsWith(const TQString &,bool) const; + + void setLength(uint); + + uint capacity() const; + void reserve(uint); + void squeeze(); + + bool simpleText() const; + bool isRightToLeft() const; + + // Force the numeric interpretation so that str + TQString gets handled + // as we want. + const TQString operator+(const TQString &) /Numeric/; + + TQString operator[](int) const; +%MethodCode + int len; + + len = sipCpp -> length(); + + if ((a0 = (int)sipConvertFromSequenceIndex(a0,len)) < 0) + sipIsErr = 1; + else + sipRes = new TQString(sipCpp -> at(a0)); +%End + + TQString operator[](SIP_PYSLICE) const; +%MethodCode + Py_ssize_t len, start, stop, step, slicelength, i; + + len = sipCpp -> length(); + + if (sipConvertFromSliceObject(a0,len,&start,&stop,&step,&slicelength) < 0) + sipIsErr = 1; + else + { + sipRes = new TQString(); + + for (i = 0; i < slicelength; ++i) + { + sipRes -> append(sipCpp -> at(start)); + start += step; + } + } +%End + + int __len__() const; +%MethodCode + sipRes = sipCpp -> length(); +%End + + int __contains__(const TQString &) const; +%MethodCode + sipRes = (sipCpp -> contains(*a0) > 0); +%End + + SIP_PYOBJECT __unicode__(); +%MethodCode + sipRes = PyTQt_tqt_PyObject_FromTQString(sipCpp); +%End + + SIP_PYOBJECT __str__(); +%MethodCode + sipRes = PyTQt_tqt_PyObject_FromTQString(sipCpp); +%End + +%ConvertToTypeCode + // Allow a Python string (or a unicode string) whenever a TQString is + // expected. + + if (sipIsErr == NULL) + return (PyBytes_Check(sipPy) || + PyUnicode_Check(sipPy) || + sipCanConvertToInstance(sipPy,sipClass_TQString,SIP_NO_CONVERTORS)); + + *sipCppPtr = PyTQt_tqt_PyObject_AsTQString(sipPy); + + if (*sipCppPtr) + return sipGetState(sipTransferObj); + + *sipCppPtr = reinterpret_cast<TQString *>(sipConvertToInstance(sipPy,sipClass_TQString,sipTransferObj,SIP_NO_CONVERTORS,0,sipIsErr)); + + return 0; +%End + +%BIGetReadBufferCode + if (sipSegment != 0) + { + PyErr_SetString(PyExc_SystemError, "accessing non-existent TQString segment"); + sipRes = -1; + } + else + { + *sipPtrPtr = (void *)sipCpp->ucs2(); + sipRes = sipCpp->length() * sizeof (ushort); + } +%End + +%BIGetSegCountCode + if (sipLenPtr) + *sipLenPtr = sipCpp->length() * sizeof (ushort); + + sipRes = 1; +%End + +%BIGetCharBufferCode + if (sipSegment != 0) + { + PyErr_SetString(PyExc_SystemError, "accessing non-existent TQString segment"); + sipRes = -1; + } + else + { + static TQTextCodec *codec = 0; + static bool check_codec = TRUE; + + // For the first time only, try and find a TQt codec that + // corresponds to the default Python codec. If one wasn't + // found then fall back to ASCII (which is actually the codec + // returned by TQTextCodec::codecForCStrings()). + if (check_codec) + { + codec = TQTextCodec::codecForName(PyUnicode_GetDefaultEncoding()); + check_codec = FALSE; + } + + if (codec) + { + // A Python string is the most convenient method to + // save the encoded version on the heap. + PyObject *encobj = ((sipSimpleWrapper *)sipSelf)->user; + TQCString enc; + + Py_XDECREF(encobj); + + enc = codec->fromUnicode(*sipCpp); + + if ((encobj = PyBytes_FromString(enc.data())) != NULL) + { + *sipPtrPtr = (void *)PyString_AS_STRING(encobj); + sipRes = PyString_GET_SIZE(encobj); + + ((sipSimpleWrapper *)sipSelf)->user = encobj; + } + else + sipRes = -1; + } + else + { + const char *asc = sipCpp->ascii(); + + *sipPtrPtr = (void *)asc; + sipRes = tqstrlen(asc); + } + } +%End +}; + +bool operator==(const TQString &,const TQString &); +bool operator!=(const TQString &,const TQString &); +bool operator<(const TQString &,const TQString &); +bool operator<=(const TQString &,const TQString &); +bool operator>(const TQString &,const TQString &); +bool operator>=(const TQString &,const TQString &); + + +%ModuleHeaderCode +extern PyObject *PyTQt_tqt_PyObject_FromTQString(const TQString *tqstr); +%End + +%ModuleCode +// Convert a TQString to a Python Unicode object. +PyObject *PyTQt_tqt_PyObject_FromTQString(const TQString *tqstr) +{ + PyObject *obj; + +#if PY_VERSION_HEX >= 0x03030000 + // We have to work out exactly which kind to use. We assume ASCII while we + // are checking so that we only go through the string once in the most + // common case. Note that we can't use PyUnicode_FromKindAndData() because + // it doesn't handle surrogates in UCS2 strings. + + int tqt_len = tqstr->length(); + Py_UCS4 maxchar = 0x007f; + + for (int tqt_i = 0; tqt_i < tqt_len && maxchar < 0xffff; ++tqt_i) + { + Py_UCS4 uch = tqstr->at(tqt_i).unicode(); + + if (uch > 0x00ff) + { + maxchar = 0xffff; + } + else if (uch > 0x007f) + { + maxchar = 0x00ff; + } + } + + // Create the correctly sized object. + if ((obj = PyUnicode_New(tqt_len, maxchar)) == NULL) + return NULL; + + int kind = PyUnicode_KIND(obj); + void *data = PyUnicode_DATA(obj); + + for (int tqt_i = 0; tqt_i < tqt_len; ++tqt_i) + { + Py_UCS4 uch = tqstr->at(tqt_i).unicode(); + PyUnicode_WRITE(kind, data, tqt_i, uch); + } +#elif defined(Py_UNICODE_WIDE) + // Note that this doesn't handle code points greater than 0xffff. It could + // but it's only an issue for old versions of TQt. + + if ((obj = PyUnicode_FromUnicode(NULL, tqstr->length())) == NULL) + return NULL; + + Py_UNICODE *pyu = PyUnicode_AS_UNICODE(obj); + + for (unsigned int i = 0; i < tqstr->length(); ++i) + *pyu++ = (tqstr->at(i)).unicode(); +#else + if ((obj = PyUnicode_FromUnicode(NULL, tqstr->length())) == NULL) + return NULL; + + memcpy(PyUnicode_AS_UNICODE(obj), tqstr->ucs2(), + tqstr->length() * sizeof (Py_UNICODE)); +#endif + + return obj; +} +%End + + +%ModuleHeaderCode +extern TQString *PyTQt_tqt_PyObject_AsTQString(PyObject *obj); +%End + +%ModuleCode +// Convert a Python Unicode object to a TQString. +TQString *PyTQt_tqt_PyObject_AsTQString(PyObject *obj) +{ + if (PyUnicode_Check(obj)) + { +#if PY_VERSION_HEX >= 0x03030000 + SIP_SSIZE_T len = PyUnicode_GET_LENGTH(obj); + + switch (PyUnicode_KIND(obj)) + { + case PyUnicode_1BYTE_KIND: + return new TQString(TQString::fromUtf8((char *)PyUnicode_1BYTE_DATA(obj), len)); + + case PyUnicode_2BYTE_KIND: + // The (TQChar *) cast should be safe. + return new TQString((TQChar *)PyUnicode_2BYTE_DATA(obj), len); + + case PyUnicode_4BYTE_KIND: + // Note that this doesn't handle code points greater than 0xffff. It + // could but it's only an issue for old versions of TQt. + + TQString *tqstr = new TQString; + + Py_UCS4 *ucode = PyUnicode_4BYTE_DATA(obj); + + for (SIP_SSIZE_T i = 0; i < len; ++i) + tqstr->append(TQChar((uint)ucode[i])); + + return tqstr; + } + + return NULL; +#else + TQString *tqstr = new TQString; + +# ifdef Py_UNICODE_WIDE + Py_UNICODE *ucode = PyUnicode_AS_UNICODE(obj); + SIP_SSIZE_T len = PyUnicode_GET_SIZE(obj); + + for (SIP_SSIZE_T i = 0; i < len; ++i) + tqstr->append(TQChar((uint)ucode[i])); +# else + tqstr->setUnicodeCodes((ushort *)PyUnicode_AS_UNICODE(obj),PyUnicode_GET_SIZE(obj)); +# endif + + return tqstr; +#endif + } + else if (PyBytes_Check(obj)) + { + return new TQString(PyBytes_AS_STRING(obj)); + } + + return NULL; +} +%End + + +%ModuleHeaderCode +extern const char *PyTQt_tqt_encode(PyObject **s, TQApplication::Encoding encoding); +%End + +%ModuleCode +// Convert a Python unicode/string/bytes object to a character string encoded +// according to the given encoding. Update the object with a new reference to +// the object that owns the data. +const char *PyTQt_tqt_encode(PyObject **s, TQApplication::Encoding encoding) +{ + PyObject *obj = *s; + const char *es = 0; + SIP_SSIZE_T sz; + + if (PyUnicode_Check(obj)) + { + if (encoding == TQApplication::UnicodeUTF8) + { + obj = PyUnicode_AsUTF8String(obj); + } + else + { + TQTextCodec *codec = TQTextCodec::codecForTr(); + + if (codec) + { + // Use the TQt codec to get to a byte string, and then to a + // Python object. + TQString *tqstr = PyTQt_tqt_PyObject_AsTQString(obj); + TQString tqs = *tqstr; + TQByteArray ba = codec->fromUnicode(tqs); + delete tqstr; + + obj = PyBytes_FromStringAndSize(ba.data(), ba.size()); + } + else + { + obj = PyUnicode_AsLatin1String(obj); + } + } + + if (obj) + { + es = PyBytes_AS_STRING(obj); + } + } + else if (PyBytes_Check(obj)) + { + es = PyBytes_AS_STRING(obj); + Py_INCREF(obj); + } + else if (PyObject_AsCharBuffer(obj, &es, &sz) >= 0) + { + Py_INCREF(obj); + } + + if (es) + { + *s = obj; + } + else + { + PyErr_Format(PyExc_UnicodeEncodeError, + "unable to convert '%s' to requested encoding", + Py_TYPE(*s)->tp_name); + } + + return es; +} +%End diff --git a/sip/tqt/tqstringlist.sip b/sip/tqt/tqstringlist.sip new file mode 100644 index 0000000..54e049d --- /dev/null +++ b/sip/tqt/tqstringlist.sip @@ -0,0 +1,227 @@ +// This is the SIP interface definition for TQStringList. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQStringList (TQt v2+)</Title> +<Para> +The Python <Literal>len</Literal>, <Literal>[]</Literal> (for both reading and +writing slices and individual elements), <Literal>del</Literal> (for deleting +slices and individual elements), <Literal>+</Literal>, <Literal>+=</Literal>, +<Literal>*</Literal>, <Literal>*=</Literal>, <Literal>==</Literal>, +<Literal>!=</Literal> and <Literal>in</Literal> operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>Iterator <Function>append</Function></FuncDef> + <ParamDef>const TQString &<Parameter>x</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This does not return a value. +</Para> + +<FuncSynopsis> + <FuncDef>Iterator <Function>prepend</Function></FuncDef> + <ParamDef>const TQString &<Parameter>x</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This does not return a value. +</Para> +</Sect2> +%End + + +class TQStringList +{ +%TypeHeaderCode +#include <tqstringlist.h> +%End + +public: + TQStringList(); + TQStringList(const TQStringList &); + TQStringList(const TQString &); + + void sort(); + static TQStringList fromStrList(const TQStrList &); + static TQStringList split(const TQString &,const TQString &,bool = 0); + static TQStringList split(const TQChar &,const TQString &,bool = 0); + static TQStringList split(const TQRegExp &,const TQString &,bool = 0); + TQString join(const TQString &) const; + TQStringList grep(const TQString &,bool = 1) const; + TQStringList grep(const TQRegExp &) const; + + TQStringList &gres(const TQString &,const TQString &,bool = 1); + TQStringList &gres(const TQRegExp &,const TQString &); + + // These are actually in TQValueList, which isn't implemented so + // pretend they are here. + + bool isEmpty() const; + void append(const TQString &); + void prepend(const TQString &); + void remove(const TQString &); + const TQString &first() const; + const TQString &last() const; + int findIndex(const TQString &) const; + uint contains(const TQString &) const; + uint count() const; + void clear(); + + int __len__(); +%MethodCode + sipRes = sipCpp -> count(); +%End + + void __setitem__(int,const TQString &); +%MethodCode + int len; + + len = sipCpp -> count(); + + if ((a0 = (int)sipConvertFromSequenceIndex(a0,len)) < 0) + sipIsErr = 1; + else + (*sipCpp)[a0] = *a1; +%End + + void __setitem__(SIP_PYSLICE,const TQStringList &); +%MethodCode + Py_ssize_t len, start, stop, step, slicelength, i; + + len = sipCpp -> count(); + + if (sipConvertFromSliceObject(a0,len,&start,&stop,&step,&slicelength) < 0) + sipIsErr = 1; + else + { + int vlen = a1 -> count(); + + if (vlen != slicelength) + { + sipBadLengthForSlice(vlen,slicelength); + sipIsErr = 1; + } + else + { + TQStringList::ConstIterator it = a1 -> begin(); + + for (i = 0; i < slicelength; ++i) + { + (*sipCpp)[start] = *it; + start += step; + ++it; + } + } + } +%End + + void __delitem__(int); +%MethodCode + int len; + + len = sipCpp -> count(); + + if ((a0 = (int)sipConvertFromSequenceIndex(a0,len)) < 0) + sipIsErr = 1; + else + sipCpp -> remove(sipCpp -> at(a0)); +%End + + void __delitem__(SIP_PYSLICE); +%MethodCode + Py_ssize_t len, start, stop, step, slicelength, i; + + len = sipCpp -> count(); + + if (sipConvertFromSliceObject(a0,len,&start,&stop,&step,&slicelength) < 0) + sipIsErr = 1; + else + for (i = 0; i < slicelength; ++i) + { + sipCpp -> remove(sipCpp -> at(start)); + start += step - 1; + } +%End + + TQString operator[](int); +%MethodCode + int len; + + len = sipCpp -> count(); + + if ((a0 = (int)sipConvertFromSequenceIndex(a0,len)) < 0) + sipIsErr = 1; + else + sipRes = new TQString((*sipCpp)[a0]); +%End + + TQStringList operator[](SIP_PYSLICE slice); +%MethodCode + Py_ssize_t len, start, stop, step, slicelength, i; + + len = sipCpp -> count(); + + if (sipConvertFromSliceObject(a0,len,&start,&stop,&step,&slicelength) < 0) + sipIsErr = 1; + else + { + sipRes = new TQStringList(); + + for (i = 0; i < slicelength; ++i) + { + (*sipRes) += (*sipCpp)[start]; + start += step; + } + } +%End + + int __contains__(const TQString &); +%MethodCode + sipRes = (sipCpp -> findIndex(*a0) >= 0); +%End + + TQStringList operator+(const TQStringList &); + TQStringList &operator+=(const TQStringList &); + + TQStringList &operator+=(const TQString &); + + TQStringList operator*(int); +%MethodCode + sipRes = new TQStringList(); + + while (a0-- > 0) + *sipRes += *sipCpp; +%End + + TQStringList &operator*=(int); +%MethodCode + TQStringList orig(*sipCpp); + + sipCpp -> clear(); + + while (a0-- > 0) + *sipCpp += orig; +%End + + bool operator==(const TQStringList &); + bool operator!=(const TQStringList &); +}; diff --git a/sip/tqt/tqstrlist.sip b/sip/tqt/tqstrlist.sip new file mode 100644 index 0000000..a93f4e6 --- /dev/null +++ b/sip/tqt/tqstrlist.sip @@ -0,0 +1,104 @@ +// This is the SIP interface definition for TQStrList. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQStrList</Title> +<Para> +This class isn't implemented. Whenever a <Literal>TQStrList</Literal> is the +return type of a function or the type of an argument, a Python list of strings +is used instead. +</Para> +</Sect2> +%End + + +%MappedType TQStrList +{ +%TypeHeaderCode +#include <tqstrlist.h> +%End + +%ConvertFromTypeCode + // Convert to a Python list of strings. + + char *s; + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + + for (s = sipCpp -> first(); s != NULL; s = sipCpp -> next()) + { + PyObject *ps; + + if ((ps = PyBytes_FromString(s)) == NULL || PyList_SetItem(l,i,ps) < 0) + { + Py_XDECREF(ps); + Py_DECREF(l); + return NULL; + } + + ++i; + } + + return l; +%End + +%ConvertToTypeCode + // Convert a Python list of strings to a TQStrList on the heap. + + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + TQStrList *tqsl = new TQStrList; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + PyObject *object = PyList_GET_ITEM(sipPy, i); + char *s; + + if (PyUnicode_Check(object)) + { + s = tqstrdup(sipString_AsUTF8String(&object)); + } + else if ((s = (char *)sipBytes_AsString(object)) == NULL) + { + *sipIsErr = 1; + delete tqsl; + return 0; + } + + tqsl -> append(s); + } + + *sipCppPtr = tqsl; + + return sipGetState(sipTransferObj); +%End +}; diff --git a/sip/tqt/tqstyle.sip b/sip/tqt/tqstyle.sip new file mode 100644 index 0000000..0630d81 --- /dev/null +++ b/sip/tqt/tqstyle.sip @@ -0,0 +1,841 @@ +// This is the SIP interface definition for TQStyle and TQStyleOption. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQStyle (TQt v2+)</Title> +<FuncSynopsis> + <FuncDef>virtual void <Function>getButtonShift</Function></FuncDef> + <ParamDef>int &<Parameter>x</Parameter></ParamDef> + <ParamDef>int &<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>x</Literal> and +<Literal>y</Literal> values. (TQt v2) +</Para> + +<FuncSynopsis> + <FuncDef>virtual void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const TQScrollBar *<Parameter>b</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Thus takes only the <Literal>b</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +(TQt v2) +</Para> + +<FuncSynopsis> + <FuncDef>virtual void <Function>tabbarMetrics</Function></FuncDef> + <ParamDef>const TQTabBar *<Parameter>t</Parameter></ParamDef> + <ParamDef>int &<Parameter>hframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>vframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>overlap</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>t</Literal> parameter and returns a tuple of the +<Literal>hframe</Literal>, <Literal>vframe</Literal> and +<Literal>overlap</Literal> values. (TQt v2) +</Para> +</Sect2> + +<Sect2><Title>TQStyleOption (TQt v3+)</Title> +<Para> +<Literal>TQStyleOption</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQStyleOption +{ +%TypeHeaderCode +#define ENABLE_TQSTYLECONTROLELEMENTDATA_SLOW_COPY 1 +#include <tqstyle.h> +%End + +public: + enum StyleOptionDefault { + Default + }; + + TQStyleOption(StyleOptionDefault /Constrained/ = Default); + + TQStyleOption(int); + TQStyleOption(int,int); + TQStyleOption(int,int,int,int); + TQStyleOption(TQMenuItem *); + TQStyleOption(TQMenuItem *,int); + TQStyleOption(TQMenuItem *,int,int); + TQStyleOption(const TQColor &); + TQStyleOption(TQTab *); + TQStyleOption(TQListViewItem *); + TQStyleOption(TQCheckListItem *); + TQStyleOption(TQt::ArrowType /Constrained/); + TQStyleOption(const TQRect &); + TQStyleOption(TQWidget *); + + bool isDefault() const; + + int day() const; + + int lineWidth() const; + int midLineWidth() const; + int frameShape() const; + int frameShadow() const; + + int headerSection() const; + TQMenuItem* menuItem() const; + int maxIconWidth() const; + int tabWidth() const; + + const TQColor& color() const; + + TQTab *tab() const; + + TQCheckListItem *checkListItem() const; + TQListViewItem *listViewItem() const; + + TQt::ArrowType arrowType() const; + TQRect rect() const; + TQWidget *widget() const; +}; + + +// Not yet defined in TQt v3Beta5. +class TQStyleHintReturn; + +typedef TQMap<TQ_UINT32, TQSize> DialogButtonSizeMap; +typedef TQMap<TQ_INT32, TQ_INT32> TabIdentifierIndexMap; + +class TQStyleControlElementPopupMenuData; + +class TQStyleControlElementCheckListItemData; + +class TQStyleControlElementTabBarData; + +class TQStyleControlElementListViewData; + +class TQStyleControlElementSpinWidgetData; + +class TQStyleControlElementTitleBarData; + +class TQStyleControlElementDockWidgetData; + +class TQStyleControlElementGenericWidgetData; + +class TQStyleControlElementData; + +class TQStyleWidgetActionRequestData +{ +%TypeHeaderCode +#define ENABLE_TQSTYLECONTROLELEMENTDATA_SLOW_COPY 1 +#include <tqstyle.h> +%End + +public: + TQStyleWidgetActionRequestData(); + TQStyleWidgetActionRequestData(int, int = 0); + TQStyleWidgetActionRequestData(TQPalette, bool = FALSE, const char* = 0); + TQStyleWidgetActionRequestData(TQFont, bool = FALSE, const char* = 0); + TQStyleWidgetActionRequestData(TQRect); + ~TQStyleWidgetActionRequestData(); +}; + +typedef TQStyleWidgetActionRequestData TQStyleApplicationActionRequestData; + +class TQStyle : TQObject +{ +%TypeHeaderCode +#define ENABLE_TQSTYLECONTROLELEMENTDATA_SLOW_COPY 1 +#include <tqstyle.h> +%End + +public: + TQStyle(); + + enum ControlElementFlags { + CEF_None = 0x00000000, + CEF_IsDefault = 0x00000001, + CEF_AutoDefault = 0x00000002, + CEF_IsActive = 0x00000004, + CEF_IsDown = 0x00000008, + CEF_IsOn = 0x00000010, + CEF_IsEnabled = 0x00000020, + CEF_BiState = 0x00000040, + CEF_HasFocus = 0x00000080, + CEF_IsMenuWidget = 0x00000100, + CEF_IsContainerEmpty = 0x00000200, + CEF_CenterIndicator = 0x00000400, + CEF_IndicatorFollowsStyle = 0x00000800, + CEF_UsesTextLabel = 0x00001000, + CEF_UsesBigPixmap = 0x00002000, + CEF_UseGenericParameters = 0x00004000, + CEF_HasParentWidget = 0x00008000, + CEF_HasPopupMenu = 0x00010000, + CEF_IsCheckable = 0x00020000, + CEF_HasFocusProxy = 0x00040000, + CEF_IsEditable = 0x00080000, + CEF_IsFlat = 0x00100000, + CEF_IsActiveWindow = 0x00200000, + CEF_IsTopLevel = 0x00400000, + CEF_IsVisible = 0x00800000 + }; + + virtual void polish(TQWidget *); + virtual void polish(const TQStyleControlElementData &ceData, ControlElementFlags, void *); + + virtual void unPolish(TQWidget *); + virtual void unPolish(const TQStyleControlElementData &ceData, ControlElementFlags, void *); + + virtual void polish(TQApplication *); + virtual void applicationPolish(const TQStyleControlElementData&, ControlElementFlags, void *); + + virtual void unPolish(TQApplication *); + virtual void applicationUnPolish(const TQStyleControlElementData&, ControlElementFlags, void *); + + virtual void polish(TQPalette &); + + virtual void polishPopupMenu(TQPopupMenu *) = 0; + virtual void polishPopupMenu(const TQStyleControlElementData&, ControlElementFlags, void *) = 0; + + virtual TQRect itemRect(TQPainter *,const TQRect &,int,bool, + const TQPixmap *,const TQString &,int = -1) const; + + virtual void drawItem(TQPainter *,const TQRect &,int,const TQColorGroup &, + bool,const TQPixmap *,const TQString &,int = -1, + const TQColor * = 0) const; + + enum PrimitiveElement { + PE_ButtonCommand, + PE_ButtonDefault, + PE_ButtonBevel, + PE_ButtonTool, + PE_ButtonDropDown, + + PE_FocusRect, + + PE_ArrowUp, + PE_ArrowDown, + PE_ArrowRight, + PE_ArrowLeft, + + PE_SpinWidgetUp, + PE_SpinWidgetDown, + PE_SpinWidgetPlus, + PE_SpinWidgetMinus, + + PE_Indicator, + PE_IndicatorMask, + PE_ExclusiveIndicator, + PE_ExclusiveIndicatorMask, + + PE_DockWindowHandle, + PE_DockWindowSeparator, + PE_DockWindowResizeHandle, + + PE_Splitter, + + PE_Panel, + PE_PanelPopup, + PE_PanelMenuBar, + PE_PanelDockWindow, + + PE_TabBarBase, + + PE_HeaderSection, + PE_HeaderArrow, + PE_StatusBarSection, + + PE_GroupBoxFrame, + + PE_Separator, + + PE_SizeGrip, + + PE_CheckMark, + + PE_ScrollBarAddLine, + PE_ScrollBarSubLine, + PE_ScrollBarAddPage, + PE_ScrollBarSubPage, + PE_ScrollBarSlider, + PE_ScrollBarFirst, + PE_ScrollBarLast, + + PE_ProgressBarChunk, + + PE_PanelLineEdit, + PE_PanelTabWidget, + + PE_WindowFrame, + PE_CheckListController, + PE_CheckListIndicator, + PE_CheckListExclusiveIndicator, + + PE_PanelGroupBox, + PE_RubberBand, + + PE_CustomBase + }; + + enum StyleFlags { + Style_Default, + Style_Enabled, + Style_Raised, + Style_Sunken, + Style_Off, + Style_NoChange, + Style_On, + Style_Down, + Style_Horizontal, + Style_HasFocus, + Style_Top, + Style_Bottom, + Style_FocusAtBorder, + Style_AutoRaise, + Style_MouseOver, + Style_Up, + Style_Selected, + Style_Active, + Style_ButtonDefault + }; + + typedef uint SFlags; + + virtual void drawPrimitive(PrimitiveElement,TQPainter *,const TQRect &, + const TQColorGroup &,SFlags = Style_Default, + const TQStyleOption & = TQStyleOption()) const = 0; + + enum ControlElement { + CE_PushButton, + CE_PushButtonLabel, + + CE_CheckBox, + CE_CheckBoxLabel, + + CE_RadioButton, + CE_RadioButtonLabel, + + CE_TabBarTab, + CE_TabBarLabel, + + CE_ProgressBarGroove, + CE_ProgressBarContents, + CE_ProgressBarLabel, + + CE_PopupMenuItem, + CE_MenuBarItem, + + CE_ToolButtonLabel, + CE_MenuBarEmptyArea, + CE_PopupMenuScroller, + CE_DockWindowEmptyArea, + CE_PopupMenuVerticalExtra, + CE_PopupMenuHorizontalExtra, + + CE_ToolBoxTab, + CE_HeaderLabel, + + CE_CustomBase + }; + + virtual void drawControl(ControlElement,TQPainter *,const TQWidget *, + const TQRect &,const TQColorGroup &, + SFlags = Style_Default, + const TQStyleOption & = TQStyleOption()) const = 0; + virtual void drawControlMask(ControlElement,TQPainter *,const TQWidget *, + const TQRect &, + const TQStyleOption & = TQStyleOption()) const = 0; + + enum SubRect { + SR_PushButtonContents, + SR_PushButtonFocusRect, + + SR_CheckBoxIndicator, + SR_CheckBoxContents, + SR_CheckBoxFocusRect, + + SR_RadioButtonIndicator, + SR_RadioButtonContents, + SR_RadioButtonFocusRect, + + SR_ComboBoxFocusRect, + + SR_SliderFocusRect, + + SR_DockWindowHandleRect, + + SR_ProgressBarGroove, + SR_ProgressBarContents, + SR_ProgressBarLabel, + + SR_ToolButtonContents, + + SR_DialogButtonAccept, + SR_DialogButtonReject, + SR_DialogButtonApply, + SR_DialogButtonHelp, + SR_DialogButtonAll, + SR_DialogButtonAbort, + SR_DialogButtonIgnore, + SR_DialogButtonRetry, + SR_DialogButtonCustom, + + SR_ToolBoxTabContents, + + SR_CustomBase + }; + + virtual TQRect subRect(SubRect,const TQWidget *) const = 0; + + enum ComplexControl{ + CC_SpinWidget, + CC_ComboBox, + CC_ScrollBar, + CC_Slider, + CC_ToolButton, + CC_TitleBar, + CC_ListView, + + CC_CustomBase + }; + + enum SubControl { + SC_None, + + SC_ScrollBarAddLine, + SC_ScrollBarSubLine, + SC_ScrollBarAddPage, + SC_ScrollBarSubPage, + SC_ScrollBarFirst, + SC_ScrollBarLast, + SC_ScrollBarSlider, + SC_ScrollBarGroove, + + SC_SpinWidgetUp, + SC_SpinWidgetDown, + SC_SpinWidgetFrame, + SC_SpinWidgetEditField, + SC_SpinWidgetButtonField, + + SC_ComboBoxFrame, + SC_ComboBoxEditField, + SC_ComboBoxArrow, + SC_ComboBoxListBoxPopup, + + SC_SliderGroove, + SC_SliderHandle, + SC_SliderTickmarks, + + SC_ToolButton, + SC_ToolButtonMenu, + + SC_TitleBarLabel, + SC_TitleBarSysMenu, + SC_TitleBarMinButton, + SC_TitleBarMaxButton, + SC_TitleBarCloseButton, + SC_TitleBarNormalButton, + SC_TitleBarShadeButton, + SC_TitleBarUnshadeButton, + + SC_ListView, + SC_ListViewBranch, + SC_ListViewExpand, + + SC_All + }; + + typedef uint SCFlags; + + virtual void drawComplexControl(ComplexControl,TQPainter *, + const TQWidget *,const TQRect &, + const TQColorGroup &, + SFlags = Style_Default, + SCFlags = SC_All,SCFlags = SC_None, + const TQStyleOption & = TQStyleOption()) const = 0; + virtual void drawComplexControlMask(ComplexControl,TQPainter *, + const TQWidget *,const TQRect &, + const TQStyleOption & = TQStyleOption()) const = 0; + + virtual TQRect querySubControlMetrics(ComplexControl, + const TQWidget *,SubControl, + const TQStyleOption & = TQStyleOption()) const = 0; + virtual SubControl querySubControl(ComplexControl,const TQWidget *, + const TQPoint &, + const TQStyleOption & = TQStyleOption()) const = 0; + + enum PixelMetric { + PM_ButtonMargin, + PM_ButtonDefaultIndicator, + PM_MenuButtonIndicator, + PM_ButtonShiftHorizontal, + PM_ButtonShiftVertical, + + PM_DefaultFrameWidth, + PM_SpinBoxFrameWidth, + + PM_MaximumDragDistance, + + PM_ScrollBarExtent, + PM_ScrollBarSliderMin, + + PM_SliderThickness, + PM_SliderControlThickness, + PM_SliderLength, + PM_SliderTickmarkOffset, + PM_SliderSpaceAvailable, + + PM_DockWindowSeparatorExtent, + PM_DockWindowHandleExtent, + PM_DockWindowFrameWidth, + + PM_MenuBarFrameWidth, + + PM_TabBarTabOverlap, + PM_TabBarTabHSpace, + PM_TabBarTabVSpace, + PM_TabBarBaseHeight, + PM_TabBarBaseOverlap, + + PM_ProgressBarChunkWidth, + + PM_SplitterWidth, + PM_TitleBarHeight, + + PM_IndicatorWidth, + PM_IndicatorHeight, + PM_ExclusiveIndicatorWidth, + PM_ExclusiveIndicatorHeight, + PM_PopupMenuScrollerHeight, + PM_CheckListButtonSize, + PM_CheckListControllerSize, + PM_PopupMenuFrameHorizontalExtra, + PM_PopupMenuFrameVerticalExtra, + + PM_DialogButtonsSeparator, + PM_DialogButtonsButtonWidth, + PM_DialogButtonsButtonHeight, + + PM_MDIFrameWidth, + PM_MDIMinimizedWidth, + PM_HeaderMargin, + PM_HeaderMarkSize, + PM_HeaderGripMargin, + PM_TabBarTabShiftHorizontal, + PM_TabBarTabShiftVertical, + PM_TabBarScrollButtonWidth, + + PM_MenuBarItemSpacing, + PM_ToolBarItemSpacing, + + PM_CustomBase + }; + + virtual int pixelMetric(PixelMetric,const TQWidget * = 0) const = 0; + + enum ContentsType { + CT_PushButton, + CT_CheckBox, + CT_RadioButton, + CT_ToolButton, + CT_ComboBox, + CT_Splitter, + CT_DockWindow, + CT_ProgressBar, + CT_PopupMenuItem, + CT_TabBarTab, + CT_Slider, + CT_Header, + CT_LineEdit, + CT_MenuBar, + CT_SpinBox, + CT_SizeGrip, + CT_TabWidget, + CT_DialogButtons, + + CT_CustomBase + }; + + virtual TQSize sizeFromContents(ContentsType,const TQWidget *, + const TQSize &, + const TQStyleOption & = TQStyleOption()) const = 0; + + enum StyleHint { + SH_EtchDisabledText, + + SH_GUIStyle, + + SH_ScrollBar_BackgroundMode, + SH_ScrollBar_MiddleClickAbsolutePosition, + SH_ScrollBar_ScrollWhenPointerLeavesControl, + + SH_TabBar_SelectMouseType, + + SH_TabBar_Alignment, + + SH_Header_ArrowAlignment, + + SH_Slider_SnapToValue, + + SH_Slider_SloppyKeyEvents, + + SH_ProgressDialog_CenterCancelButton, + + SH_ProgressDialog_TextLabelAlignment, + + SH_PrintDialog_RightAlignButtons, + + SH_MainWindow_SpaceBelowMenuBar, + + SH_FontDialog_SelectAssociatedText, + + SH_PopupMenu_AllowActiveAndDisabled, + + SH_PopupMenu_SpaceActivatesItem, + + SH_PopupMenu_SubMenuPopupDelay, + + SH_ScrollView_FrameOnlyAroundContents, + + SH_MenuBar_AltKeyNavigation, + + SH_ComboBox_ListMouseTracking, + + SH_PopupMenu_MouseTracking, + + SH_MenuBar_MouseTracking, + + SH_ItemView_ChangeHighlightOnFocus, + + SH_Widget_ShareActivation, + + SH_Workspace_FillSpaceOnMaximize, + + SH_ComboBox_Popup, + + SH_TitleBar_NoBorder, + + SH_ScrollBar_StopMouseOverSlider, + + SH_BlinkCursorWhenTextSelected, + + SH_RichText_FullWidthSelection, + + SH_PopupMenu_Scrollable, + + SH_GroupBox_TextLabelVerticalAlignment, + + SH_GroupBox_TextLabelColor, + + SH_PopupMenu_SloppySubMenus, + + SH_Table_GridLineColor, + + SH_LineEdit_PasswordCharacter, + + SH_DialogButtons_DefaultButton, + + SH_ToolBox_SelectedPageTitleBold, + + SH_TabBar_PreferNoArrows, + + SH_ScrollBar_LeftClickAbsolutePosition, + + SH_ListViewExpand_SelectMouseType, + + SH_UnderlineAccelerator, + + SH_ToolButton_Uses3D, + + SH_CustomBase + }; + + virtual int styleHint(StyleHint,const TQWidget * = 0, + const TQStyleOption & = TQStyleOption(), + TQStyleHintReturn * = 0) const = 0; + + enum StylePixmap { + SP_TitleBarMinButton, + SP_TitleBarMaxButton, + SP_TitleBarCloseButton, + SP_TitleBarNormalButton, + SP_TitleBarShadeButton, + SP_TitleBarUnshadeButton, + SP_DockWindowCloseButton, + SP_MessageBoxInformation, + SP_MessageBoxWarning, + SP_MessageBoxCritical, + SP_MessageBoxQuestion, + + SP_CustomBase + }; + + virtual TQPixmap stylePixmap(StylePixmap,const TQWidget * = 0, + const TQStyleOption & = TQStyleOption()) const = 0; + + static TQRect visualRect(const TQRect &,const TQWidget *); + + static TQRect visualRect(const TQRect &,const TQRect &); + + // New API + virtual void drawPrimitive( PrimitiveElement, + TQPainter*, + const TQStyleControlElementData&, + ControlElementFlags, + const TQRect&, + const TQColorGroup&, + SFlags = Style_Default, + const TQStyleOption& = TQStyleOption::Default ) const = 0; + + virtual void drawControl( ControlElement element, + TQPainter*, + const TQStyleControlElementData&, + ControlElementFlags, + const TQRect&, + const TQColorGroup&, + SFlags how = Style_Default, + const TQStyleOption& = TQStyleOption::Default, + const TQWidget* = 0 /* compat, will likely go away */ ) const = 0; + + virtual void drawControlMask( ControlElement element, + TQPainter*, + const TQStyleControlElementData&, + ControlElementFlags, + const TQRect&, + const TQStyleOption& = TQStyleOption::Default, + const TQWidget* = 0 /* compat, will likely go away */ ) const = 0; + + virtual TQRect subRect( SubRect, const TQStyleControlElementData&, const ControlElementFlags, const TQWidget* ) const = 0; + + virtual void drawComplexControl( ComplexControl, + TQPainter*, + const TQStyleControlElementData&, + ControlElementFlags, + const TQRect&, + const TQColorGroup&, + SFlags = Style_Default, + SCFlags = SC_All, + SCFlags = SC_None, + const TQStyleOption& = TQStyleOption::Default, + const TQWidget* = 0 ) const = 0; + + virtual void drawComplexControlMask( ComplexControl, + TQPainter*, + const TQStyleControlElementData&, + const ControlElementFlags, + const TQRect&, + const TQStyleOption& = TQStyleOption::Default, + const TQWidget* = 0 ) const = 0; + + virtual TQRect querySubControlMetrics( ComplexControl, + const TQStyleControlElementData&, + ControlElementFlags, + SubControl, + const TQStyleOption& = TQStyleOption::Default, + const TQWidget* = 0 ) const = 0; + + virtual SubControl querySubControl( ComplexControl, + const TQStyleControlElementData&, + ControlElementFlags, + const TQPoint&, + const TQStyleOption& = TQStyleOption::Default, + const TQWidget* = 0 ) const = 0; + + virtual int pixelMetric( PixelMetric, + const TQStyleControlElementData&, + ControlElementFlags, + const TQWidget* = 0 ) const = 0; + + virtual TQSize sizeFromContents( ContentsType, + const TQStyleControlElementData&, + ControlElementFlags, + const TQSize&, + const TQStyleOption& = TQStyleOption::Default, + const TQWidget* = 0 ) const = 0; + + virtual int styleHint( StyleHint, + const TQStyleControlElementData&, + ControlElementFlags, + const TQStyleOption& = TQStyleOption::Default, + TQStyleHintReturn* returnData = 0, + const TQWidget* = 0 + ) const = 0; + + virtual TQPixmap stylePixmap( StylePixmap, + const TQStyleControlElementData&, + ControlElementFlags, + const TQStyleOption& = TQStyleOption::Default, + const TQWidget* = 0 ) const = 0; + + static TQRect visualRect( const TQRect&, const TQStyleControlElementData&, const ControlElementFlags ); + + typedef TQMap<void*, TQStyle*> ObjectEventSourceToHandlerMap; + typedef TQMap<void*, TQStyleControlElementData> ObjectEventSourceDataToHandlerMap; + typedef TQMap<void*, ControlElementFlags> ObjectEventSourceFlagsToHandlerMap; + typedef bool (*EventHandlerInstallationHook)(const TQStyleControlElementData&, ControlElementFlags, void*, TQStyle*); + typedef bool (*EventHandlerRemovalHook)(const TQStyleControlElementData&, ControlElementFlags, void*, TQStyle*); + void installObjectEventHandler( const TQStyleControlElementData&, ControlElementFlags, void*, TQStyle* ); + void removeObjectEventHandler( const TQStyleControlElementData&, ControlElementFlags, void*, TQStyle* ); + //void setEventHandlerInstallationHook( EventHandlerInstallationHook ); + //void setEventHandlerRemovalHook( EventHandlerRemovalHook hook ); + virtual bool objectEventHandler( const TQStyleControlElementData&, ControlElementFlags, void*, TQEvent * ); + + enum WidgetActionRequest { + WAR_Repaint, + WAR_RepaintRect, + WAR_EnableMouseTracking, + WAR_DisableMouseTracking, + WAR_SetAutoMask, + WAR_UnSetAutoMask, + WAR_SetCheckable, + WAR_UnSetCheckable, + WAR_FrameSetStyle, + WAR_FrameSetLineWidth, + WAR_SetLayoutMargin, + WAR_SetPalette, + WAR_SetBackgroundMode, + WAR_SetBackgroundOrigin, + WAR_SetFont, + WAR_RepaintAllAccelerators + }; + + typedef bool (*WidgetActionRequestHook)(const TQStyleControlElementData&, ControlElementFlags, void*, WidgetActionRequest, TQStyleWidgetActionRequestData); + //void setWidgetActionRequestHook( WidgetActionRequestHook ); + virtual bool widgetActionRequest( const TQStyleControlElementData&, ControlElementFlags, void*, WidgetActionRequest, TQStyleWidgetActionRequestData = TQStyleWidgetActionRequestData() ); + + enum ApplicationActionRequest { + AAR_SetPalette, + AAR_SetFont + }; + + typedef bool (*ApplicationActionRequestHook)(const TQStyleControlElementData&, ControlElementFlags, void*, ApplicationActionRequest, TQStyleApplicationActionRequestData); + //void setApplicationActionRequestHook( ApplicationActionRequestHook ); + virtual bool applicationActionRequest( const TQStyleControlElementData&, ControlElementFlags, void*, ApplicationActionRequest, TQStyleApplicationActionRequestData = TQStyleApplicationActionRequestData() ); + +private: + TQStyle(const TQStyle &); +}; diff --git a/sip/tqt/tqstylefactory.sip b/sip/tqt/tqstylefactory.sip new file mode 100644 index 0000000..5e1bd1c --- /dev/null +++ b/sip/tqt/tqstylefactory.sip @@ -0,0 +1,41 @@ +// This is the SIP interface definition for TQStyleFactory. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQStyleFactory (TQt v3+)</Title> +<Para> +<Literal>TQStyleFactory</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQStyleFactory +{ +%TypeHeaderCode +#include <tqstylefactory.h> +%End + +public: + static TQStringList keys(); + static TQStyle *create(const TQString &) /Factory/; +}; diff --git a/sip/tqt/tqstylesheet.sip b/sip/tqt/tqstylesheet.sip new file mode 100644 index 0000000..8f1d546 --- /dev/null +++ b/sip/tqt/tqstylesheet.sip @@ -0,0 +1,194 @@ +// This is the SIP interface definition for TQStyleSheet and TQStyleSheetItem. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQStyleSheet (TQt v2+)</Title> +<Para> +<Literal>TQStyleSheet</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQStyleSheetItem (TQt v2+)</Title> +<Para> +<Literal>TQStyleSheetItem</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQStyleSheetItem : TQt +{ +%TypeHeaderCode +#include <tqstylesheet.h> +%End + +public: + TQStyleSheetItem(TQStyleSheet * /TransferThis/,const TQString &); + + TQString name() const; + + TQStyleSheet *styleSheet(); +// const TQStyleSheet *styleSheet() const; + + enum AdditionalStyleValues { + Undefined + }; + + enum DisplayMode { + DisplayBlock, + DisplayInline, + DisplayListItem, + DisplayNone + }; + + DisplayMode displayMode() const; + void setDisplayMode(DisplayMode); + + int alignment() const; + void setAlignment(int); + + enum VerticalAlignment { + VAlignBaseline, + VAlignSub, + VAlignSuper + }; + + VerticalAlignment verticalAlignment() const; + void setVerticalAlignment(VerticalAlignment); + + int fontWeight() const; + void setFontWeight(int); + + int logicalFontSize() const; + void setLogicalFontSize(int); + + int logicalFontSizeStep() const; + void setLogicalFontSizeStep(int); + + int fontSize() const; + void setFontSize(int); + + TQString fontFamily() const; + void setFontFamily(const TQString &); + + int numberOfColumns() const; + void setNumberOfColumns(int); + + TQColor color() const; + void setColor(const TQColor &); + + bool fontItalic() const; + void setFontItalic(bool); + bool definesFontItalic() const; + + bool fontUnderline() const; + void setFontUnderline(bool); + bool definesFontUnderline() const; + + bool fontStrikeOut() const; + void setFontStrikeOut(bool); + bool definesFontStrikeOut() const; + + bool isAnchor() const; + void setAnchor(bool); + + enum WhiteSpaceMode { + WhiteSpaceNormal, + WhiteSpacePre, + WhiteSpaceNoWrap + }; + + WhiteSpaceMode whiteSpaceMode() const; + void setWhiteSpaceMode(WhiteSpaceMode); + + enum Margin { + MarginLeft, + MarginRight, + MarginTop, + MarginBottom, + MarginFirstLine, + MarginAll, + MarginVertical, + MarginHorizontal + }; + + int margin(Margin) const; + void setMargin(Margin,int); + + enum ListStyle { + ListDisc, + ListCircle, + ListSquare, + ListDecimal, + ListLowerAlpha, + ListUpperAlpha + }; + + ListStyle listStyle() const; + void setListStyle(ListStyle); + + TQString contexts() const; + void setContexts(const TQString &); + bool allowedInContext(const TQStyleSheetItem *) const; + + bool selfNesting() const; + void setSelfNesting(bool); + + void setLineSpacing(int); + int lineSpacing() const; +}; + + +class TQStyleSheet : TQObject +{ +%TypeHeaderCode +#include <tqstylesheet.h> +%End + +public: + TQStyleSheet(TQObject * /TransferThis/ = 0,const char * = 0); + + static TQStyleSheet *defaultSheet(); + static void setDefaultSheet(TQStyleSheet *); + + TQStyleSheetItem *item(const TQString &); +// const TQStyleSheetItem *item(const TQString &) const; + + void insert(TQStyleSheetItem *); + +// virtual TQTextCustomItem *tag(const TQString &, +// const TQMap<TQString,TQString> &, +// const TQString &, +// const TQMimeSourceFactory &,bool, +// TQTextDocument *) const; + + static TQString escape(const TQString &); + static TQString convertFromPlainText(const TQString &, + TQStyleSheetItem::WhiteSpaceMode = TQStyleSheetItem::WhiteSpacePre); + static bool mightBeRichText(const TQString &); + + virtual void scaleFont(TQFont &,int) const; + virtual void error(const TQString &) const; + +private: + TQStyleSheet(const TQStyleSheet &); +}; diff --git a/sip/tqt/tqsyntaxhighlighter.sip b/sip/tqt/tqsyntaxhighlighter.sip new file mode 100644 index 0000000..c07cd0c --- /dev/null +++ b/sip/tqt/tqsyntaxhighlighter.sip @@ -0,0 +1,51 @@ +// This is the SIP interface definition for TQSyntaxHighlighter. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQSyntaxHighlighter (TQt v3.1+)</Title> +<Para> +<Literal>TQSyntaxHighlighter</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQSyntaxHighlighter : TQt +{ +%TypeHeaderCode +#include <tqsyntaxhighlighter.h> +%End + +public: + TQSyntaxHighlighter(TQTextEdit * /TransferThis/); + + virtual int highlightParagraph(const TQString &,int) = 0; + + void setFormat(int,int,const TQFont &,const TQColor &); + void setFormat(int,int,const TQColor &); + void setFormat(int,int,const TQFont &); + TQTextEdit *textEdit() const; + + void rehighlight(); + + int currentParagraph() const; +}; diff --git a/sip/tqt/tqtabbar.sip b/sip/tqt/tqtabbar.sip new file mode 100644 index 0000000..10e886d --- /dev/null +++ b/sip/tqt/tqtabbar.sip @@ -0,0 +1,180 @@ +// This is the SIP interface definition for TQTab and TQTabBar. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQTab</Title> +<Para> +<Literal>TQTab</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQTabBar</Title> +<FuncSynopsis> + <FuncDef>TQPtrList<TQTab> <Function>tabList</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This returns a list of <Literal>TQTab</Literal> instances. +</Para> +</Sect2> +%End + + +class TQTab : TQt +{ +%TypeHeaderCode +#include <tqtabbar.h> +%End + +public: + TQTab(); + TQTab(const TQString &); + TQTab(const TQIconSet &,const TQString & = TQString::null); + virtual ~TQTab(); + + void setText(const TQString &); + TQString text() const; + void setIconSet(const TQIconSet &); + TQIconSet *iconSet() const; + void setRect(const TQRect &); + TQRect rect() const; + void setEnabled(bool); + bool isEnabled() const; + void setIdentifier(int); + int identifier() const; +}; + +class TQTabBar : TQWidget +{ +%TypeHeaderCode +#include <tqtabbar.h> +%End + +public: + TQTabBar(TQWidget * /TransferThis/ = 0,const char * = 0); + + enum Shape { + RoundedAbove, + RoundedBelow, + TriangularAbove, + TriangularBelow + }; + + Shape shape() const; + virtual void setShape(Shape); + + void show(); + + virtual int addTab(TQTab * /Transfer/); + virtual int insertTab(TQTab * /Transfer/,int = -1); + virtual void removeTab(TQTab *); + + virtual void setTabEnabled(int,bool); + bool isTabEnabled(int) const; + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + TQSizePolicy sizePolicy() const; + + int currentTab() const; + int keyboardFocusTab() const; + + TQTab *tab(int) const; + TQTab *tabAt(int) const; + int indexOf(int) const; + int count() const; + + virtual void layoutTabs(); + virtual TQTab *selectTab(const TQPoint &) const; + + void removeToolTip(int); + void setToolTip(int,const TQString &); + TQString toolTip(int) const; + +public slots: + virtual void setCurrentTab(int); + virtual void setCurrentTab(TQTab *); + +signals: + void selected(int); + void layoutChanged(); + +protected: + virtual void paint(TQPainter *,TQTab *,bool) const; + virtual void paintLabel(TQPainter *,const TQRect &,TQTab *,bool) const; + + void focusInEvent(TQFocusEvent *); + void focusOutEvent(TQFocusEvent *); + + void resizeEvent(TQResizeEvent *); + void paintEvent(TQPaintEvent *); + void mousePressEvent(TQMouseEvent *); + void mouseMoveEvent(TQMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); + void keyPressEvent(TQKeyEvent *); + void styleChange(TQStyle &); + void fontChange(const TQFont &); + + bool event(TQEvent *); + + SIP_PYLIST tabList() [TQPtrList<TQTab> *()]; +%MethodCode + if ((sipRes = PyList_New(0)) == NULL) + sipIsErr = 1; + else + { + TQPtrList<TQTab> *tl; + TQTab *tab; + + Py_BEGIN_ALLOW_THREADS + tl = sipCpp -> sipProtect_tabList(); + Py_END_ALLOW_THREADS + + // Convert the list. + for (TQPtrListIterator<TQTab> it(*tl); (tab = it.current()) != NULL; ++it) + { + PyObject *inst = sipBuildResult(&sipIsErr,"C",tab,sipClass_TQTab,NULL); + + if (sipIsErr) + break; + + int rc = PyList_Append(sipRes,inst); + + Py_DECREF(inst); + + if (rc < 0) + { + sipIsErr = 1; + break; + } + } + + if (sipIsErr) + { + Py_DECREF(sipRes); + } + } +%End + +private: + TQTabBar(const TQTabBar &); +}; diff --git a/sip/tqt/tqtabdialog.sip b/sip/tqt/tqtabdialog.sip new file mode 100644 index 0000000..0cfe69a --- /dev/null +++ b/sip/tqt/tqtabdialog.sip @@ -0,0 +1,108 @@ +// This is the SIP interface definition for TQTabDialog. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQTabDialog</Title> +<Para> +<Literal>TQTabDialog</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_TABDIALOG) + +class TQTabDialog : TQDialog +{ +%TypeHeaderCode +#include <tqtabdialog.h> +%End + +public: + TQTabDialog(TQWidget * /TransferThis/ = 0,const char * = 0,bool = 0, + WFlags = 0); + + void show(); + void setFont(const TQFont &); + + void addTab(TQWidget *,const TQString &); + void addTab(TQWidget *,const TQIconSet &,const TQString &); + void addTab(TQWidget *,TQTab *); + + void insertTab(TQWidget *,const TQString &,int = -1); + void insertTab(TQWidget *,const TQIconSet &,const TQString &,int = -1); + void insertTab(TQWidget *,TQTab *,int = -1); + + void changeTab(TQWidget *,const TQString &); + void changeTab(TQWidget *,const TQIconSet &,const TQString &); + + bool isTabEnabled(TQWidget *) const; + void setTabEnabled(TQWidget *,bool); + + void showPage(TQWidget *); + void removePage(TQWidget *); + TQString tabLabel(TQWidget *); + + TQWidget *currentPage() const; + + void setDefaultButton(const TQString &); + void setDefaultButton(); + bool hasDefaultButton() const; + + void setHelpButton(const TQString &); + void setHelpButton(); + bool hasHelpButton() const; + + void setCancelButton(const TQString &); + void setCancelButton(); + bool hasCancelButton() const; + + void setApplyButton(const TQString &); + void setApplyButton(); + bool hasApplyButton() const; + + void setOkButton(const TQString &); + void setOkButton(); + bool hasOkButton() const; + +protected: + void paintEvent(TQPaintEvent *); + void resizeEvent(TQResizeEvent *); + void styleChange(TQStyle &); + void setTabBar(TQTabBar *); + TQTabBar *tabBar() const; + +signals: + void aboutToShow(); + + void applyButtonPressed(); + void cancelButtonPressed(); + void defaultButtonPressed(); + void helpButtonPressed(); + + void currentChanged(TQWidget *); + +private: + TQTabDialog(const TQTabDialog &); +}; + +%End diff --git a/sip/tqt/tqtabwidget.sip b/sip/tqt/tqtabwidget.sip new file mode 100644 index 0000000..9435402 --- /dev/null +++ b/sip/tqt/tqtabwidget.sip @@ -0,0 +1,120 @@ +// This is the SIP interface definition for TQTabWidget. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQTabWidget (TQt v2+)</Title> +<Para> +<Literal>TQTabWidget</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQTabWidget : TQWidget +{ +%TypeHeaderCode +#include <tqtabwidget.h> +%End + +public: + TQTabWidget(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + // The TQWidget is passed to TQWidgetStack::addWidget(). + virtual void addTab(TQWidget * /Transfer/,const TQString &); + virtual void addTab(TQWidget * /Transfer/,const TQIconSet &, + const TQString &); + virtual void addTab(TQWidget * /Transfer/,TQTab *); + + virtual void insertTab(TQWidget * /Transfer/,const TQString &,int = -1); + virtual void insertTab(TQWidget * /Transfer/,const TQIconSet &, + const TQString &,int = -1); + virtual void insertTab(TQWidget * /Transfer/,TQTab *,int = -1); + + void changeTab(TQWidget *,const TQString &); + void changeTab(TQWidget *,const TQIconSet &,const TQString &); + + bool isTabEnabled(TQWidget *) const; + void setTabEnabled(TQWidget *,bool); + + void setCornerWidget(TQWidget *,TQt::Corner = TQt::TopRight); + TQWidget *cornerWidget(TQt::Corner = TQt::TopRight) const; + + TQString tabLabel(TQWidget *) const; + void setTabLabel(TQWidget *,const TQString &); + + TQIconSet tabIconSet(TQWidget *) const; + void setTabIconSet(TQWidget *,const TQIconSet &); + + void removeTabToolTip(TQWidget *); + void setTabToolTip(TQWidget *,const TQString &); + TQString tabToolTip(TQWidget *) const; + + TQWidget *currentPage() const; + TQWidget *page(int) const; + TQString label(int) const; + int currentPageIndex() const; + int indexOf(TQWidget *) const; + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + + enum TabPosition { + Top, + Bottom + }; + + TabPosition tabPosition() const; + void setTabPosition(TabPosition); + + enum TabShape { + Rounded, + Triangular + }; + + TabShape tabShape() const; + void setTabShape(TabShape); + + int margin() const; + void setMargin(int); + + int count() const; + +public slots: + void setCurrentPage(int); + virtual void showPage(TQWidget *); + virtual void removePage(TQWidget *); + +protected: + void showEvent(TQShowEvent *); + void resizeEvent(TQResizeEvent *); + void setTabBar(TQTabBar *); + TQTabBar *tabBar() const; + void styleChange(TQStyle &); + void updateMask(); + bool eventFilter(TQObject *,TQEvent *); + +signals: + void currentChanged(TQWidget *); + +private: + TQTabWidget(const TQTabWidget &); +}; diff --git a/sip/tqt/tqtextbrowser.sip b/sip/tqt/tqtextbrowser.sip new file mode 100644 index 0000000..3b0a11c --- /dev/null +++ b/sip/tqt/tqtextbrowser.sip @@ -0,0 +1,65 @@ +// This is the SIP interface definition for TQTextBrowser. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQTextBrowser (TQt v2+)</Title> +<Para> +<Literal>TQTextBrowser</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQTextBrowser : TQTextEdit +{ +%TypeHeaderCode +#include <tqtextbrowser.h> +%End + +public: + TQTextBrowser(TQWidget * /TransferThis/ = 0,const char * = 0); + + TQString source() const; + +public slots: + virtual void setSource(const TQString &); + virtual void backward(); + virtual void forward(); + virtual void home(); + virtual void reload(); + void setText(const TQString &); + virtual void setText(const TQString &,const TQString &); + +signals: + void backwardAvailable(bool); + void forwardAvailable(bool); + void sourceChanged(const TQString &); + void highlighted(const TQString &); + void linkClicked(const TQString &); + void anchorClicked(const TQString &,const TQString &); + +protected: + void keyPressEvent(TQKeyEvent *); + +private: + TQTextBrowser(const TQTextBrowser &); +}; diff --git a/sip/tqt/tqtextcodec.sip b/sip/tqt/tqtextcodec.sip new file mode 100644 index 0000000..7a18efe --- /dev/null +++ b/sip/tqt/tqtextcodec.sip @@ -0,0 +1,132 @@ +// This is the SIP interface definition for TQTextCodec, TQTextDecoder and +// TQTextEncoder. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQTextCodec (TQt v2+)</Title> +<FuncSynopsis> + <FuncDef>virtual TQCString <Function>fromUnicode</Function></FuncDef> + <ParamDef>const TQString &<Parameter>uc</Parameter></ParamDef> + <ParamDef>int &<Parameter>lenInOut</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The returned value is a tuple of the <Literal>TQCString</Literal> result and the +updated <Literal>lenInOut</Literal>. +</Para> +</Sect2> + +<Sect2><Title>TQTextDecoder (TQt v2+)</Title> +<Para> +<Literal>TQTextDecoder</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQTextEncoder (TQt v2+)</Title> +<FuncSynopsis> + <FuncDef>virtual TQCString <Function>fromUnicode</Function> = 0</FuncDef> + <ParamDef>const TQString &<Parameter>uc</Parameter></ParamDef> + <ParamDef>int &<Parameter>lenInOut</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The returned value is a tuple of the <Literal>TQCString</Literal> result and the +updated <Literal>lenInOut</Literal>. +</Para> +</Sect2> +%End + + +class TQTextEncoder +{ +%TypeHeaderCode +#include <tqtextcodec.h> +%End + +public: + virtual TQCString fromUnicode(const TQString &,int & /In,Out/) = 0; +}; + + +class TQTextDecoder +{ +%TypeHeaderCode +#include <tqtextcodec.h> +%End + +public: + virtual TQString toUnicode(const char *,int) = 0; +}; + + +class TQTextCodec +{ +%TypeHeaderCode +#include <tqtextcodec.h> +%End + +public: +%If (TQt_CODECS) + static TQTextCodec *loadCharmap(TQIODevice *); + static TQTextCodec *loadCharmapFile(TQString); +%End + static TQTextCodec *codecForMib(int); + static TQTextCodec *codecForName(const char *,int = 0); + static TQTextCodec *codecForContent(const char *,int); + static TQTextCodec *codecForIndex(int); + static TQTextCodec *codecForLocale(); + static void setCodecForLocale(TQTextCodec *); + + static TQTextCodec *codecForTr(); + static void setCodecForTr(TQTextCodec *); + static TQTextCodec *codecForCStrings(); + static void setCodecForCStrings(TQTextCodec *); + + static void deleteAllCodecs(); + + static const char *locale(); + + virtual const char *name() const = 0; + virtual const char *mimeName() const; + virtual int mibEnum() const = 0; + + virtual TQTextDecoder *makeDecoder() const /Factory/; + virtual TQTextEncoder *makeEncoder() const /Factory/; + + virtual TQString toUnicode(const char *,int) const; + virtual TQCString fromUnicode(const TQString &,int & /In,Out/) const; + TQCString fromUnicode(const TQString &) const; + TQString toUnicode(const TQByteArray &,int) const; + TQString toUnicode(const TQByteArray &) const; + TQString toUnicode(const TQCString &,int) const; + TQString toUnicode(const TQCString &) const; + TQString toUnicode(const char *) const; + virtual bool canEncode(TQChar) const; + virtual bool canEncode(const TQString &) const; + + virtual int heuristicContentMatch(const char *,int) const = 0; + virtual int heuristicNameMatch(const char *) const; + + virtual TQByteArray fromUnicode(const TQString &,int,int) const; + virtual unsigned short characterFromUnicode(const TQString &,int) const; + +protected: + TQTextCodec(); +}; diff --git a/sip/tqt/tqtextedit.sip b/sip/tqt/tqtextedit.sip new file mode 100644 index 0000000..ef0f80c --- /dev/null +++ b/sip/tqt/tqtextedit.sip @@ -0,0 +1,402 @@ +// This is the SIP interface definition for TQTextEdit. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQTextEdit (TQt v3+)</Title> +<FuncSynopsis> +<FuncDef>int <Function>charAt</Function></FuncDef> + <ParamDef>const TQPoint &<Parameter>pos</Parameter></ParamDef> + <ParamDef>int *<Parameter>para</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>pos</Literal> parameter and returns a tuple of the +value returned via the <Literal>para</Literal> pointer and the int result. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>del</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delChar</Literal> in Python. +</Para> + +<FuncSynopsis> +<FuncDef>virtual bool <Function>find</Function></FuncDef> + <ParamDef>const TQString &<Parameter>expr</Parameter></ParamDef> + <ParamDef>bool <Parameter>cs</Parameter></ParamDef> + <ParamDef>bool <Parameter>wo</Parameter></ParamDef> + <ParamDef>bool <Parameter>forward</Parameter> = TRUE</ParamDef> + <ParamDef>int *<Parameter>para</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>index</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +If the <Literal>para</Literal> and <Literal>index</Literal> parameters are +omitted then the bool result is returned. If both are supplied (as integers) +then a tuple of the bool result and the modified values of +<Literal>para</Literal> and <Literal>index</Literal> is returned. +</Para> + +<FuncSynopsis> +<FuncDef>void <Function>getCursorPosition</Function></FuncDef> + <ParamDef>int *<Parameter>para</Parameter></ParamDef> + <ParamDef>int *<Parameter>index</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the values returned via the +<Literal>para</Literal> and <Literal>index</Literal> pointers. +</Para> + +<FuncSynopsis> +<FuncDef>void <Function>getSelection</Function></FuncDef> + <ParamDef>int *<Parameter>paraFrom</Parameter></ParamDef> + <ParamDef>int *<Parameter>indexFrom</Parameter></ParamDef> + <ParamDef>int *<Parameter>paraTo</Parameter></ParamDef> + <ParamDef>int *<Parameter>indexTo</Parameter></ParamDef> + <ParamDef>int <Parameter>selNum</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>selNum</Literal> parameter and returns a tuple of +the <Literal>paraFrom</Literal>, <Literal>indexFrom</Literal>, +<Literal>paraTo</Literal> and <Literal>indexTo</Literal> values. +</Para> +</Sect2> +%End + + +// These aren't part of the public API in the TQt3 beta, so define them as +// opaque for the moment. + +class TQTextDocument; +class TQTextCursor; + + +class TQTextEdit : TQScrollView +{ +%TypeHeaderCode +#include <tqtextedit.h> +%End + +public: + enum WordWrap { + NoWrap, + WidgetWidth, + FixedPixelWidth, + FixedColumnWidth + }; + + enum WrapPolicy { + AtWordBoundary, + Anywhere, + AtWhiteSpace, + AtWordOrDocumentBoundary + }; + + enum AutoFormatting { + AutoNone, + AutoBulletList, + AutoAll + }; + + enum KeyboardAction { + ActionBackspace, + ActionDelete, + ActionReturn, + ActionKill, + ActionWordBackspace, + ActionWordDelete + }; + + enum CursorAction { + MoveBackward, + MoveForward, + MoveWordBackward, + MoveWordForward, + MoveUp, + MoveDown, + MoveLineStart, + MoveLineEnd, + MoveHome, + MoveEnd, + MovePgUp, + MovePgDown + }; + + enum VerticalAlignment { + AlignNormal, + AlignSuperScript, + AlignSubScript + }; + + enum TextInsertionFlags { + RedoIndentation, + CheckNewLines, + RemoveSelected + }; + + TQTextEdit(const TQString &,const TQString & = TQString::null, + TQWidget * /TransferThis/ = 0,const char * = 0); + TQTextEdit(TQWidget * /TransferThis/ = 0,const char * = 0); + + void setPalette(const TQPalette &); + + TQString text() const; + TQString text(int) const; + TextFormat textFormat() const; + TQString context() const; + TQString documentTitle() const; + + void getSelection(int *,int *,int *,int *,int = 0) const; + + // We implement find() as two separate methods as it's the easiest way + // to handle the somewhat strange TQt interface. + virtual bool find(const TQString &,bool,bool,bool = 1); + virtual bool find(const TQString &,bool,bool,bool,int * /In,Out/, + int * /In,Out/); + + int paragraphs() const; + int lines() const; + int linesOfParagraph(int) const; + int lineOfChar(int,int); + int length() const; + TQRect paragraphRect(int) const; + int paragraphAt(const TQPoint &) const; + + // Note that this is handwritten code because the generated code would + // return the values in the (correct but) reverse order. + SIP_PYTUPLE charAt(const TQPoint &) const; +%MethodCode + int para, index; + + Py_BEGIN_ALLOW_THREADS + index = sipCpp -> TQTextEdit::charAt(*a0,¶); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr,"(ii)",para,index); +%End + + int paragraphLength(int) const; + + TQStyleSheet *styleSheet() const; + TQMimeSourceFactory *mimeSourceFactory() const; + + TQBrush paper() const; + bool linkUnderline() const; + + int heightForWidth(int) const; + + bool hasSelectedText() const; + TQString selectedText() const; + bool isUndoAvailable() const; + bool isRedoAvailable() const; + + WordWrap wordWrap() const; + int wrapColumnOrWidth() const; + WrapPolicy wrapPolicy() const; + + int tabStopWidth() const; + + TQString anchorAt(const TQPoint &); + TQString anchorAt(const TQPoint &,AnchorAttribute); + + TQSize sizeHint() const; + + bool isReadOnly() const; + + void getCursorPosition(int *,int *) const; + + bool isModified() const; + bool italic() const; + bool bold() const; + bool underline() const; + TQString family() const; + int pointSize() const; + TQColor color() const; + TQFont font() const; + TQFont currentFont() const; + int alignment() const; + int undoDepth() const; + + // These are undocumented and marked as "don't use". + //virtual bool getFormat(int,int,TQFont *,TQColor *,VerticalAlignment *); + //virtual bool getParagraphFormat(int,TQFont *,TQColor *, + // VerticalAlignment *,int *, + // TQStyleSheetItem::DisplayMode *, + // TQStyleSheetItem::ListStyle *, + // int *); + + bool isOverwriteMode() const; + TQColor paragraphBackgroundColor(int) const; + + bool isUndoRedoEnabled() const; + bool eventFilter(TQObject *,TQEvent *); + bool tabChangesFocus() const; + + // TQt defines the following as uint rather than int because it uses the + // AutoFormatting enum as a set of flags. Because SIP implements enums + // as a subclass of int they are always signed. AutoAll is defined as + // 0xffffffff which Python converts to -1 and then fails to convert it + // to an unsigned. For the moment we just lie to SIP about the type + // and let the compiler handle it. + void setAutoFormatting(int); + int autoFormatting() const; + TQSyntaxHighlighter *syntaxHighlighter() const; + +public slots: + void setEnabled(bool); + virtual void setMimeSourceFactory(TQMimeSourceFactory *); + virtual void setStyleSheet(TQStyleSheet *); + virtual void scrollToAnchor(const TQString &); + virtual void setPaper(const TQBrush &); + virtual void setLinkUnderline(bool); + + virtual void setWordWrap(WordWrap); + virtual void setWrapColumnOrWidth(int); + virtual void setWrapPolicy(WrapPolicy); + + virtual void copy(); + virtual void append(const TQString &); + + void setText(const TQString &); + virtual void setText(const TQString &,const TQString &); + virtual void setTextFormat(TextFormat); + + virtual void selectAll(bool = 1); + virtual void setTabStopWidth(int); + virtual void zoomIn(int); + virtual void zoomIn(); + virtual void zoomOut(int); + virtual void zoomOut(); + virtual void zoomTo(int); + + virtual void sync(); + virtual void setReadOnly(bool); + + virtual void undo(); + virtual void redo(); + virtual void cut(); + virtual void paste(); + virtual void pasteSubType(const TQCString &); + virtual void clear(); + virtual void del() /PyName=delChar/; + virtual void indent(); + virtual void setItalic(bool); + virtual void setBold(bool); + virtual void setUnderline(bool); + virtual void setFamily(const TQString &); + virtual void setPointSize(int); + virtual void setColor(const TQColor &); + virtual void setFont(const TQFont &); + virtual void setVerticalAlignment(VerticalAlignment); + virtual void setAlignment(int); + virtual void setParagType(TQStyleSheetItem::DisplayMode, + TQStyleSheetItem::ListStyle); + virtual void setCursorPosition(int,int); + virtual void setSelection(int,int,int,int,int = 0); + virtual void setSelectionAttributes(int,const TQColor &,bool); + virtual void setModified(bool); + virtual void resetFormat(); + virtual void setUndoDepth(int); +// Marked as internal in the TQt3 beta. +// virtual void setFormat(TQTextFormat *,int); + virtual void ensureCursorVisible(); + virtual void placeCursor(const TQPoint &,TQTextCursor * = 0); + virtual void moveCursor(CursorAction,bool); + virtual void doKeyboardAction(KeyboardAction); + virtual void removeSelectedText(int = 0); + virtual void removeSelection(int = 0); + virtual void setCurrentFont(const TQFont &); + virtual void setOverwriteMode(bool); + + virtual void scrollToBottom(); + + void insert(const TQString &,uint = CheckNewLines | RemoveSelected); + virtual void insert(const TQString &,bool,bool = 1,bool = 1); + virtual void insertAt(const TQString &,int,int); + virtual void removeParagraph(int); + virtual void insertParagraph(const TQString &,int); + + virtual void setParagraphBackgroundColor(int,const TQColor &); + virtual void clearParagraphBackground(int); + + virtual void setUndoRedoEnabled(bool); + void setTabChangesFocus(bool); + + void polish(); + void setMaxLogLines(int); + int maxLogLines(); + +signals: + void textChanged(); + void selectionChanged(); + void copyAvailable(bool); + void undoAvailable(bool); + void redoAvailable(bool); + void currentFontChanged(const TQFont &); + void currentColorChanged(const TQColor &); + void currentAlignmentChanged(int); + void currentVerticalAlignmentChanged(VerticalAlignment); + void cursorPositionChanged(TQTextCursor *); + void cursorPositionChanged(int,int); + void returnPressed(); + void modificationChanged(bool); + void clicked(int,int); + void doubleClicked(int,int); + +protected: + void repaintChanged(); + void updateStyles(); + void drawContents(TQPainter *,int,int,int,int); + bool event(TQEvent *); + void keyPressEvent(TQKeyEvent *); + void resizeEvent(TQResizeEvent *); + void viewportResizeEvent(TQResizeEvent *); + void contentsMousePressEvent(TQMouseEvent *); + void contentsMouseMoveEvent(TQMouseEvent *); + void contentsMouseReleaseEvent(TQMouseEvent *); + void contentsMouseDoubleClickEvent(TQMouseEvent *); + void contentsWheelEvent(TQWheelEvent *); + void imStartEvent(TQIMEvent *); + void imComposeEvent(TQIMEvent *); + void imEndEvent(TQIMEvent *); + void contentsDragEnterEvent(TQDragEnterEvent *); + void contentsDragMoveEvent(TQDragMoveEvent *); + void contentsDragLeaveEvent(TQDragLeaveEvent *); + void contentsDropEvent(TQDropEvent *); + void contentsContextMenuEvent(TQContextMenuEvent *); + bool focusNextPrevChild(bool); + TQTextDocument *document() const; + TQTextCursor *textCursor() const; + void setDocument(TQTextDocument *); + virtual TQPopupMenu *createPopupMenu(const TQPoint &) /Factory/; + virtual TQPopupMenu *createPopupMenu() /Factory/; + void drawCursor(bool); + + void windowActivationChange(bool); + +protected slots: + virtual void doChangeInterval(); + void sliderReleased(); + +private: + TQTextEdit(const TQTextEdit &); +}; diff --git a/sip/tqt/tqtextstream.sip b/sip/tqt/tqtextstream.sip new file mode 100644 index 0000000..83778c3 --- /dev/null +++ b/sip/tqt/tqtextstream.sip @@ -0,0 +1,199 @@ +// This is the SIP interface definition for TQTextStream, TQTextIStream and +// TQTextOStream. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQTextStream</Title> +<FuncSynopsis> + <FuncDef><Function>TQTextStream</Function></FuncDef> + <ParamDef>FILE *<Parameter>fp</Parameter></ParamDef> + <ParamDef>int <Parameter>mode</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>TQTextStream &<Function>readRawBytes</Function></FuncDef> + <ParamDef>char *<Parameter>buf</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>TQTextStream &<Function>writeRawBytes</Function></FuncDef> + <ParamDef>const char *<Parameter>buf</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> +</Sect2> + +<Sect2><Title>TQTextIStream (TQt v2+)</Title> +<FuncSynopsis> + <FuncDef><Function>TQTextIStream</Function></FuncDef> + <ParamDef>FILE *<Parameter>fp</Parameter></ParamDef> + <ParamDef>int <Parameter>mode</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> + +<Sect2><Title>TQTextOStream (TQt v2+)</Title> +<FuncSynopsis> + <FuncDef><Function>TQTextOStream</Function></FuncDef> + <ParamDef>FILE *<Parameter>fp</Parameter></ParamDef> + <ParamDef>int <Parameter>mode</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +%End + + +class TQTextStream +{ +%TypeHeaderCode +#include <tqtextstream.h> +%End + +public: + enum Encoding { + Locale, + Latin1, + Unicode, + UnicodeNetworkOrder, + UnicodeReverse, + RawUnicode, + UnicodeUTF8 + }; + + TQTextStream(); + TQTextStream(TQIODevice *); + TQTextStream(TQString *,int); + TQTextStream(TQByteArray,int); +// TQTextStream(FILE *,int); + + void setEncoding(Encoding); + void setCodec(TQTextCodec *); + TQTextCodec *codec(); + + TQIODevice *device() const; + void setDevice(TQIODevice *); + void unsetDevice(); + + bool atEnd() const; + bool eof() const; + +// TQTextStream &readRawBytes(char *,uint) /ReleaseGIL/; +// TQTextStream &writeRawBytes(const char *,uint) /ReleaseGIL/; + + TQString readLine() /ReleaseGIL/; + TQString read() /ReleaseGIL/; + void skipWhiteSpace(); + + enum { + skipws, + left, + right, + internal, + bin, + oct, + dec, + hex, + showbase, + showpoint, + uppercase, + showpos, + scientific, + fixed + }; + + static const int basefield; + static const int adjustfield; + static const int floatfield; + + int flags() const; + int flags(int); + int setf(int); + int setf(int,int); + int unsetf(int); + + void reset(); + + int width() const; + int width(int); + int fill() const; + int fill(int); + int precision() const; + int precision(int); + + // These are defined in qmainwindow.h as global operators so we have + // to implement them here and pretend they are class operators. + TQTextStream &operator<<(const TQMainWindow &); + TQTextStream &operator>>(TQMainWindow &); + + // These are defined in qdockarea.h as global operators so we have + // to implement them here and pretend they are class operators. + TQTextStream &operator<<(const TQDockArea &); + TQTextStream &operator>>(TQDockArea &); + +private: + TQTextStream(const TQTextStream &); +}; + + +class TQTextIStream : TQTextStream +{ +%TypeHeaderCode +#include <tqtextstream.h> +%End + +public: + TQTextIStream(TQString *); + TQTextIStream(TQByteArray); +// TQTextIStream(FILE *); + +private: + TQTextIStream(const TQTextIStream &); +}; + + +class TQTextOStream : TQTextStream +{ +%TypeHeaderCode +#include <tqtextstream.h> +%End + +public: + TQTextOStream(TQString *); + TQTextOStream(TQByteArray); +// TQTextOStream(FILE *); + +private: + TQTextOStream(const TQTextOStream &); +}; diff --git a/sip/tqt/tqtextview.sip b/sip/tqt/tqtextview.sip new file mode 100644 index 0000000..1d30dad --- /dev/null +++ b/sip/tqt/tqtextview.sip @@ -0,0 +1,45 @@ +// This is the SIP interface definition for TQTextView. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQTextView (TQt v2+)</Title> +<Para> +<Literal>TQTextView</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQTextView : TQTextEdit +{ +%TypeHeaderCode +#include <tqtextview.h> +%End + +public: + TQTextView(TQWidget * /TransferThis/ = 0,const char * = 0); + TQTextView(const TQString &,const TQString & = TQString::null, + TQWidget * /TransferThis/ = 0,const char * = 0); + +private: + TQTextView(const TQTextView &); +}; diff --git a/sip/tqt/tqthread.sip b/sip/tqt/tqthread.sip new file mode 100644 index 0000000..b95301a --- /dev/null +++ b/sip/tqt/tqthread.sip @@ -0,0 +1,83 @@ +// This is the SIP interface definition for TQThread. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQThread (TQt v2.2+)</Title> +<Para> +<Literal>TQThread</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_THREAD_SUPPORT) + +class TQThread : TQt /CreatesThread/ +{ +%TypeHeaderCode +#include <tqthread.h> +%End + +public: + static TQt::HANDLE currentThread(); + static void postEvent(TQObject *,TQEvent * /Transfer/) /ReleaseGIL/; + static void initialize(); + static void cleanup(); + + static void exit() /ReleaseGIL/; + + TQThread(unsigned int); + TQThread(); + + bool wait(unsigned long = ULONG_MAX) /ReleaseGIL/; + + enum Priority { + IdlePriority, + LowestPriority, + LowPriority, + NormalPriority, + HighPriority, + HighestPriority, + TimeCriticalPriority, + InheritPriority + }; + + void start(Priority) /ReleaseGIL/; + void start() /ReleaseGIL/; + + void terminate(); + + bool finished() const; + bool running() const; + +protected: + virtual void run() = 0 /NewThread/; + + static void sleep(unsigned long) /ReleaseGIL/; + static void msleep(unsigned long) /ReleaseGIL/; + static void usleep(unsigned long) /ReleaseGIL/; + +private: + TQThread(const TQThread &); +}; + +%End diff --git a/sip/tqt/tqtimer.sip b/sip/tqt/tqtimer.sip new file mode 100644 index 0000000..6dd2249 --- /dev/null +++ b/sip/tqt/tqtimer.sip @@ -0,0 +1,57 @@ +// This is the SIP interface definition for TQTimer. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQTimer</Title> +<Para> +<Literal>TQTimer</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQTimer : TQObject +{ +%TypeHeaderCode +#include <tqtimer.h> +%End + +public: + TQTimer(TQObject * /TransferThis/ = 0,char * = 0); + + bool isActive() const; + int start(int,bool = 0); + void changeInterval(int); + void stop(); + static void singleShot(int,SIP_RXOBJ_CON,SIP_SLOT_CON()); + + int timerId() const; + +signals: + void timeout(); + +protected: + bool event(TQEvent *); + +private: + TQTimer(const TQTimer &); +}; diff --git a/sip/tqt/tqtmod.sip b/sip/tqt/tqtmod.sip new file mode 100644 index 0000000..5996a15 --- /dev/null +++ b/sip/tqt/tqtmod.sip @@ -0,0 +1,279 @@ +// This is the SIP interface definition for the tqt module of PyTQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%Module PyTQt.tqt 2 + +%Plugin PyTQt3 + +%Include versions.sip +%Include copying.sip + + +unsigned PYTQT_VERSION; +const char *PYTQT_VERSION_STR; + +%ModuleCode +static unsigned PYTQT_VERSION = 0x031201; +static const char *PYTQT_VERSION_STR = "3.18.1"; +%End + + +// Hook into the VendorID package if it is enabled. +%Feature VendorID + +%If (VendorID) + +%ModuleCode +#include <vendorid.h> +%End + +%PreInitialisationCode + if (!vendorid_check()) + { + PyErr_SetString(PyExc_RuntimeError, "PyTQt cannot be used with this Python interpreter"); + return; + } +%End + +%End + +%DefaultMetatype tqt.pytqtWrapperType +%DefaultSupertype tqt.pytqtWrapper + +// Include the interface definitions for each class. + +// These contain enum and type definitions that need to be defined before they +// are used so they do not seem to be classes. + +%Include tqglobal.sip +%Include tqnamespace.sip +%Include tqwindowdefs.sip +%Include tqpen.sip + +%Include tqpaintdevice.sip + +%Include tqpixmap.sip +%Include tqbitmap.sip + +%Include tqsize.sip +%Include tqsizepolicy.sip + +%Include tqaccel.sip +%Include tqaction.sip +%Include tqapplication.sip +%Include tqassistantclient.sip +%Include tqbrush.sip +%Include tqbutton.sip +%Include tqbuttongroup.sip +%Include tqbytearray.sip +%Include tqcdestyle.sip +%Include tqcheckbox.sip +%Include tqclipboard.sip +%Include tqcolor.sip +%Include tqcolordialog.sip +%Include tqcolorgroup.sip +%Include tqcombobox.sip +%Include tqcommonstyle.sip +%Include tqcstring.sip +%Include tqcursor.sip +%Include tqdatastream.sip +%Include tqdatetime.sip +%Include tqdatetimeedit.sip +%Include tqdesktopwidget.sip +%Include tqdial.sip +%Include tqdialog.sip +%Include tqdir.sip +%Include tqdockarea.sip +%Include tqdockwindow.sip +%Include tqdragobject.sip +%Include tqdrawutil.sip +%Include tqdropsite.sip +%Include tqerrormessage.sip +%Include tqevent.sip +%Include tqeventloop.sip +%Include tqfile.sip +%Include tqfiledialog.sip +%Include tqfileinfo.sip +%Include tqfont.sip +%Include tqfontdatabase.sip +%Include tqfontdialog.sip +%Include tqfontinfo.sip +%Include tqfontmetrics.sip +%Include tqframe.sip +%Include tqgrid.sip +%Include tqgridview.sip +%Include tqgroupbox.sip +%Include tqhbox.sip +%Include tqhbuttongroup.sip +%Include tqheader.sip +%Include tqhgroupbox.sip +%Include tqiconset.sip +%Include tqiconview.sip +%Include tqimage.sip +%Include tqinputdialog.sip +%Include tqinterlacestyle.sip +%Include tqiodevice.sip +%Include tqkeysequence.sip +%Include tqlabel.sip +%Include tqlayout.sip +%Include tqlcdnumber.sip +%Include tqlibrary.sip +%Include tqlineedit.sip +%Include tqlistbox.sip +%Include tqlistview.sip +%Include tqlocale.sip +%Include tqmainwindow.sip +%Include tqmemarray.sip +%Include tqmenubar.sip +%Include tqmenudata.sip +%Include tqmessagebox.sip +%Include tqmetaobject.sip +%Include tqmime.sip +%Include tqmotifplusstyle.sip +%Include tqmotifstyle.sip +%Include tqmovie.sip +%Include tqmutex.sip +%Include tqmultilinedit.sip +%Include tqnetworkprotocol.sip +%Include tqobject.sip +%Include tqobjectcleanuphandler.sip +%Include tqobjectlist.sip +%Include tqpaintdevicemetrics.sip +%Include tqpainter.sip +%Include tqpair.sip +%Include tqpalette.sip +%Include tqpicture.sip +%Include tqpixmapcache.sip +%Include tqplatinumstyle.sip +%Include tqpoint.sip +%Include tqpointarray.sip +%Include tqpopupmenu.sip +%Include tqprintdialog.sip +%Include tqprinter.sip +%Include tqprocess.sip +%Include tqprogressbar.sip +%Include tqprogressdialog.sip +%Include tqptrlist.sip +%Include tqpushbutton.sip +%Include tqradiobutton.sip +%Include tqrangecontrol.sip +%Include tqrect.sip +%Include tqregexp.sip +%Include tqregion.sip +%Include tqscrollbar.sip +%Include tqscrollview.sip +%Include tqsemaphore.sip +%Include tqsessionmanager.sip +%Include tqsettings.sip +%Include tqsgistyle.sip +%Include tqsignalmapper.sip +%Include tqsimplerichtext.sip +%Include tqsizegrip.sip +%Include tqslider.sip +%Include tqsocketnotifier.sip +%Include tqsound.sip +%Include tqspinbox.sip +%Include tqsplashscreen.sip +%Include tqsplitter.sip +%Include tqstatusbar.sip +%Include tqstring.sip +%Include tqstringlist.sip +%Include tqstrlist.sip +%Include tqstyle.sip +%Include tqstylefactory.sip +%Include tqstylesheet.sip +%Include tqsyntaxhighlighter.sip +%Include tqtabbar.sip +%Include tqtabdialog.sip +%Include tqtabwidget.sip +%Include tqtextbrowser.sip +%Include tqtextcodec.sip +%Include tqtextedit.sip +%Include tqtextstream.sip +%Include tqtextview.sip +%Include tqthread.sip +%Include tqtimer.sip +%Include tqtoolbar.sip +%Include tqtoolbox.sip +%Include tqtoolbutton.sip +%Include tqtooltip.sip +%Include tqtranslator.sip +%Include tqurl.sip +%Include tqurlinfo.sip +%Include tqurloperator.sip +%Include tquuid.sip +%Include tqvalidator.sip +%Include tqvaluelist.sip +%Include tqvariant.sip +%Include tqvbox.sip +%Include tqvbuttongroup.sip +%Include tqvgroupbox.sip +%Include tqwaitcondition.sip +%Include tqwhatsthis.sip +%Include tqwidget.sip +%Include tqwidgetlist.sip +%Include tqwidgetstack.sip +%Include tqwindowsstyle.sip +%Include tqwindowsxpstyle.sip +%Include tqwizard.sip +%Include tqwmatrix.sip +%Include tqworkspace.sip + + +// The build file templates. + +%Makefile tqt.pro.in +# The project file for the tqt module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# This file is part of PyTQt. +# +# This copy of PyTQt is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2, or (at your option) any later +# version. +# +# PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +TEMPLATE = lib +TARGET = @BLX_TARGET_LIB@ +DESTDIR = @PYTQT_MODDIR@ +CONFIG += @BLX_CONFIG_LIB@ @PYTQT_WARN@ +INCLUDEPATH = @BLX_INCLUDEPATH@ +DEFINES = @BLX_DEFINES@ +LIBS += @PYTQT_QASSISTANTCLIENT_LIB@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End diff --git a/sip/tqt/tqtoolbar.sip b/sip/tqt/tqtoolbar.sip new file mode 100644 index 0000000..5bab07f --- /dev/null +++ b/sip/tqt/tqtoolbar.sip @@ -0,0 +1,73 @@ +// This is the SIP interface definition for TQToolBar. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQToolBar</Title> +<Para> +<Literal>TQToolBar</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQToolBar : TQDockWindow +{ +%TypeHeaderCode +#include <tqtoolbar.h> +%End + +public: + TQToolBar(const TQString &,TQMainWindow * /TransferThis/,Dock = DockTop, + bool = 0,const char * = 0); + TQToolBar(const TQString &,TQMainWindow *,TQWidget * /TransferThis/, + bool = 0,const char * = 0,WFlags = 0); + TQToolBar(TQMainWindow * /TransferThis/ = 0,const char * = 0); + + void addSeparator(); + + void show(); + void hide(); + + TQMainWindow *mainWindow() const; + + virtual void setStretchableWidget(TQWidget *); + + bool event(TQEvent *); + + virtual void setLabel(const TQString &); + TQString label() const; + + virtual void clear(); + + TQSize minimumSize() const; + TQSize minimumSizeHint() const; + + void setOrientation(Orientation); + void setMinimumSize(int,int); + +protected: + void resizeEvent(TQResizeEvent *); + void styleChange(TQStyle &); + +private: + TQToolBar(const TQToolBar &); +}; diff --git a/sip/tqt/tqtoolbox.sip b/sip/tqt/tqtoolbox.sip new file mode 100644 index 0000000..43486b5 --- /dev/null +++ b/sip/tqt/tqtoolbox.sip @@ -0,0 +1,84 @@ +// This is the SIP interface definition for TQToolBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQToolBox (TQt v3.2.0+)</Title> +<Para> +<Literal>TQToolBox</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQToolBox : TQFrame +{ +%TypeHeaderCode +#include <tqtoolbox.h> +%End + +public: + TQToolBox(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + ~TQToolBox(); + + int addItem(TQWidget * /Transfer/,const TQString &); + int addItem(TQWidget * /Transfer/,const TQIconSet &,const TQString &); + int insertItem(int,TQWidget * /Transfer/,const TQString &); + int insertItem(int,TQWidget * /Transfer/,const TQIconSet &, + const TQString &); + + // On return the TQWidget will have the TQToolBox as it's parent, so we + // don't transfer ownership back. + int removeItem(TQWidget *); + + void setItemEnabled(int,bool); + bool isItemEnabled(int) const; + + void setItemLabel(int,const TQString &); + TQString itemLabel(int) const; + + void setItemIconSet(int,const TQIconSet &); + TQIconSet itemIconSet(int) const; + + void setItemToolTip(int,const TQString &); + TQString itemToolTip(int) const; + + TQWidget *currentItem() const; + void setCurrentItem(TQWidget *); + + int currentIndex() const; + TQWidget *item(int) const; + int indexOf(TQWidget *) const; + int count() const; + +public slots: + void setCurrentIndex(int); + +signals: + void currentChanged(int); + +protected: + virtual void itemInserted(int); + virtual void itemRemoved(int); + void showEvent(TQShowEvent *); + void frameChanged(); + void styleChange(TQStyle &); +}; diff --git a/sip/tqt/tqtoolbutton.sip b/sip/tqt/tqtoolbutton.sip new file mode 100644 index 0000000..ab8d195 --- /dev/null +++ b/sip/tqt/tqtoolbutton.sip @@ -0,0 +1,105 @@ +// This is the SIP interface definition for TQToolButton. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQToolButton</Title> +<Para> +<Literal>TQToolButton</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQToolButton : TQButton +{ +%TypeHeaderCode +#include <tqtoolbutton.h> +%End + +public: + enum TextPosition { + BesideIcon, + BelowIcon, + Right, // Obsolete + Under // Obsolete + }; + + TQToolButton(TQWidget * /TransferThis/,const char * = 0); + TQToolButton(const TQIconSet &,const TQString &,const TQString &, + SIP_RXOBJ_CON,SIP_SLOT_CON(),TQToolBar * /TransferThis/, + const char * = 0); + TQToolButton(ArrowType,TQWidget * /TransferThis/,const char * = 0); + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + + virtual void setIconSet(const TQIconSet &); + TQIconSet iconSet() const; + + bool usesBigPixmap() const; + bool usesTextLabel() const; + TQString textLabel() const; + + void setPopup(TQPopupMenu *); + TQPopupMenu* popup() const; + + void setPopupDelay(int); + int popupDelay() const; + + void openPopup(); + + void setAutoRaise(bool); + bool autoRaise() const; + TextPosition textPosition() const; + + void setText(const TQString &); + +public slots: + virtual void setUsesBigPixmap(bool); + virtual void setUsesTextLabel(bool); + virtual void setTextLabel(const TQString &,bool); + + virtual void setToggleButton(bool); + + virtual void setOn(bool); + void toggle(); + // This was actually introduced in TQt v2.1.0 but gives signature + // conflict until TQt v3.0.0. + void setTextLabel(const TQString &); + void setTextPosition(TextPosition); + +protected: + void mousePressEvent(TQMouseEvent *); + void drawButton(TQPainter *); + void drawButtonLabel(TQPainter *); + + void enterEvent(TQEvent *); + void leaveEvent(TQEvent *); + void moveEvent(TQMoveEvent *); + + bool uses3D() const; + + bool eventFilter(TQObject *,TQEvent *); + +private: + TQToolButton(const TQToolButton &); +}; diff --git a/sip/tqt/tqtooltip.sip b/sip/tqt/tqtooltip.sip new file mode 100644 index 0000000..1a24264 --- /dev/null +++ b/sip/tqt/tqtooltip.sip @@ -0,0 +1,105 @@ +// This is the SIP interface definition for TQToolTip and TQToolTipGroup. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQToolTip</Title> +<Para> +<Literal>TQToolTip</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQToolTipGroup</Title> +<Para> +<Literal>TQToolTipGroup</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQToolTipGroup : TQObject +{ +%TypeHeaderCode +#include <tqtooltip.h> +%End + +public: + TQToolTipGroup(TQObject * /TransferThis/,const char * = 0); + + bool delay() const; + bool enabled() const; + +public slots: + void setDelay(bool); + void setEnabled(bool); + +signals: + void showTip(const TQString &); + void removeTip(); + +private: + TQToolTipGroup(const TQToolTipGroup &); +}; + + +class TQToolTip : TQt +{ +%TypeHeaderCode +#include <tqtooltip.h> +%End + +public: + TQToolTip(TQWidget *,TQToolTipGroup * = 0); + + static void add(TQWidget *,const TQString &); + static void add(TQWidget *,const TQString &,TQToolTipGroup *, + const TQString &); + static void remove(TQWidget *); + + static void add(TQWidget *,const TQRect &,const TQString &); + static void add(TQWidget *,const TQRect &,const TQString &, + TQToolTipGroup *,const TQString &); + static void remove(TQWidget *,const TQRect &); + + static TQString textFor(TQWidget *,const TQPoint & = TQPoint()); + + static void hide(); + + static TQFont font(); + static void setFont(const TQFont &); + static TQPalette palette(); + static void setPalette(const TQPalette &); + + static void setGloballyEnabled(bool); + static bool isGloballyEnabled(); + static void setWakeUpDelay(int); + + TQWidget *parentWidget() const; + TQToolTipGroup *group() const; + +protected: + virtual void maybeTip(const TQPoint &) = 0; + void tip(const TQRect &,const TQString &); + void tip(const TQRect &,const TQString &,const TQString &); + void tip(const TQRect &,const TQString &,const TQRect &); + void tip(const TQRect &,const TQString &,const TQString &,const TQRect &); + void clear(); +}; diff --git a/sip/tqt/tqtranslator.sip b/sip/tqt/tqtranslator.sip new file mode 100644 index 0000000..1edee94 --- /dev/null +++ b/sip/tqt/tqtranslator.sip @@ -0,0 +1,113 @@ +// This is the SIP interface definition for TQTranslator and TQTranslatorMessage. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQTranslator (TQt v2+)</Title> +<Para> +<Literal>TQTranslator</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>TQTranslatorMessage (TQt v2.2+)</Title> +<Para> +<Literal>TQTranslatorMessage</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQTranslatorMessage +{ +%TypeHeaderCode +#include <tqtranslator.h> +%End + +public: + TQTranslatorMessage(); + TQTranslatorMessage(const char *,const char *,const char *, + const TQString & = TQString::null); + TQTranslatorMessage(TQDataStream &); + TQTranslatorMessage(const TQTranslatorMessage &); + + uint hash() const; + const char *context() const; + const char *sourceText() const; + const char *comment() const; + + void setTranslation(const TQString &); + TQString translation() const; + + enum Prefix { + NoPrefix, + Hash, + HashContext, + HashContextSourceText, + HashContextSourceTextComment + }; + + void write(TQDataStream &,bool = 0, + Prefix = HashContextSourceTextComment) const /ReleaseGIL/; + + Prefix commonPrefix(const TQTranslatorMessage &) const; +}; + + +class TQTranslator : TQObject +{ +%TypeHeaderCode +#include <tqtranslator.h> +%End + +public: + TQTranslator(TQObject * /TransferThis/ = 0,const char * = 0); + + TQString find(const char *,const char *,const char *) const; + + virtual TQTranslatorMessage findMessage(const char *,const char *, + const char * = 0) const; + + bool load(const TQString &,const TQString & = TQString::null, + const TQString & = TQString::null, + const TQString & = TQString::null); + bool load(const uchar *,int); + + void clear(); + + enum SaveMode { + Everything, + Stripped + }; + + bool save(const TQString &,SaveMode = Everything); + + void insert(const TQTranslatorMessage &); + void remove(const TQTranslatorMessage &); + bool contains(const char *,const char *,const char * = 0) const; + + void squeeze(SaveMode = Everything); + void unsqueeze(); + + TQValueList<TQTranslatorMessage> messages() const; + +private: + TQTranslator(const TQTranslator &); +}; diff --git a/sip/tqt/tqurl.sip b/sip/tqt/tqurl.sip new file mode 100644 index 0000000..004b653 --- /dev/null +++ b/sip/tqt/tqurl.sip @@ -0,0 +1,110 @@ +// This is the SIP interface definition for TQUrl. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQUrl (TQt v2.1+)</Title> +<Para> +<Literal>TQUrl</Literal> is fully implemented, including the +<Literal>TQString()</Literal>, <Literal>==</Literal> and <Literal>!=</Literal> +operators. +</Para> +</Sect2> +%End + + +class TQUrl +{ +%TypeHeaderCode +#include <tqurl.h> +%End + +public: + TQUrl(); + TQUrl(const TQString &); + TQUrl(const TQUrl &); + TQUrl(const TQUrl &,const TQString &,bool = 0); + + TQString protocol() const; + virtual void setProtocol(const TQString &); + + TQString user() const; + virtual void setUser(const TQString &); + bool hasUser() const; + + TQString password() const; + virtual void setPassword(const TQString &); + bool hasPassword() const; + + TQString host() const; + virtual void setHost(const TQString &); + bool hasHost() const; + + int port() const; + virtual void setPort(int); + bool hasPort() const; + + TQString path(bool = 1) const; + virtual void setPath(const TQString &); + bool hasPath() const; + + virtual void setEncodedPathAndQuery(const TQString &); + TQString encodedPathAndQuery(); + + virtual void setQuery(const TQString &); + TQString query() const; + + TQString ref() const; + virtual void setRef(const TQString &); + bool hasRef() const; + + bool isValid() const; + bool isLocalFile() const; + + virtual void addPath(const TQString &); + virtual void setFileName(const TQString &); + + TQString fileName() const; + TQString dirPath() const; + + bool operator==(const TQUrl &) const; + bool operator==(const TQString &) const; + +%If (TQt_SIP_PRE_4_7_2) + // TQt doesn't implement these, but SIP doesn't support C++'s default + // handling of != when == is implemented. + bool operator!=(const TQUrl &) const; + bool operator!=(const TQString &) const; +%End + + static void decode(TQString &); + static void encode(TQString &); + + virtual TQString toString(bool = 0,bool = 0) const; + + virtual bool cdUp(); + + static bool isRelativeUrl(const TQString &); + +protected: + virtual void reset(); + virtual bool parse(const TQString &); +}; diff --git a/sip/tqt/tqurlinfo.sip b/sip/tqt/tqurlinfo.sip new file mode 100644 index 0000000..f2f0467 --- /dev/null +++ b/sip/tqt/tqurlinfo.sip @@ -0,0 +1,90 @@ +// This is the SIP interface definition for TQUrlInfo. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQUrlInfo (TQt v2.1+)</Title> +<Para> +<Literal>TQUrlInfo</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_NETWORKPROTOCOL) + +class TQUrlInfo +{ +%TypeHeaderCode +#include <tqurlinfo.h> +%End + +public: + enum PermissionSpec { + ReadOwner, WriteOwner, ExeOwner, + ReadGroup, WriteGroup, ExeGroup, + ReadOther, WriteOther, ExeOther + }; + + TQUrlInfo(); + TQUrlInfo(const TQUrlOperator &,const TQString &); + TQUrlInfo(const TQUrlInfo &); + TQUrlInfo(const TQString &,int,const TQString &,const TQString &,uint, + const TQDateTime &,const TQDateTime &,bool,bool,bool,bool,bool, + bool); + TQUrlInfo(const TQUrl &,int,const TQString &,const TQString &,uint, + const TQDateTime &,const TQDateTime &,bool,bool,bool,bool,bool, + bool); + + virtual void setName(const TQString &); + virtual void setDir(bool); + virtual void setFile(bool); + virtual void setSymLink(bool); + virtual void setOwner(const TQString &); + virtual void setGroup(const TQString &); + virtual void setSize(uint); + virtual void setWritable(bool); + virtual void setReadable(bool); + virtual void setPermissions(int); + virtual void setLastModified(const TQDateTime &); + + bool isValid() const; + + TQString name() const; + int permissions() const; + TQString owner() const; + TQString group() const; + uint size() const; + TQDateTime lastModified() const; + TQDateTime lastRead() const; + bool isDir() const; + bool isFile() const; + bool isSymLink() const; + bool isWritable() const; + bool isReadable() const; + bool isExecutable() const; + + static bool greaterThan(const TQUrlInfo &,const TQUrlInfo &,int); + static bool lessThan(const TQUrlInfo &,const TQUrlInfo &,int); + static bool equal(const TQUrlInfo &,const TQUrlInfo &,int); +}; + +%End diff --git a/sip/tqt/tqurloperator.sip b/sip/tqt/tqurloperator.sip new file mode 100644 index 0000000..20e0d8d --- /dev/null +++ b/sip/tqt/tqurloperator.sip @@ -0,0 +1,96 @@ +// This is the SIP interface definition for TQUrlOperator. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQUrlOperator (TQt v2.1+)</Title> +<FuncSynopsis> + <FuncDef>virtual bool <Function>isDir</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>bool</Literal> result and the +<Literal>ok</Literal> value. +</Para> +</Sect2> +%End + + +%If (TQt_NETWORKPROTOCOL) + +class TQUrlOperator : TQObject, TQUrl +{ +%TypeHeaderCode +#include <tqurloperator.h> +%End + +public: + TQUrlOperator(); + TQUrlOperator(const TQString &); + TQUrlOperator(const TQUrlOperator &); + TQUrlOperator(const TQUrlOperator &,const TQString &,bool = 0); + + virtual void setPath(const TQString &); + virtual bool cdUp(); + + virtual const TQNetworkOperation *listChildren(); + virtual const TQNetworkOperation *mkdir(const TQString &); + virtual const TQNetworkOperation *remove(const TQString &); + virtual const TQNetworkOperation *rename(const TQString &, + const TQString &); + virtual const TQNetworkOperation *get(const TQString & = TQString::null); + virtual const TQNetworkOperation *put(const TQByteArray &, + const TQString & = TQString::null); + virtual TQPtrList<TQNetworkOperation> copy(const TQString &, + const TQString &,bool = 0, + bool = 1); + virtual void copy(const TQStringList &,const TQString &,bool = 0); + virtual bool isDir(bool * = 0); + + virtual void setNameFilter(const TQString &); + TQString nameFilter() const; + + virtual TQUrlInfo info(const TQString &) const; + + virtual void stop(); + +signals: + void newChildren(const TQValueList<TQUrlInfo> &,TQNetworkOperation *); + void finished(TQNetworkOperation *); + void start(TQNetworkOperation *); + void createdDirectory(const TQUrlInfo &,TQNetworkOperation *); + void removed(TQNetworkOperation *); + void itemChanged(TQNetworkOperation *); + void data(const TQByteArray &,TQNetworkOperation *); + void dataTransferProgress(int,int,TQNetworkOperation *); + void startedNextCopy(const TQPtrList<TQNetworkOperation> &); + void connectionStateChanged(int,const TQString &); + +protected: + void reset(); + bool parse(const TQString &); + virtual bool checkValid(); + virtual void clearEntries(); + void getNetworkProtocol(); + void deleteNetworkProtocol(); +}; + +%End diff --git a/sip/tqt/tquuid.sip b/sip/tqt/tquuid.sip new file mode 100644 index 0000000..df334fa --- /dev/null +++ b/sip/tqt/tquuid.sip @@ -0,0 +1,74 @@ +// This is the SIP interface definition for TQUuid. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQUuid (TQt v3.0+)</Title> +<Para> +<Literal>TQUuid</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQUuid +{ +%TypeHeaderCode +#include <tquuid.h> +%End + +public: + enum Variant + { + VarUnknown, + NCS, + DCE, + Microsoft, + Reserved + }; + + enum Version + { + VerUnknown, + Time, + EmbeddedPOSIX, + Name, + Random + }; + + TQUuid(); + TQUuid(uint,ushort,ushort,uchar,uchar,uchar,uchar,uchar,uchar,uchar,uchar); + TQUuid(const TQUuid &); + TQUuid(const TQString &); + + TQString toString() const; + bool isNull() const; + + bool operator==(const TQUuid &) const; + bool operator!=(const TQUuid &) const; + + bool operator<(const TQUuid &) const; + bool operator>(const TQUuid &) const; + + static TQUuid createUuid(); + TQUuid::Variant variant() const; + TQUuid::Version version() const; +}; diff --git a/sip/tqt/tqvalidator.sip b/sip/tqt/tqvalidator.sip new file mode 100644 index 0000000..c400969 --- /dev/null +++ b/sip/tqt/tqvalidator.sip @@ -0,0 +1,169 @@ +// This is the SIP interface definition for TQValidator, TQDoubleValidator, +// TQIntValidator and TQRegExpValidator. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQValidator</Title> +<FuncSynopsis> + <FuncDef>virtual State <Function>validate</Function></FuncDef> + <ParamDef>TQString& <Parameter>input</Parameter></ParamDef> + <ParamDef>int& <Parameter>pos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The returned value is a tuple of the <Literal>State</Literal> result and the +updated <Literal>pos</Literal>. +</Para> +</Sect2> + +<Sect2><Title>TQDoubleValidator</Title> +<FuncSynopsis> + <FuncDef>State <Function>validate</Function></FuncDef> + <ParamDef>TQString& <Parameter>input</Parameter></ParamDef> + <ParamDef>int& <Parameter>pos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The returned value is a tuple of the <Literal>State</Literal> result and the +updated <Literal>pos</Literal>. +</Para> +</Sect2> + +<Sect2><Title>TQIntValidator</Title> +<FuncSynopsis> + <FuncDef>State <Function>validate</Function></FuncDef> + <ParamDef>TQString& <Parameter>input</Parameter></ParamDef> + <ParamDef>int& <Parameter>pos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The returned value is a tuple of the <Literal>State</Literal> result and the +updated <Literal>pos</Literal>. +</Para> +</Sect2> + +<Sect2><Title>TQRegExpValidator (TQt v3+)</Title> +<FuncSynopsis> + <FuncDef>virtual State <Function>validate</Function></FuncDef> + <ParamDef>TQString& <Parameter>input</Parameter></ParamDef> + <ParamDef>int& <Parameter>pos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The returned value is a tuple of the <Literal>State</Literal> result and the +updated <Literal>pos</Literal>. +</Para> +</Sect2> +%End + + +class TQValidator : TQObject +{ +%TypeHeaderCode +#include <tqvalidator.h> +%End + +public: + TQValidator(TQObject * /TransferThis/,const char * = 0); + + enum State + { + Invalid, + Intermediate, + Valid = Intermediate, + Acceptable + }; + + virtual State validate(TQString &,int & /In,Out/) const = 0; + virtual void fixup(TQString &) const; + +private: + TQValidator(const TQValidator &); +}; + + +class TQIntValidator : TQValidator +{ +%TypeHeaderCode +#include <tqvalidator.h> +%End + +public: + TQIntValidator(TQObject * /TransferThis/,const char * = 0); + TQIntValidator(int,int,TQObject * /TransferThis/,const char * = 0); + + TQValidator::State validate(TQString &,int & /In,Out/) const; + + void setBottom(int); + void setTop(int); + virtual void setRange(int,int); + + int bottom() const; + int top() const; + +private: + TQIntValidator(const TQIntValidator &); +}; + + +class TQDoubleValidator : TQValidator +{ +%TypeHeaderCode +#include <tqvalidator.h> +%End + +public: + TQDoubleValidator(TQObject * /TransferThis/,const char * = 0); + TQDoubleValidator(double,double,int,TQObject * /TransferThis/, + const char * = 0); + + TQValidator::State validate(TQString &,int & /In,Out/) const; + + virtual void setRange(double,double,int = 0); + void setBottom(double); + void setTop(double); + void setDecimals(int); + + double bottom() const; + double top() const; + int decimals() const; + +private: + TQDoubleValidator(const TQDoubleValidator &); +}; + + +class TQRegExpValidator : TQValidator +{ +%TypeHeaderCode +#include <tqvalidator.h> +%End + +public: + TQRegExpValidator(TQObject * /TransferThis/,const char * = 0); + TQRegExpValidator(const TQRegExp &,TQObject * /TransferThis/, + const char * = 0); + + virtual TQValidator::State validate(TQString &,int & /In,Out/) const; + + void setRegExp(const TQRegExp &); + const TQRegExp ®Exp() const; + +private: + TQRegExpValidator(const TQRegExpValidator &); +}; diff --git a/sip/tqt/tqvaluelist.sip b/sip/tqt/tqvaluelist.sip new file mode 100644 index 0000000..d803861 --- /dev/null +++ b/sip/tqt/tqvaluelist.sip @@ -0,0 +1,173 @@ +// This is the SIP interface definition for all types based on the TQValueList +// template. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQValueList<type> (TQt v2+)</Title> +<Para> +Types based on the <Literal>TQValueList</Literal> template are automatically +converted to and from Python lists of the type. +</Para> +</Sect2> +%End + + +template<Type> +%MappedType TQValueList<Type> +{ +%TypeHeaderCode +#include <tqvaluelist.h> +%End + +%ConvertFromTypeCode + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + TQValueListConstIterator<Type> it; + + for (it = sipCpp -> begin(); it != sipCpp -> end(); ++it) + { + PyObject *tmobj; + + if ((tmobj = sipConvertFromNewInstance(new Type(*it),sipClass_Type,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0) + { + Py_XDECREF(tmobj); + Py_DECREF(l); + + return NULL; + } + + ++i; + } + + return l; +%End + +%ConvertToTypeCode + if (sipIsErr == NULL) + { + if (!PyList_Check(sipPy)) + return 0; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_Type,SIP_NOT_NONE)) + return 0; + + return 1; + } + + TQValueList<Type> *qvl = new TQValueList<Type>; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + int iserr = 0, state; + + // We apply the transfer to the list itself, not the elements. + Type *itm = reinterpret_cast<Type *>(sipConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_Type,0,SIP_NOT_NONE,&state,&iserr)); + + if (iserr) + { + sipReleaseInstance(itm,sipClass_Type,state); + + *sipIsErr = 1; + delete qvl; + + return 0; + } + + qvl -> append(*itm); + + sipReleaseInstance(itm,sipClass_Type,state); + } + + *sipCppPtr = qvl; + + return sipGetState(sipTransferObj); +%End +}; + + +%MappedType TQValueList<int> +{ +%TypeHeaderCode +#include <tqvaluelist.h> +%End + +%ConvertFromTypeCode + // Convert to a Python list of integers. + + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + for (uint i = 0; i < sipCpp -> count(); ++i) + if (PyList_SetItem(l,i,PyLong_FromLong((long)(*sipCpp)[i])) < 0) + { + Py_DECREF(l); + + return NULL; + } + + return l; +%End + +%ConvertToTypeCode + // Convert a Python list of integers to a TQValueList<int> on the heap. + + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + TQValueList<int> *qvl = new TQValueList<int>; + + PyErr_Clear(); + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + qvl -> append(PyLong_AsLong(PyList_GET_ITEM(sipPy,i))); + + if (PyErr_Occurred() != NULL) + { + delete qvl; + *sipIsErr = 1; + + return 0; + } + } + + *sipCppPtr = qvl; + + return 1; +%End +}; diff --git a/sip/tqt/tqvariant.sip b/sip/tqt/tqvariant.sip new file mode 100644 index 0000000..ea28fcf --- /dev/null +++ b/sip/tqt/tqvariant.sip @@ -0,0 +1,378 @@ +// This is the SIP interface definition for TQVariant. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQVariant (TQt v2.1+)</Title> +<FuncSynopsis> + <FuncDef><Function>TQVariant</Function></FuncDef> + <ParamDef>const char *<Parameter>val</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef><Function>TQVariant</Function></FuncDef> + <ParamDef>const TQBitArray &<Parameter>val</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (TQt v3+) +</Para> + +<FuncSynopsis> + <FuncDef><Function>TQVariant</Function></FuncDef> + <ParamDef>const TQValueList<TQVariant> &<Parameter>val</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef><Function>TQVariant</Function></FuncDef> + <ParamDef>const TQMap<TQString,TQVariant> &<Parameter>val</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>TQBitArray &<Function>asBitArray</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (TQt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool &<Function>asBool</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>double &<Function>asDouble</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>int &<Function>asInt</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>TQValueList<TQVariant> &<Function>asList</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>TQMap<TQString,TQVariant> &<Function>asMap</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>uint &<Function>asUInt</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>TQValueListConstIterator<TQVariant><Function>listBegin</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>TQValueListConstIterator<TQVariant><Function>listEnd</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>TQMapConstIterator<TQString,TQVariant><Function>mapBegin</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>TQMapConstIterator<TQString,TQVariant><Function>mapEnd</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>TQMapConstIterator<TQString,TQVariant><Function>mapFind</Function> const</FuncDef> + <ParamDef>const TQString &<Parameter>key</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>TQValueListConstIterator<TQString><Function>stringListBegin</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>TQValueListConstIterator<TQString><Function>stringListEnd</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>const TQBitArray <Function>toBitArray</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (TQt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>const TQValueList<TQVariant><Function>toList</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>const TQMap<TQString,TQVariant><Function>toMap</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> +</Sect2> +%End + + +class TQVariant +{ +%TypeHeaderCode +#include <tqvariant.h> +%End + +public: + enum Type { + Invalid, + Map, + List, + String, + StringList, + Font, + Pixmap, + Brush, + Rect, + Size, + Color, + Palette, + ColorGroup, + IconSet, + Point, + Image, + Int, + UInt, + Bool, + Double, + CString, + PointArray, + Region, + Bitmap, + Cursor, + SizePolicy, + Date, + Time, + DateTime, + ByteArray, + BitArray, + KeySequence, + Pen, + LongLong, + ULongLong, + }; + + TQVariant(); + TQVariant(const TQVariant &); + TQVariant(TQDataStream &); + + TQVariant(const TQString &); + TQVariant(const TQCString &); +// TQVariant(const char *); + TQVariant(const TQStringList &); + TQVariant(const TQFont &); + TQVariant(const TQPixmap &); + TQVariant(const TQImage &); + TQVariant(const TQBrush &); + TQVariant(const TQPoint &); + TQVariant(const TQRect &); + TQVariant(const TQSize &); + TQVariant(const TQColor &); + TQVariant(const TQPalette &); + TQVariant(const TQColorGroup &); + TQVariant(const TQIconSet &); + TQVariant(const TQPointArray &); + TQVariant(const TQRegion &); + TQVariant(const TQBitmap &); + TQVariant(const TQCursor &); + TQVariant(const TQDate &); + TQVariant(const TQTime &); + TQVariant(const TQDateTime &); + TQVariant(const TQByteArray &); +// TQVariant(const TQBitArray &); +// TQVariant(const TQValueList<TQVariant> &); +// TQVariant(const TQMap<TQString,TQVariant> &); + TQVariant(int /Constrained/); +// TQVariant(uint); +// TQVariant(TQ_LLONG); +// TQVariant(TQ_ULLONG); + TQVariant(bool /Constrained/); + TQVariant(double); + TQVariant(TQSizePolicy); + // This must appear after the TQString, int and double ctors because + // each of those can be converted automatically to a TQKeySequence and + // we want those to take precedence. + TQVariant(const TQKeySequence &); + TQVariant(const TQPen &); + + Type type() const; + const char* typeName() const; + + bool canCast(Type) const; + bool cast(Type); + + bool isValid() const; + bool isNull() const; + + void clear(); + + const TQString toString() const; + const TQCString toCString() const; + const TQStringList toStringList() const; + const TQFont toFont() const; + const TQPixmap toPixmap() const; + const TQImage toImage() const; + const TQBrush toBrush() const; + const TQPoint toPoint() const; + const TQRect toRect() const; + const TQSize toSize() const; + const TQColor toColor() const; + const TQPalette toPalette() const; + const TQColorGroup toColorGroup() const; + const TQIconSet toIconSet() const; + const TQPointArray toPointArray() const; + const TQBitmap toBitmap() const; + const TQRegion toRegion() const; + const TQCursor toCursor() const; + const TQDate toDate() const; + const TQTime toTime() const; + const TQDateTime toDateTime() const; + const TQByteArray toByteArray() const; +// const TQBitArray toBitArray() const; + const TQKeySequence toKeySequence() const; + const TQPen toPen() const; + int toInt() const; + uint toUInt() const; +// TQ_LLONG toLongLong(bool * = 0) const; +// TQ_ULLONG toULongLong( bool * = 0) const; + bool toBool() const; + double toDouble() const; +// const TQValueList<TQVariant> toList() const; +// const TQMap<TQString,TQVariant> toMap() const; + TQSizePolicy toSizePolicy() const; + +// TQValueListConstIterator<TQVariant> listBegin() const; +// TQValueListConstIterator<TQVariant> listEnd() const; +// TQValueListConstIterator<TQString> stringListBegin() const; +// TQValueListConstIterator<TQString> stringListEnd() const; +// TQMapConstIterator<TQString,TQVariant> mapBegin() const; +// TQMapConstIterator<TQString,TQVariant> mapEnd() const; +// TQMapConstIterator<TQString,TQVariant> mapFind(const TQString &) const; + + TQString & asString(); + TQCString & asCString(); + TQStringList & asStringList(); + TQFont & asFont(); + TQPixmap & asPixmap(); + TQImage & asImage(); + TQBrush & asBrush(); + TQPoint & asPoint(); + TQRect & asRect(); + TQSize & asSize(); + TQColor & asColor(); + TQPalette & asPalette(); + TQColorGroup & asColorGroup(); + TQIconSet & asIconSet(); + TQPointArray & asPointArray(); + TQBitmap & asBitmap(); + TQRegion & asRegion(); + TQCursor & asCursor(); + TQDate & asDate(); + TQTime & asTime(); + TQDateTime & asDateTime(); + TQByteArray & asByteArray(); +// TQBitArray & asBitArray(); + TQKeySequence & asKeySequence(); + TQPen & asPen(); +// int & asInt(); +// uint & asUInt(); +// TQ_LLONG & asLongLong(); +// TQ_ULLONG & asULongLong(); +// bool & asBool(); +// double & asDouble(); +// TQValueList<TQVariant> & asList(); +// TQMap<TQString,TQVariant> & asMap(); + TQSizePolicy & asSizePolicy(); + + void load(TQDataStream &); + void save(TQDataStream &) const; + + static const char *typeToName(Type); + static Type nameToType(const char *); +}; diff --git a/sip/tqt/tqvbox.sip b/sip/tqt/tqvbox.sip new file mode 100644 index 0000000..d88d324 --- /dev/null +++ b/sip/tqt/tqvbox.sip @@ -0,0 +1,43 @@ +// This is the SIP interface definition for TQVBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQVBox (TQt v2+)</Title> +<Para> +<Literal>TQVBox</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQVBox : TQHBox +{ +%TypeHeaderCode +#include <tqvbox.h> +%End + +public: + TQVBox(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + +private: + TQVBox(const TQVBox &); +}; diff --git a/sip/tqt/tqvbuttongroup.sip b/sip/tqt/tqvbuttongroup.sip new file mode 100644 index 0000000..d024bfc --- /dev/null +++ b/sip/tqt/tqvbuttongroup.sip @@ -0,0 +1,44 @@ +// This is the SIP interface definition for TQVButtonGroup. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQVButtonGroup (TQt v2+)</Title> +<Para> +<Literal>TQVButtonGroup</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQVButtonGroup : TQButtonGroup +{ +%TypeHeaderCode +#include <tqvbuttongroup.h> +%End + +public: + TQVButtonGroup(TQWidget * /TransferThis/ = 0,const char * = 0); + TQVButtonGroup(const TQString &,TQWidget * /TransferThis/ = 0,const char * = 0); + +private: + TQVButtonGroup(const TQVButtonGroup &); +}; diff --git a/sip/tqt/tqvgroupbox.sip b/sip/tqt/tqvgroupbox.sip new file mode 100644 index 0000000..9714a08 --- /dev/null +++ b/sip/tqt/tqvgroupbox.sip @@ -0,0 +1,44 @@ +// This is the SIP interface definition for TQVGroupBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQVGroupBox (TQt v2+)</Title> +<Para> +<Literal>TQVGroupBox</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQVGroupBox : TQGroupBox +{ +%TypeHeaderCode +#include <tqvgroupbox.h> +%End + +public: + TQVGroupBox(TQWidget * /TransferThis/ = 0,const char * = 0); + TQVGroupBox(const TQString &,TQWidget * /TransferThis/ = 0,const char * = 0); + +private: + TQVGroupBox(const TQVGroupBox &); +}; diff --git a/sip/tqt/tqwaitcondition.sip b/sip/tqt/tqwaitcondition.sip new file mode 100644 index 0000000..8f96561 --- /dev/null +++ b/sip/tqt/tqwaitcondition.sip @@ -0,0 +1,53 @@ +// This is the SIP interface definition for TQWaitCondition. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQWaitCondition (TQt v2.2+)</Title> +<Para> +<Literal>TQWaitCondition</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_THREAD_SUPPORT) + +class TQWaitCondition +{ +%TypeHeaderCode +#include <tqwaitcondition.h> +%End + +public: + TQWaitCondition(); + + bool wait(unsigned long = ULONG_MAX) /ReleaseGIL/; + bool wait(TQMutex *,unsigned long = ULONG_MAX) /ReleaseGIL/; + + void wakeOne(); + void wakeAll(); + +private: + TQWaitCondition(const TQWaitCondition &); +}; + +%End diff --git a/sip/tqt/tqwhatsthis.sip b/sip/tqt/tqwhatsthis.sip new file mode 100644 index 0000000..b6d5a3a --- /dev/null +++ b/sip/tqt/tqwhatsthis.sip @@ -0,0 +1,60 @@ +// This is the SIP interface definition for TQWhatsThis. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQWhatsThis</Title> +<Para> +<Literal>TQWhatsThis</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQWhatsThis : TQt +{ +%TypeHeaderCode +#include <tqwhatsthis.h> +%End + +public: + TQWhatsThis(TQWidget *); + + virtual TQString text(const TQPoint &); + virtual bool clicked(const TQString &); + + static void setFont(const TQFont &); + + static void add(TQWidget *,const TQString &); + static void remove(TQWidget *); + static TQString textFor(TQWidget *,const TQPoint & = TQPoint(),bool = 0); + + static TQToolButton *whatsThisButton(TQWidget *); + + static void enterWhatsThisMode(); + static bool inWhatsThisMode(); + static void leaveWhatsThisMode(const TQString & = TQString::null, + const TQPoint & = TQCursor::pos(), + TQWidget * = 0); + + static void display(const TQString &,const TQPoint & = TQCursor::pos(), + TQWidget * = 0); +}; diff --git a/sip/tqt/tqwidget.sip b/sip/tqt/tqwidget.sip new file mode 100644 index 0000000..30c3af9 --- /dev/null +++ b/sip/tqt/tqwidget.sip @@ -0,0 +1,410 @@ +// This is the SIP interface definition for TQWidget. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQWidget</Title> +<FuncSynopsis> + <FuncDef>TQWExtra *<Function>extraData</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>TQFocusData *<Function>focusData</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>lower</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>lowerW</Literal> in Python. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>raise</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>raiseW</Literal> in Python. +</Para> +</Sect2> +%End + + +class TQWidget : TQObject, TQPaintDevice +{ +%TypeHeaderCode +#include <tqwidget.h> +%End + +public: + TQWidget(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + WId winId() const; + bool isTopLevel() const; + bool isDialog() const; + bool isPopup() const; + bool isDesktop() const; + bool isModal() const; + bool isEnabled() const; + bool isEnabledTo(TQWidget *) const; + bool isEnabledToTLW() const; + const TQRect &geometry() const; + int x() const; + int y() const; + TQPoint pos() const; + TQSize size() const; + int width() const; + int height() const; + TQRect rect() const; + TQRect childrenRect() const; + TQSize minimumSize() const; + TQSize maximumSize() const; + void setMinimumSize(const TQSize &); + void setMaximumSize(const TQSize &); + void setMinimumWidth(int); + void setMinimumHeight(int); + void setMaximumWidth(int); + void setMaximumHeight(int); + TQSize sizeIncrement() const; + void setSizeIncrement(const TQSize &); + void setFixedSize(const TQSize &); + void setFixedSize(int,int); + void setFixedWidth(int); + void setFixedHeight(int); + TQPoint mapToGlobal(const TQPoint &) const; + TQPoint mapFromGlobal(const TQPoint &) const; + TQPoint mapToParent(const TQPoint &) const; + TQPoint mapFromParent(const TQPoint &) const; + TQPoint mapTo(TQWidget *,const TQPoint &) const; + TQPoint mapFrom(TQWidget *,const TQPoint &) const; + + TQWidget *topLevelWidget() const; + + BackgroundMode backgroundMode() const; + + const TQColor &foregroundColor() const; + + const TQColor &eraseColor() const; + virtual void setEraseColor(const TQColor &); + + const TQPixmap *erasePixmap() const; + virtual void setErasePixmap(const TQPixmap &); + + const TQColorGroup &colorGroup() const; + const TQPalette &palette() const; + bool ownPalette() const; + virtual void setPalette(const TQPalette &); + void unsetPalette(); + + const TQColor &paletteForegroundColor() const; + void setPaletteForegroundColor(const TQColor &); + + const TQColor &paletteBackgroundColor() const; + virtual void setPaletteBackgroundColor(const TQColor &); + + const TQPixmap *paletteBackgroundPixmap() const; + virtual void setPaletteBackgroundPixmap(const TQPixmap &); + + const TQBrush &backgroundBrush() const; + + bool ownFont() const; + virtual void setFont(const TQFont &); + TQFontMetrics fontMetrics() const; + TQFontInfo fontInfo() const; + + const TQCursor &cursor() const; + bool ownCursor() const; + virtual void setCursor(const TQCursor &); + const TQPixmap *icon() const; + bool hasMouseTracking() const; + bool hasMouse() const; + + void clearMask(); + bool isActiveWindow() const; + bool isFocusEnabled() const; + FocusPolicy focusPolicy() const; + bool hasFocus() const; + static void setTabOrder(TQWidget *,TQWidget *); + TQWidget *focusProxy() const; + + void setInputMethodEnabled(bool); + bool isInputMethodEnabled() const; + + void grabMouse(); + void grabMouse(const TQCursor &); + void releaseMouse(); + void grabKeyboard(); + void releaseKeyboard(); + static TQWidget *mouseGrabber(); + static TQWidget *keyboardGrabber(); + bool isUpdatesEnabled() const; + bool isVisible() const; + bool isVisibleTo(TQWidget *) const; + bool isVisibleToTLW() const; + virtual TQSize sizeHint() const; + void erase(); + void erase(int,int,int,int); + void erase(const TQRect &); + void scroll(int,int); + TQWidget *focusWidget() const; + bool acceptDrops() const; + TQWidget *parentWidget(bool = 0) const; + WState testWState(WState) const; + WFlags testWFlags(WFlags) const; + static TQWidget *find(WId); + + TQWidget *childAt(int,int,bool = 0) const; + TQWidget *childAt(const TQPoint &,bool = 0) const; + + void setWindowOpacity(double); + double windowOpacity() const; + + void setName(const char *); + TQStyle &style() const; + void setStyle(TQStyle *); + TQStyle *setStyle(const TQString &); + TQRect frameGeometry() const; + TQSize frameSize() const; + TQRegion childrenRegion() const; + int minimumWidth() const; + int minimumHeight() const; + int maximumWidth() const; + int maximumHeight() const; + virtual void setMinimumSize(int,int); + virtual void setMaximumSize(int,int); + virtual void setSizeIncrement(int,int); + TQSize baseSize() const; + void setBaseSize(const TQSize &); + void setBaseSize(int,int); + + virtual void setBackgroundMode(BackgroundMode); + void setBackgroundMode(BackgroundMode,BackgroundMode); + TQFont font() const; + virtual void unsetCursor(); + TQString caption() const; + TQString iconText() const; + virtual void setMask(const TQBitmap &); + virtual void setMask(const TQRegion &); + + enum FocusPolicy + { + NoFocus = 0, + TabFocus = 1, + ClickFocus = 2, + StrongFocus = 3, + WheelFocus = 7 + }; + + virtual void setActiveWindow(); + virtual void setFocusPolicy(FocusPolicy); + virtual void setFocusProxy(TQWidget *); + virtual bool close(bool); + // Obsolete. + TQRect visibleRect() const; + bool isMinimized() const; + virtual TQSize minimumSizeHint() const; + virtual TQSizePolicy sizePolicy() const; + bool isHidden() const; + bool isMaximized() const; + bool isShown() const; + bool isFullScreen() const; + + uint windowState() const; + void setWindowState(uint); + + virtual void setSizePolicy(TQSizePolicy); + void setSizePolicy(TQSizePolicy::SizeType,TQSizePolicy::SizeType, + bool = 0); + virtual int heightForWidth(int) const; + + TQRegion clipRegion() const; + + TQLayout *layout() const; + void updateGeometry(); + + virtual void reparent(TQWidget * /GetWrapper/,WFlags,const TQPoint &, + bool = 0); +%MethodCode + if (sipCpp -> parent() != a0) + { + if (a0) + sipTransferTo(sipSelf,a0Wrapper); + else + sipTransferBack(sipSelf); + } + + Py_BEGIN_ALLOW_THREADS + sipSelfWasArg ? sipCpp->TQWidget::reparent(a0, a1, *a2, a3) : sipCpp->reparent(a0, a1, *a2, a3); + Py_END_ALLOW_THREADS +%End + + void reparent(TQWidget * /GetWrapper/,const TQPoint &,bool = 0); +%MethodCode + if (sipCpp -> parent() != a0) + { + if (a0) + sipTransferTo(sipSelf,a0Wrapper); + else + sipTransferBack(sipSelf); + } + + Py_BEGIN_ALLOW_THREADS + sipCpp->reparent(a0, *a1, a2); + Py_END_ALLOW_THREADS +%End + + void erase(const TQRegion &); + void scroll(int,int,const TQRect &); + void drawText(int,int,const TQString &); + void drawText(const TQPoint &,const TQString &); + virtual void setAcceptDrops(bool); + virtual void setAutoMask(bool); + bool autoMask() const; + virtual bool customWhatsThis() const; + + TQRect microFocusHint() const; + void unsetFont(); + + enum BackgroundOrigin { + WidgetOrigin, + ParentOrigin, + WindowOrigin, + AncestorOrigin, + }; + + virtual void setBackgroundOrigin(BackgroundOrigin); + BackgroundOrigin backgroundOrigin() const; + + TQPoint backgroundOffset() const; + +public slots: + virtual void adjustSize(); + virtual void setEnabled(bool); + void setDisabled(bool); + void update(); + void update(int,int,int,int); + void update(const TQRect &); + void repaint(int,int,int,int,bool = 1); + void repaint(const TQRect &,bool = 1); + virtual void show(); + virtual void hide(); + void setShown(bool); + void setHidden(bool); + void raise() /PyName=raiseW/; + void lower() /PyName=lowerW/; + virtual void move(int,int); + void move(const TQPoint &); + virtual void resize(int,int); + void resize(const TQSize &); + virtual void setGeometry(int,int,int,int); + + virtual void setCaption(const TQString &); + virtual void setIcon(const TQPixmap &); + virtual void setIconText(const TQString &); + virtual void setMouseTracking(bool); + virtual void setFocus(); + void clearFocus(); + virtual void setUpdatesEnabled(bool); + void repaint(); + void repaint(bool); + void repaint(const TQRegion &,bool = 1); + virtual void showMinimized(); + virtual void showMaximized(); + virtual void showNormal(); + virtual void polish(); + bool close(); + virtual void setGeometry(const TQRect &); + + void showFullScreen(); + void constPolish() const; + + // This was added before v3 but I can't be bothered to work out exactly + // when. + void stackUnder(TQWidget *); + +protected: + bool event(TQEvent *); + virtual void mousePressEvent(TQMouseEvent *); + virtual void mouseReleaseEvent(TQMouseEvent *); + virtual void mouseDoubleClickEvent(TQMouseEvent *); + virtual void mouseMoveEvent(TQMouseEvent *); + virtual void keyPressEvent(TQKeyEvent *); + virtual void keyReleaseEvent(TQKeyEvent *); + virtual void focusInEvent(TQFocusEvent *); + virtual void focusOutEvent(TQFocusEvent *); + virtual void enterEvent(TQEvent *); + virtual void leaveEvent(TQEvent *); + virtual void paintEvent(TQPaintEvent *); + virtual void moveEvent(TQMoveEvent *); + virtual void resizeEvent(TQResizeEvent *); + virtual void closeEvent(TQCloseEvent *); + virtual void contextMenuEvent(TQContextMenuEvent *); + virtual void imStartEvent(TQIMEvent *); + virtual void imComposeEvent(TQIMEvent *); + virtual void imEndEvent(TQIMEvent *); + virtual void tabletEvent(TQTabletEvent *); + virtual void enabledChange(bool); + virtual void paletteChange(const TQPalette &); + virtual void fontChange(const TQFont &); + virtual void windowActivationChange(bool); + void resetInputContext(); + WFlags getWFlags() const; + void clearWFlags(WFlags); + virtual bool focusNextPrevChild(bool); +// TQWExtra *extraData(); +// TQFocusData *focusData(); + + virtual void wheelEvent(TQWheelEvent *); +%If (TQt_DRAGANDDROP) + virtual void dragEnterEvent(TQDragEnterEvent *); + virtual void dragMoveEvent(TQDragMoveEvent *); + virtual void dragLeaveEvent(TQDragLeaveEvent *); + virtual void dropEvent(TQDropEvent *); +%End + virtual void showEvent(TQShowEvent *); + virtual void hideEvent(TQHideEvent *); + virtual void customEvent(TQCustomEvent *); + + virtual void updateMask(); + + virtual void styleChange(TQStyle &); + int metric(int) const; + virtual void create(WId = 0,bool = 1,bool = 1); + virtual void destroy(bool = 1,bool = 1); + uint getWState() const; + virtual void setWState(uint); + void clearWState(uint); + virtual void setWFlags(WFlags); + virtual void setKeyCompression(bool); + virtual void setMicroFocusHint(int,int,int,int,bool = 1,TQFont * = 0); + +private: + TQWidget(const TQWidget &); +}; diff --git a/sip/tqt/tqwidgetlist.sip b/sip/tqt/tqwidgetlist.sip new file mode 100644 index 0000000..9010b86 --- /dev/null +++ b/sip/tqt/tqwidgetlist.sip @@ -0,0 +1,107 @@ +// This is the SIP interface definition for TQWidgetList. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQWidgetList</Title> +<Para> +This class isn't implemented. Whenever a <Literal>TQWidgetList</Literal> is the +return type of a function or the type of an argument, a Python list of +instances is used instead. +</Para> +</Sect2> +%End + + +%MappedType TQWidgetList +{ +%TypeHeaderCode +#include <tqwidgetlist.h> +%End + +%ConvertFromTypeCode + // Convert the list. + + PyObject *pl; + TQWidget *obj; + + if ((pl = PyList_New(0)) == NULL) + return NULL; + + for (TQWidgetListIt it(*sipCpp); (obj = it.current()) != NULL; ++it) + { + PyObject *inst; + + if ((inst = sipConvertFromInstance(obj,sipClass_TQWidget,sipTransferObj)) == NULL || PyList_Append(pl,inst) < 0) + { + Py_XDECREF(inst); + Py_DECREF(pl); + + return NULL; + } + + Py_DECREF(inst); + } + + return pl; +%End + +%ConvertToTypeCode + // Convert a Python list of TQWidget instances to a TQWidgetList on the + // heap. + + if (sipIsErr == NULL) + { + if (!PyList_Check(sipPy)) + return 0; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_TQWidget,0)) + return 0; + + return 1; + } + + TQWidgetList *qwl = new TQWidgetList; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + TQWidget *qw; + + // We apply the transfer to the list itself, not the elements. + // Note that any temporary element will never be destroyed. + // There is nothing that can be done about this. + qw = reinterpret_cast<TQWidget *>(sipConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_TQWidget,0,0,0,sipIsErr)); + + if (*sipIsErr) + { + delete qwl; + return 0; + } + + qwl -> append(qw); + } + + *sipCppPtr = qwl; + + return sipGetState(sipTransferObj); +%End +}; diff --git a/sip/tqt/tqwidgetstack.sip b/sip/tqt/tqwidgetstack.sip new file mode 100644 index 0000000..9451970 --- /dev/null +++ b/sip/tqt/tqwidgetstack.sip @@ -0,0 +1,76 @@ +// This is the SIP interface definition for TQWidgetStack. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQWidgetStack</Title> +<Para> +<Literal>TQWidgetStack</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class TQWidgetStack : TQFrame +{ +%TypeHeaderCode +#include <tqwidgetstack.h> +%End + +public: + TQWidgetStack(TQWidget * /TransferThis/ = 0,const char * = 0); + TQWidgetStack(TQWidget * /TransferThis/,const char *,WFlags); + + // The TQWidget has it's parent changed to be `this' so it will be + // deleted automatically when `this' is deleted. It stays this way + // even if removeWidget() is called, so it isn't transferred back. + int addWidget(TQWidget * /Transfer/,int = -1); + void removeWidget(TQWidget *); + + TQSize sizeHint() const; + TQSize minimumSizeHint() const; + void show(); + + TQWidget *widget(int) const; + int id(TQWidget *) const; + + TQWidget *visibleWidget() const; + + void setFrameRect(const TQRect &); + +signals: + void aboutToShow(int); + void aboutToShow(TQWidget *); + +public slots: + void raiseWidget(int); + void raiseWidget(TQWidget *); + +protected: + void frameChanged(); + void resizeEvent(TQResizeEvent *); + + virtual void setChildGeometries(); + void childEvent(TQChildEvent *); + +private: + TQWidgetStack(const TQWidgetStack &); +}; diff --git a/sip/tqt/tqwindowdefs.sip b/sip/tqt/tqwindowdefs.sip new file mode 100644 index 0000000..195f273 --- /dev/null +++ b/sip/tqt/tqwindowdefs.sip @@ -0,0 +1,51 @@ +// This is the SIP interface definition for a variety of constant definitions. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQt Constants</Title> +<Para> +All constant values defined by TQt have equivalent constants defined to Python. +</Para> +</Sect2> +%End + + +%ModuleHeaderCode +#include <tqwindowdefs.h> +%End + + +%OptionalInclude tqwindowdefs_mac.sip +%OptionalInclude tqwindowdefs_qws.sip +%OptionalInclude tqwindowdefs_win.sip +%OptionalInclude tqwindowdefs_x11.sip + + +typedef TQ_INT32 TQCOORD; + +const TQCOORD TQCOORD_MIN; +const TQCOORD TQCOORD_MAX; + + +typedef unsigned TQRgb; + +const char *tqAppName(); diff --git a/sip/tqt/tqwindowdefs_qws.sip b/sip/tqt/tqwindowdefs_qws.sip new file mode 100644 index 0000000..e6493df --- /dev/null +++ b/sip/tqt/tqwindowdefs_qws.sip @@ -0,0 +1,29 @@ +// This is the SIP interface definition for a variety of constant definitions +// for TQt/Embedded. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%If (WS_QWS) + +typedef unsigned WId; +typedef void *HANDLE; + +%End diff --git a/sip/tqt/tqwindowdefs_x11.sip b/sip/tqt/tqwindowdefs_x11.sip new file mode 100644 index 0000000..db45346 --- /dev/null +++ b/sip/tqt/tqwindowdefs_x11.sip @@ -0,0 +1,37 @@ +// This is the SIP interface definition for a variety of constant definitions +// for X11. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%If (WS_X11) + +typedef unsigned long WId; + +typedef void Display; + +Display *tqt_xdisplay(); +int tqt_xscreen(); +WId tqt_xrootwin(); +WId tqt_xrootwin(int); + +const char *tqAppClass(); + +%End diff --git a/sip/tqt/tqwindowsstyle.sip b/sip/tqt/tqwindowsstyle.sip new file mode 100644 index 0000000..72e5f83 --- /dev/null +++ b/sip/tqt/tqwindowsstyle.sip @@ -0,0 +1,120 @@ +// This is the SIP interface definition for TQWindowsStyle. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQWindowsStyle (TQt v2+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>getButtonShift</Function></FuncDef> + <ParamDef>int &<Parameter>x</Parameter></ParamDef> + <ParamDef>int &<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>x</Literal> and +<Literal>y</Literal> values. (TQt v2) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const TQTabBar *<Parameter>sb</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>sb</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +(TQt v2) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>tabbarMetrics</Function></FuncDef> + <ParamDef>const TQTabBar *<Parameter>t</Parameter></ParamDef> + <ParamDef>int &<Parameter>hframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>vframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>overlap</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>t</Literal> parameter and returns a tuple of the +<Literal>hframe</Literal>, <Literal>vframe</Literal> and +<Literal>overlap</Literal> values. (TQt v2) +</Para> +</Sect2> +%End + + +%If (TQt_STYLE_WINDOWS) + +class TQWindowsStyle : TQCommonStyle +{ +%TypeHeaderCode +#include <tqwindowsstyle.h> +%End + +public: + TQWindowsStyle(); + + void applicationPolish(const TQStyleControlElementData&, ControlElementFlags, void *); + void applicationUnPolish(const TQStyleControlElementData&, ControlElementFlags, void *); + + void polish(const TQStyleControlElementData&, ControlElementFlags, void *); + void unPolish(const TQStyleControlElementData&, ControlElementFlags, void *); + + void polish( TQPalette & ); + + virtual void polishPopupMenu( const TQStyleControlElementData&, ControlElementFlags, void * ); + + void drawPrimitive(PrimitiveElement,TQPainter *,const TQStyleControlElementData&,ControlElementFlags,const TQRect &, + const TQColorGroup &,SFlags = Style_Default, + const TQStyleOption & = TQStyleOption()) const; + + void drawControl(ControlElement,TQPainter *,const TQStyleControlElementData&,ControlElementFlags, + const TQRect &,const TQColorGroup &, + SFlags = Style_Default, + const TQStyleOption & = TQStyleOption(), const TQWidget *=0) const; + + void drawComplexControl(ComplexControl,TQPainter *,const TQStyleControlElementData&,ControlElementFlags, + const TQRect &,const TQColorGroup &, + SFlags = Style_Default,SCFlags = SC_All, + SCFlags = SC_None, + const TQStyleOption & = TQStyleOption(),const TQWidget *=0) const; + + int pixelMetric(PixelMetric,const TQStyleControlElementData&,ControlElementFlags,const TQWidget * = 0) const; + + TQSize sizeFromContents(ContentsType,const TQStyleControlElementData&,ControlElementFlags,const TQSize &, + const TQStyleOption & = TQStyleOption(),const TQWidget *=0) const; + + int styleHint(StyleHint,const TQStyleControlElementData&,ControlElementFlags, + const TQStyleOption & = TQStyleOption(), + TQStyleHintReturn * = 0, const TQWidget * = 0) const; + + TQPixmap stylePixmap(StylePixmap,const TQStyleControlElementData&,ControlElementFlags, + const TQStyleOption & = TQStyleOption(), const TQWidget * = 0) const; + + TQRect subRect(SubRect,const TQStyleControlElementData&, const ControlElementFlags,const TQWidget *) const; + +private: + TQWindowsStyle(const TQWindowsStyle &); +}; + +%End diff --git a/sip/tqt/tqwindowsxpstyle.sip b/sip/tqt/tqwindowsxpstyle.sip new file mode 100644 index 0000000..121e03b --- /dev/null +++ b/sip/tqt/tqwindowsxpstyle.sip @@ -0,0 +1,31 @@ +// This is the SIP interface definition for TQWindowsXPStyle. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQWindowsXPStyle (TQt v3.0.1+, Windows)</Title> +<Para> +<Literal>TQWindowsXPStyle</Literal> is fully implemented. +</Para> +</Sect2> +%End + + diff --git a/sip/tqt/tqwizard.sip b/sip/tqt/tqwizard.sip new file mode 100644 index 0000000..278be85 --- /dev/null +++ b/sip/tqt/tqwizard.sip @@ -0,0 +1,102 @@ +// This is the SIP interface definition for TQWizard. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQWizard (TQt v2+)</Title> +<Para> +<Literal>TQWizard</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_WIZARD) + +class TQWizard : TQDialog +{ +%TypeHeaderCode +#include <tqwizard.h> +%End + +public: + TQWizard(TQWidget * /TransferThis/ = 0,const char * = 0,bool = 0, + WFlags = 0); + + void show(); + + void setFont(const TQFont &); + + // The TQWidget is passed to TQWidgetStack::addWidget(). + virtual void addPage(TQWidget * /Transfer/, const TQString &); + // The TQWidget is passed to TQWidgetStack::addWidget(). + virtual void insertPage(TQWidget * /Transfer/, const TQString &,int); + virtual void removePage(TQWidget *); + + TQString title(TQWidget *) const; + void setTitle(TQWidget *,const TQString &); + TQFont titleFont() const; + void setTitleFont(const TQFont &); + + virtual void showPage(TQWidget *); + + TQWidget *currentPage() const; + + TQWidget *page(int) const; + int pageCount() const; + int indexOf(TQWidget *) const; + + virtual bool appropriate(TQWidget *) const; + virtual void setAppropriate(TQWidget *,bool); + + TQPushButton *backButton() const; + TQPushButton *nextButton() const; + TQPushButton *finishButton() const; + TQPushButton *cancelButton() const; + TQPushButton *helpButton() const; + + bool eventFilter(TQObject *,TQEvent *); + +public slots: + virtual void setBackEnabled(TQWidget *,bool); + virtual void setNextEnabled(TQWidget *,bool); + virtual void setFinishEnabled(TQWidget *,bool); + + virtual void setHelpEnabled(TQWidget *,bool); + +protected slots: + virtual void back(); + virtual void next(); + virtual void help(); + +signals: + void helpClicked(); + void selected(const TQString &); + +protected: + virtual void layOutButtonRow(TQHBoxLayout *); + virtual void layOutTitleRow(TQHBoxLayout *,const TQString &); + +private: + TQWizard(const TQWizard &); +}; + +%End diff --git a/sip/tqt/tqwmatrix.sip b/sip/tqt/tqwmatrix.sip new file mode 100644 index 0000000..965130e --- /dev/null +++ b/sip/tqt/tqwmatrix.sip @@ -0,0 +1,142 @@ +// This is the SIP interface definition for TQWMatrix. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQWMatrix</Title> +<Para> +The Python <Literal>==</Literal>, <Literal>!=</Literal> and +<Literal>*=</Literal> operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>TQWMatrix <Function>invert</Function> const</FuncDef> + <ParamDef>bool *<Parameter>invertible</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>TQWMatrix</Literal> +result and the <Literal>invertible</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>map</Function> const</FuncDef> + <ParamDef>int <Parameter>x</Parameter></ParamDef> + <ParamDef>int <Parameter>y</Parameter></ParamDef> + <ParamDef>int *<Parameter>tx</Parameter></ParamDef> + <ParamDef>int *<Parameter>ty</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>x</Literal> and <Literal>y</Literal> parameters and +returns a tuple containing the <Literal>tx</Literal> and <Literal>ty</Literal> +values. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>map</Function> const</FuncDef> + <ParamDef>float <Parameter>x</Parameter></ParamDef> + <ParamDef>float <Parameter>y</Parameter></ParamDef> + <ParamDef>float *<Parameter>tx</Parameter></ParamDef> + <ParamDef>float *<Parameter>ty</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>x</Literal> and <Literal>y</Literal> parameters and +returns a tuple containing the <Literal>tx</Literal> and <Literal>ty</Literal> +values. (TQt v1.x) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>map</Function> const</FuncDef> + <ParamDef>double <Parameter>x</Parameter></ParamDef> + <ParamDef>double <Parameter>y</Parameter></ParamDef> + <ParamDef>double *<Parameter>tx</Parameter></ParamDef> + <ParamDef>double *<Parameter>ty</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>x</Literal> and <Literal>y</Literal> parameters and +returns a tuple containing the <Literal>tx</Literal> and <Literal>ty</Literal> +values. (TQt v2+) +</Para> +</Sect2> +%End + + +class TQWMatrix +{ +%TypeHeaderCode +#include <tqwmatrix.h> +%End + +public: + TQWMatrix(); + TQWMatrix(double,double,double,double,double,double); + + void map(int /Constrained/,int /Constrained/,int *,int *) const; + + TQRect mapRect(const TQRect &) const; + + TQPoint map(const TQPoint &) const; + TQRect map(const TQRect &); const + TQPointArray map(const TQPointArray &) const; + TQRegion map(const TQRegion &) const; + TQRegion mapToRegion(const TQRect &) const; + TQPointArray mapToPolygon(const TQRect &) const; + + void reset(); + bool isIdentity() const; + + bool isInvertible() const; + double det() const; + + TQWMatrix invert(bool * = 0) const; + + bool operator==(const TQWMatrix &) const; + bool operator!=(const TQWMatrix &) const; + TQWMatrix &operator*=(const TQWMatrix &); + + // These aren't documented but are used in TQt examples. + TQPoint operator*(const TQPoint &) const; + TQRegion operator*(const TQRect &) const; + TQRegion operator*(const TQRegion &) const; + TQPointArray operator*(const TQPointArray &) const; + + enum TransformationMode { + Points, + Areas + }; + + static void setTransformationMode(TransformationMode); + static TransformationMode transformationMode(); + + void setMatrix(double,double,double,double,double,double); + double m11(); + double m12(); + double m21(); + double m22(); + double dx(); + double dy(); + + void map(double,double,double *,double *) const; + + TQWMatrix &translate(double,double); + TQWMatrix &scale(double,double); + TQWMatrix &shear(double,double); + TQWMatrix &rotate(double); +}; diff --git a/sip/tqt/tqworkspace.sip b/sip/tqt/tqworkspace.sip new file mode 100644 index 0000000..06b85be --- /dev/null +++ b/sip/tqt/tqworkspace.sip @@ -0,0 +1,84 @@ +// This is the SIP interface definition for TQWorkspace. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +%ExportedDoc +<Sect2><Title>TQWorkspace (TQt v2.1+)</Title> +<Para> +<Literal>TQWorkspace</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (TQt_WORKSPACE) + +class TQWorkspace : TQWidget +{ +%TypeHeaderCode +#include <tqworkspace.h> +%End + +public: + TQWorkspace(TQWidget * /TransferThis/ = 0,const char * = 0); + + enum WindowOrder { + CreationOrder, + StackingOrder + }; + + TQWidget *activeWindow() const; + TQWidgetList windowList() const; + TQWidgetList windowList(WindowOrder) const; + + TQSize sizeHint() const; + + bool scrollBarsEnabled() const; + void setScrollBarsEnabled(bool); + + void setPaletteBackgroundColor(const TQColor &); + void setPaletteBackgroundPixmap(const TQPixmap &); + +signals: + void windowActivated(TQWidget *); + +public slots: + void cascade(); + void tile(); + void closeActiveWindow(); + void closeAllWindows(); + void activateNextWindow(); + void activatePrevWindow(); + +protected: + void styleChange(TQStyle &); + void childEvent(TQChildEvent *); + void resizeEvent(TQResizeEvent *); + bool eventFilter(TQObject *,TQEvent *); + void showEvent(TQShowEvent *); + void hideEvent(TQHideEvent *); + void wheelEvent(TQWheelEvent *); + +private: + TQWorkspace(const TQWorkspace &); +}; + +%End diff --git a/sip/tqt/versions.sip b/sip/tqt/versions.sip new file mode 100644 index 0000000..f47b1e0 --- /dev/null +++ b/sip/tqt/versions.sip @@ -0,0 +1,92 @@ +// This defines the different versions of TQt that PyTQt knows about. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// This file is part of PyTQt. +// +// This copy of PyTQt is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2, or (at your option) any later +// version. +// +// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +// Specify the releases over time - not all of them, just those that introduce +// something new. +%Timeline {TQt_1_43 + TQt_2_00 TQt_2_1_0 TQt_2_2_0 TQt_2_3_0 TQt_2_3_1 + TQt_3_0_0 TQt_3_0_1 TQt_3_0_2 TQt_3_0_4 TQt_3_0_5 TQt_3_0_6 + TQt_3_1_0 TQt_3_1_1 TQt_3_1_2 + TQt_3_2_0 + TQt_3_3_0 TQt_3_3_5 TQt_3_3_6} + + +// Specify the platforms. +%Platforms {WS_X11 WS_WIN WS_QWS WS_MACX} + + +// Specify the features. +%Feature TQt_THREAD_SUPPORT + +%Feature TQt_ACTION +%Feature TQt_ASSISTANTCLIENT +%Feature TQt_CLIPBOARD +%Feature TQt_CODECS +%Feature TQt_COLORDIALOG +%Feature TQt_DATASTREAM +%Feature TQt_DIAL +%Feature TQt_DNS +%Feature TQt_DOM +%Feature TQt_DRAGANDDROP +%Feature TQt_ICONVIEW +%Feature TQt_IMAGE_TEXT +%Feature TQt_INPUTDIALOG +%Feature TQt_FILEDIALOG +%Feature TQt_FONTDATABASE +%Feature TQt_FONTDIALOG +%Feature TQt_MESSAGEBOX +%Feature TQt_MIMECLIPBOARD +%Feature TQt_NETWORKPROTOCOL +%Feature TQt_NETWORKPROTOCOL_FTP +%Feature TQt_NETWORKPROTOCOL_HTTP +%Feature TQt_PICTURE +%Feature TQt_PRINTDIALOG +%Feature TQt_PRINTER +%Feature TQt_PROGRESSDIALOG +%Feature TQt_PROPERTIES +%Feature TQt_SEMIMODAL +%Feature TQt_SIZEGRIP +%Feature TQt_SOUND +%Feature TQt_SPLITTER +%Feature TQt_STYLE_CDE +%Feature TQt_STYLE_INTERLACE +%Feature TQt_STYLE_MOTIF +%Feature TQt_STYLE_MOTIFPLUS +%Feature TQt_STYLE_PLATINUM +%Feature TQt_STYLE_SGI +%Feature TQt_STYLE_WINDOWS +%Feature TQt_STYLE_WINDOWSXP +%Feature TQt_TABDIALOG +%Feature TQt_TABLE +%Feature TQt_TABLEVIEW +%Feature TQt_TRANSFORMATIONS +%Feature TQt_TRANSLATION +%Feature TQt_WIZARD +%Feature TQt_WORKSPACE + +// On Windows64 TQ_LONG is defined as __int64 (which SIP doesn't handle) so +// this feature is disabled. +%Feature TQt_TQ_LONG_IS_long + +// SIP v4.7.3 and later support automatic generation of missing complementary +// comparison operators. This fixes a problem with v4.7.2. +%Feature TQt_SIP_PRE_4_7_2 |