From 16434e5519f6224e231bc5f7202f0e495eda7bb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Tue, 3 Jan 2023 00:52:18 +0100 Subject: 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. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- build.py | 184 +- configure.py | 652 +- doc/PyQt.html | 12845 ------------------------- doc/PyQt.sgml | 5807 ----------- doc/PyTQt.html | 12845 +++++++++++++++++++++++++ doc/PyTQt.sgml | 5807 +++++++++++ doc/qtdocs.sip | 1915 ---- doc/tqtdocs.sip | 1915 ++++ examples/SQL/README | 4 +- examples/SQL/connect.ui.h | 2 +- examples/SQL/dbconnect.py | 6 +- examples/SQL/frmconnect.py | 4 +- examples/SQL/runform1.py | 2 +- examples/SQL/runform2.py | 2 +- examples/SQL/runsqlex.py | 4 +- examples/SQL/sqlcustom1.py | 4 +- examples/SQL/sqlsubclass5.py | 4 +- examples/SQL/sqltable4.py | 4 +- examples/aclock.py | 4 +- examples/addressbook.py | 2 +- examples/application.py | 2 +- examples/biff.py | 2 +- examples/bigtable.py | 4 +- examples/buttongroups.py | 4 +- examples/canvas/canvas.py | 10 +- examples/canvas/qt-trans.xpm | 54 - examples/canvas/qtlogo.png | Bin 22603 -> 0 bytes examples/canvas/tqt-trans.xpm | 54 + examples/canvas/tqtlogo.png | Bin 0 -> 22603 bytes examples/checklists.py | 2 +- examples/cursor.py | 2 +- examples/dclock.py | 2 +- examples/desktop.py | 2 +- examples/dirview.py | 2 +- examples/dragdrop.py | 2 +- examples/drawlines.py | 2 +- examples/dropsite.py | 4 +- examples/fontdisplayer.py | 2 +- examples/fonts.py | 2 +- examples/gears.py | 4 +- examples/i18n/i18n.py | 2 +- examples/i18n/mywidget.py | 2 +- examples/lineedits.py | 2 +- examples/listbox.py | 2 +- examples/listboxcombo.py | 4 +- examples/mdi.py | 2 +- examples/menu.py | 2 +- examples/progress.py | 2 +- examples/progressbar.py | 2 +- examples/qdir.py | 324 - examples/qmag.py | 233 - examples/qt.png | Bin 355 -> 0 bytes examples/qtlogo.png | Bin 12634 -> 0 bytes examples/rangecontrols.py | 2 +- examples/richtext.py | 2 +- examples/secret.py | 2 +- examples/semaphore.py | 4 +- examples/smalltable.py | 4 +- examples/splitter.py | 2 +- examples/tabdialog.py | 2 +- examples/tablestatistics.py | 12 +- examples/tooltip.py | 2 +- examples/tqdir.py | 324 + examples/tqmag.py | 233 + examples/tqt.png | Bin 0 -> 355 bytes examples/tqtlogo.png | Bin 0 -> 12634 bytes examples/tut1.py | 6 +- examples/tut10.py | 66 +- examples/tut11.py | 92 +- examples/tut12.py | 116 +- examples/tut13.py | 152 +- examples/tut14.py | 176 +- examples/tut2.py | 10 +- examples/tut3.py | 12 +- examples/tut4.py | 14 +- examples/tut5.py | 20 +- examples/tut6.py | 26 +- examples/tut7.py | 30 +- examples/tut8.py | 46 +- examples/tut9.py | 56 +- examples/webbrowser/mainwindow.py | 8 +- examples/webbrowser/webbrowser.py | 18 +- examples/widgets.py | 8 +- module-init.py | 30 +- pylupdate3/LICENSE.GPL | 280 - pylupdate3/fetchtr.cpp | 455 - pylupdate3/main.cpp | 155 - pylupdate3/merge.cpp | 110 - pylupdate3/metatranslator.cpp | 557 -- pylupdate3/metatranslator.h | 95 - pylupdate3/numberh.cpp | 230 - pylupdate3/proparser.cpp | 78 - pylupdate3/proparser.h | 25 - pylupdate3/pylupdate-prof.sbf | 24 - pylupdate3/pylupdate.pro.in | 29 - pylupdate3/pylupdate.sbf | 24 - pylupdate3/sametexth.cpp | 78 - pyqtconfig.py.in | 187 - pytqlupdate3/LICENSE.GPL | 280 + pytqlupdate3/fetchtr.cpp | 455 + pytqlupdate3/main.cpp | 155 + pytqlupdate3/merge.cpp | 110 + pytqlupdate3/metatranslator.cpp | 557 ++ pytqlupdate3/metatranslator.h | 95 + pytqlupdate3/numberh.cpp | 230 + pytqlupdate3/proparser.cpp | 78 + pytqlupdate3/proparser.h | 25 + pytqlupdate3/pytqlupdate-prof.sbf | 24 + pytqlupdate3/pytqlupdate.pro.in | 29 + pytqlupdate3/pytqlupdate.sbf | 24 + pytqlupdate3/sametexth.cpp | 78 + pytqtconfig.py.in | 187 + pytquic3/LICENSE.GPL | 280 + pytquic3/domtool.cpp | 447 + pytquic3/domtool.h | 47 + pytquic3/embed.cpp | 322 + pytquic3/form.cpp | 938 ++ pytquic3/globaldefs.h | 56 + pytquic3/main.cpp | 244 + pytquic3/object.cpp | 704 ++ pytquic3/parser.cpp | 66 + pytquic3/parser.h | 33 + pytquic3/pytquic-prof.sbf | 24 + pytquic3/pytquic.pro.in | 36 + pytquic3/pytquic.sbf | 24 + pytquic3/subclassing.cpp | 185 + pytquic3/uic.cpp | 1145 +++ pytquic3/uic.h | 183 + pytquic3/widgetdatabase.cpp | 953 ++ pytquic3/widgetdatabase.h | 96 + pytquic3/widgetinterface.h | 29 + pyuic3/LICENSE.GPL | 280 - pyuic3/domtool.cpp | 447 - pyuic3/domtool.h | 47 - pyuic3/embed.cpp | 322 - pyuic3/form.cpp | 938 -- pyuic3/globaldefs.h | 56 - pyuic3/main.cpp | 244 - pyuic3/object.cpp | 704 -- pyuic3/parser.cpp | 66 - pyuic3/parser.h | 33 - pyuic3/pyuic-prof.sbf | 24 - pyuic3/pyuic.pro.in | 36 - pyuic3/pyuic.sbf | 24 - pyuic3/subclassing.cpp | 185 - pyuic3/uic.cpp | 1145 --- pyuic3/uic.h | 183 - pyuic3/widgetdatabase.cpp | 953 -- pyuic3/widgetdatabase.h | 96 - pyuic3/widgetinterface.h | 29 - sip/pyqt-gpl.sip | 1 - sip/pytqt-gpl.sip | 1 + sip/qt/copying.sip | 51 - sip/qt/qaccel.sip | 80 - sip/qt/qaction.sip | 148 - sip/qt/qapplication.sip | 467 - sip/qt/qassistantclient.sip | 59 - sip/qt/qbitmap.sip | 48 - sip/qt/qbrush.sip | 55 - sip/qt/qbutton.sip | 115 - sip/qt/qbuttongroup.sip | 82 - sip/qt/qbytearray.sip | 244 - sip/qt/qcdestyle.sip | 55 - sip/qt/qcheckbox.sip | 63 - sip/qt/qclipboard.sip | 132 - sip/qt/qcolor.sip | 156 - sip/qt/qcolordialog.sip | 64 - sip/qt/qcolorgroup.sip | 89 - sip/qt/qcombobox.sip | 148 - sip/qt/qcommonstyle.sip | 105 - sip/qt/qcstring.sip | 217 - sip/qt/qcursor.sip | 69 - sip/qt/qdatastream.sip | 218 - sip/qt/qdatetime.sip | 226 - sip/qt/qdatetimeedit.sip | 220 - sip/qt/qdesktopwidget.sip | 70 - sip/qt/qdial.sip | 105 - sip/qt/qdialog.sip | 119 - sip/qt/qdir.sip | 292 - sip/qt/qdockarea.sip | 84 - sip/qt/qdockwindow.sip | 125 - sip/qt/qdragobject.sip | 231 - sip/qt/qdrawutil.sip | 56 - sip/qt/qdropsite.sip | 44 - sip/qt/qerrormessage.sip | 51 - sip/qt/qevent.sip | 857 -- sip/qt/qeventloop.sip | 83 - sip/qt/qfile.sip | 199 - sip/qt/qfiledialog.sip | 224 - sip/qt/qfileinfo.sip | 94 - sip/qt/qfont.sip | 236 - sip/qt/qfontdatabase.sip | 71 - sip/qt/qfontdialog.sip | 73 - sip/qt/qfontinfo.sip | 56 - sip/qt/qfontmetrics.sip | 167 - sip/qt/qframe.sip | 100 - sip/qt/qglobal.sip | 67 - sip/qt/qgrid.sip | 51 - sip/qt/qgridview.sip | 72 - sip/qt/qgroupbox.sip | 92 - sip/qt/qhbox.sip | 52 - sip/qt/qhbuttongroup.sip | 44 - sip/qt/qheader.sip | 127 - sip/qt/qhgroupbox.sip | 44 - sip/qt/qiconset.sip | 107 - sip/qt/qiconview.sip | 381 - sip/qt/qimage.sip | 448 - sip/qt/qinputdialog.sip | 157 - sip/qt/qinterlacestyle.sip | 103 - sip/qt/qiodevice.sip | 257 - sip/qt/qkeysequence.sip | 113 - sip/qt/qlabel.sip | 85 - sip/qt/qlayout.sip | 458 - sip/qt/qlcdnumber.sip | 93 - sip/qt/qlibrary.sip | 55 - sip/qt/qlineedit.sip | 209 - sip/qt/qlistbox.sip | 333 - sip/qt/qlistview.sip | 491 - sip/qt/qlocale.sip | 533 - sip/qt/qmainwindow.sip | 171 - sip/qt/qmemarray.sip | 164 - sip/qt/qmenubar.sip | 97 - sip/qt/qmenudata.sip | 190 - sip/qt/qmessagebox.sip | 139 - sip/qt/qmetaobject.sip | 117 - sip/qt/qmime.sip | 88 - sip/qt/qmotifplusstyle.sip | 102 - sip/qt/qmotifstyle.sip | 112 - sip/qt/qmovie.sip | 98 - sip/qt/qmultilinedit.sip | 134 - sip/qt/qmutex.sip | 74 - sip/qt/qnamespace.sip | 746 -- sip/qt/qnetworkprotocol.sip | 186 - sip/qt/qobject.sip | 2086 ---- sip/qt/qobjectcleanuphandler.sip | 45 - sip/qt/qobjectlist.sip | 107 - sip/qt/qpaintdevice.sip | 170 - sip/qt/qpaintdevicemetrics.sip | 51 - sip/qt/qpainter.sip | 360 - sip/qt/qpair.sip | 79 - sip/qt/qpalette.sip | 82 - sip/qt/qpen.sip | 59 - sip/qt/qpicture.sip | 81 - sip/qt/qpixmap.sip | 165 - sip/qt/qpixmapcache.sip | 47 - sip/qt/qplatinumstyle.sip | 85 - sip/qt/qpoint.sip | 98 - sip/qt/qpointarray.sip | 230 - sip/qt/qpopupmenu.sip | 166 - sip/qt/qprintdialog.sip | 57 - sip/qt/qprinter.sip | 174 - sip/qt/qprocess.sip | 106 - sip/qt/qprogressbar.sip | 73 - sip/qt/qprogressdialog.sip | 97 - sip/qt/qptrlist.sip | 107 - sip/qt/qpushbutton.sip | 83 - sip/qt/qradiobutton.sip | 59 - sip/qt/qrangecontrol.sip | 73 - sip/qt/qrect.sip | 194 - sip/qt/qregexp.sip | 102 - sip/qt/qregion.sip | 122 - sip/qt/qscrollbar.sip | 102 - sip/qt/qscrollview.sip | 230 - sip/qt/qsemaphore.sip | 84 - sip/qt/qsessionmanager.sip | 72 - sip/qt/qsettings.sip | 163 - sip/qt/qsgistyle.sip | 92 - sip/qt/qsignalmapper.sip | 51 - sip/qt/qsimplerichtext.sip | 64 - sip/qt/qsize.sip | 108 - sip/qt/qsizegrip.sip | 53 - sip/qt/qsizepolicy.sip | 85 - sip/qt/qslider.sip | 119 - sip/qt/qsocketnotifier.sip | 61 - sip/qt/qsound.sip | 58 - sip/qt/qspinbox.sip | 122 - sip/qt/qsplashscreen.sip | 57 - sip/qt/qsplitter.sip | 102 - sip/qt/qstatusbar.sip | 65 - sip/qt/qstring.sip | 946 -- sip/qt/qstringlist.sip | 227 - sip/qt/qstrlist.sip | 104 - sip/qt/qstyle.sip | 841 -- sip/qt/qstylefactory.sip | 41 - sip/qt/qstylesheet.sip | 194 - sip/qt/qsyntaxhighlighter.sip | 51 - sip/qt/qtabbar.sip | 180 - sip/qt/qtabdialog.sip | 108 - sip/qt/qtabwidget.sip | 120 - sip/qt/qtextbrowser.sip | 65 - sip/qt/qtextcodec.sip | 132 - sip/qt/qtextedit.sip | 402 - sip/qt/qtextstream.sip | 199 - sip/qt/qtextview.sip | 45 - sip/qt/qthread.sip | 83 - sip/qt/qtimer.sip | 57 - sip/qt/qtmod.sip | 279 - sip/qt/qtoolbar.sip | 73 - sip/qt/qtoolbox.sip | 84 - sip/qt/qtoolbutton.sip | 105 - sip/qt/qtooltip.sip | 105 - sip/qt/qtranslator.sip | 113 - sip/qt/qurl.sip | 110 - sip/qt/qurlinfo.sip | 90 - sip/qt/qurloperator.sip | 96 - sip/qt/quuid.sip | 74 - sip/qt/qvalidator.sip | 169 - sip/qt/qvaluelist.sip | 173 - sip/qt/qvariant.sip | 378 - sip/qt/qvbox.sip | 43 - sip/qt/qvbuttongroup.sip | 44 - sip/qt/qvgroupbox.sip | 44 - sip/qt/qwaitcondition.sip | 53 - sip/qt/qwhatsthis.sip | 60 - sip/qt/qwidget.sip | 410 - sip/qt/qwidgetlist.sip | 107 - sip/qt/qwidgetstack.sip | 76 - sip/qt/qwindowdefs.sip | 51 - sip/qt/qwindowdefs_qws.sip | 29 - sip/qt/qwindowdefs_x11.sip | 37 - sip/qt/qwindowsstyle.sip | 120 - sip/qt/qwindowsxpstyle.sip | 31 - sip/qt/qwizard.sip | 102 - sip/qt/qwmatrix.sip | 142 - sip/qt/qworkspace.sip | 84 - sip/qt/versions.sip | 92 - sip/qtaxcontainer/copying.sip | 51 - sip/qtaxcontainer/qaxbase.sip | 86 - sip/qtaxcontainer/qaxobject.sip | 37 - sip/qtaxcontainer/qaxwidget.sip | 37 - sip/qtaxcontainer/qtaxcontainermod.sip | 32 - sip/qtcanvas/copying.sip | 51 - sip/qtcanvas/qcanvas.sip | 749 -- sip/qtcanvas/qtcanvasmod.sip | 70 - sip/qtext/copying.sip | 51 - sip/qtext/qextscintilla.sip | 411 - sip/qtext/qextscintillaapis.sip | 42 - sip/qtext/qextscintillabase.sip | 1024 -- sip/qtext/qextscintillacommand.sip | 44 - sip/qtext/qextscintillacommandset.sip | 52 - sip/qtext/qextscintilladocument.sip | 42 - sip/qtext/qextscintillalexer.sip | 80 - sip/qtext/qextscintillalexerbash.sip | 80 - sip/qtext/qextscintillalexerbatch.sip | 62 - sip/qtext/qextscintillalexercpp.sip | 98 - sip/qtext/qextscintillalexercsharp.sip | 47 - sip/qtext/qextscintillalexercss.sip | 81 - sip/qtext/qextscintillalexerdiff.sip | 57 - sip/qtext/qextscintillalexerhtml.sip | 178 - sip/qtext/qextscintillalexeridl.sip | 43 - sip/qtext/qextscintillalexerjava.sip | 41 - sip/qtext/qextscintillalexerjavascript.sip | 47 - sip/qtext/qextscintillalexerlua.sip | 79 - sip/qtext/qextscintillalexermakefile.sip | 60 - sip/qtext/qextscintillalexerperl.sip | 96 - sip/qtext/qextscintillalexerpov.sip | 85 - sip/qtext/qextscintillalexerproperties.sip | 68 - sip/qtext/qextscintillalexerpython.sip | 94 - sip/qtext/qextscintillalexerruby.sip | 128 - sip/qtext/qextscintillalexersql.sip | 105 - sip/qtext/qextscintillalexertex.sip | 57 - sip/qtext/qextscintillamacro.sip | 49 - sip/qtext/qextscintillaprinter.sip | 45 - sip/qtext/qtextmod.sip | 107 - sip/qtgl/copying.sip | 51 - sip/qtgl/qgl.sip | 276 - sip/qtgl/qglcolormap.sip | 59 - sip/qtgl/qtglmod.sip | 71 - sip/qtnetwork/copying.sip | 51 - sip/qtnetwork/qdns.sip | 272 - sip/qtnetwork/qftp.sip | 171 - sip/qtnetwork/qhostaddress.sip | 89 - sip/qtnetwork/qhttp.sip | 263 - sip/qtnetwork/qlocalfs.sip | 54 - sip/qtnetwork/qnetwork.sip | 32 - sip/qtnetwork/qserversocket.sip | 58 - sip/qtnetwork/qsocket.sip | 241 - sip/qtnetwork/qsocketdevice.sip | 168 - sip/qtnetwork/qtnetworkmod.sip | 78 - sip/qtpe/copying.sip | 51 - sip/qtpe/qpeapplication.sip | 223 - sip/qtpe/qpeapplnk.sip | 157 - sip/qtpe/qpeconfig.sip | 78 - sip/qtpe/qpefilemanager.sip | 53 - sip/qtpe/qpefileselector.sip | 69 - sip/qtpe/qpefontdatabase.sip | 67 - sip/qtpe/qpeglobal.sip | 83 - sip/qtpe/qpemenubar.sip | 42 - sip/qtpe/qpemenubutton.sip | 61 - sip/qtpe/qpeqcopenvelope.sip | 39 - sip/qtpe/qpeqdawg.sip | 65 - sip/qtpe/qperesource.sip | 50 - sip/qtpe/qpetimestring.sip | 71 - sip/qtpe/qpetoolbar.sip | 42 - sip/qtpe/qtpemod.sip | 94 - sip/qtsql/copying.sip | 51 - sip/qtsql/qdatabrowser.sip | 144 - sip/qtsql/qdatatable.sip | 185 - sip/qtsql/qdataview.sip | 54 - sip/qtsql/qeditorfactory.sip | 49 - sip/qtsql/qsql.sip | 74 - sip/qtsql/qsqlcursor.sip | 140 - sip/qtsql/qsqldatabase.sip | 135 - sip/qtsql/qsqldriver.sip | 86 - sip/qtsql/qsqleditorfactory.sip | 51 - sip/qtsql/qsqlerror.sip | 62 - sip/qtsql/qsqlfield.sip | 91 - sip/qtsql/qsqlform.sip | 68 - sip/qtsql/qsqlindex.sip | 60 - sip/qtsql/qsqlpropertymap.sip | 59 - sip/qtsql/qsqlquery.sip | 103 - sip/qtsql/qsqlrecord.sip | 171 - sip/qtsql/qsqlresult.sip | 69 - sip/qtsql/qsqlselectcursor.sip | 88 - sip/qtsql/qtsqlmod.sip | 88 - sip/qttable/copying.sip | 51 - sip/qttable/qtable.sip | 441 - sip/qttable/qttablemod.sip | 70 - sip/qtui/copying.sip | 51 - sip/qtui/qtuimod.sip | 71 - sip/qtui/qwidgetfactory.sip | 57 - sip/qtxml/copying.sip | 51 - sip/qtxml/qdom.sip | 826 -- sip/qtxml/qtxmlmod.sip | 80 - sip/tqt/copying.sip | 51 + sip/tqt/tqaccel.sip | 80 + sip/tqt/tqaction.sip | 148 + sip/tqt/tqapplication.sip | 467 + sip/tqt/tqassistantclient.sip | 59 + sip/tqt/tqbitmap.sip | 48 + sip/tqt/tqbrush.sip | 55 + sip/tqt/tqbutton.sip | 115 + sip/tqt/tqbuttongroup.sip | 82 + sip/tqt/tqbytearray.sip | 244 + sip/tqt/tqcdestyle.sip | 55 + sip/tqt/tqcheckbox.sip | 63 + sip/tqt/tqclipboard.sip | 132 + sip/tqt/tqcolor.sip | 156 + sip/tqt/tqcolordialog.sip | 64 + sip/tqt/tqcolorgroup.sip | 89 + sip/tqt/tqcombobox.sip | 148 + sip/tqt/tqcommonstyle.sip | 105 + sip/tqt/tqcstring.sip | 217 + sip/tqt/tqcursor.sip | 69 + sip/tqt/tqdatastream.sip | 218 + sip/tqt/tqdatetime.sip | 226 + sip/tqt/tqdatetimeedit.sip | 220 + sip/tqt/tqdesktopwidget.sip | 70 + sip/tqt/tqdial.sip | 105 + sip/tqt/tqdialog.sip | 119 + sip/tqt/tqdir.sip | 292 + sip/tqt/tqdockarea.sip | 84 + sip/tqt/tqdockwindow.sip | 125 + sip/tqt/tqdragobject.sip | 231 + sip/tqt/tqdrawutil.sip | 56 + sip/tqt/tqdropsite.sip | 44 + sip/tqt/tqerrormessage.sip | 51 + sip/tqt/tqevent.sip | 857 ++ sip/tqt/tqeventloop.sip | 83 + sip/tqt/tqfile.sip | 199 + sip/tqt/tqfiledialog.sip | 224 + sip/tqt/tqfileinfo.sip | 94 + sip/tqt/tqfont.sip | 236 + sip/tqt/tqfontdatabase.sip | 71 + sip/tqt/tqfontdialog.sip | 73 + sip/tqt/tqfontinfo.sip | 56 + sip/tqt/tqfontmetrics.sip | 167 + sip/tqt/tqframe.sip | 100 + sip/tqt/tqglobal.sip | 67 + sip/tqt/tqgrid.sip | 51 + sip/tqt/tqgridview.sip | 72 + sip/tqt/tqgroupbox.sip | 92 + sip/tqt/tqhbox.sip | 52 + sip/tqt/tqhbuttongroup.sip | 44 + sip/tqt/tqheader.sip | 127 + sip/tqt/tqhgroupbox.sip | 44 + sip/tqt/tqiconset.sip | 107 + sip/tqt/tqiconview.sip | 381 + sip/tqt/tqimage.sip | 448 + sip/tqt/tqinputdialog.sip | 157 + sip/tqt/tqinterlacestyle.sip | 103 + sip/tqt/tqiodevice.sip | 257 + sip/tqt/tqkeysequence.sip | 113 + sip/tqt/tqlabel.sip | 85 + sip/tqt/tqlayout.sip | 458 + sip/tqt/tqlcdnumber.sip | 93 + sip/tqt/tqlibrary.sip | 55 + sip/tqt/tqlineedit.sip | 209 + sip/tqt/tqlistbox.sip | 333 + sip/tqt/tqlistview.sip | 491 + sip/tqt/tqlocale.sip | 533 + sip/tqt/tqmainwindow.sip | 171 + sip/tqt/tqmemarray.sip | 164 + sip/tqt/tqmenubar.sip | 97 + sip/tqt/tqmenudata.sip | 190 + sip/tqt/tqmessagebox.sip | 139 + sip/tqt/tqmetaobject.sip | 117 + sip/tqt/tqmime.sip | 88 + sip/tqt/tqmotifplusstyle.sip | 102 + sip/tqt/tqmotifstyle.sip | 112 + sip/tqt/tqmovie.sip | 98 + sip/tqt/tqmultilinedit.sip | 134 + sip/tqt/tqmutex.sip | 74 + sip/tqt/tqnamespace.sip | 746 ++ sip/tqt/tqnetworkprotocol.sip | 186 + sip/tqt/tqobject.sip | 2086 ++++ sip/tqt/tqobjectcleanuphandler.sip | 45 + sip/tqt/tqobjectlist.sip | 107 + sip/tqt/tqpaintdevice.sip | 170 + sip/tqt/tqpaintdevicemetrics.sip | 51 + sip/tqt/tqpainter.sip | 360 + sip/tqt/tqpair.sip | 79 + sip/tqt/tqpalette.sip | 82 + sip/tqt/tqpen.sip | 59 + sip/tqt/tqpicture.sip | 81 + sip/tqt/tqpixmap.sip | 165 + sip/tqt/tqpixmapcache.sip | 47 + sip/tqt/tqplatinumstyle.sip | 85 + sip/tqt/tqpoint.sip | 98 + sip/tqt/tqpointarray.sip | 230 + sip/tqt/tqpopupmenu.sip | 166 + sip/tqt/tqprintdialog.sip | 57 + sip/tqt/tqprinter.sip | 174 + sip/tqt/tqprocess.sip | 106 + sip/tqt/tqprogressbar.sip | 73 + sip/tqt/tqprogressdialog.sip | 97 + sip/tqt/tqptrlist.sip | 107 + sip/tqt/tqpushbutton.sip | 83 + sip/tqt/tqradiobutton.sip | 59 + sip/tqt/tqrangecontrol.sip | 73 + sip/tqt/tqrect.sip | 194 + sip/tqt/tqregexp.sip | 102 + sip/tqt/tqregion.sip | 122 + sip/tqt/tqscrollbar.sip | 102 + sip/tqt/tqscrollview.sip | 230 + sip/tqt/tqsemaphore.sip | 84 + sip/tqt/tqsessionmanager.sip | 72 + sip/tqt/tqsettings.sip | 163 + sip/tqt/tqsgistyle.sip | 92 + sip/tqt/tqsignalmapper.sip | 51 + sip/tqt/tqsimplerichtext.sip | 64 + sip/tqt/tqsize.sip | 108 + sip/tqt/tqsizegrip.sip | 53 + sip/tqt/tqsizepolicy.sip | 85 + sip/tqt/tqslider.sip | 119 + sip/tqt/tqsocketnotifier.sip | 61 + sip/tqt/tqsound.sip | 58 + sip/tqt/tqspinbox.sip | 122 + sip/tqt/tqsplashscreen.sip | 57 + sip/tqt/tqsplitter.sip | 102 + sip/tqt/tqstatusbar.sip | 65 + sip/tqt/tqstring.sip | 946 ++ sip/tqt/tqstringlist.sip | 227 + sip/tqt/tqstrlist.sip | 104 + sip/tqt/tqstyle.sip | 841 ++ sip/tqt/tqstylefactory.sip | 41 + sip/tqt/tqstylesheet.sip | 194 + sip/tqt/tqsyntaxhighlighter.sip | 51 + sip/tqt/tqtabbar.sip | 180 + sip/tqt/tqtabdialog.sip | 108 + sip/tqt/tqtabwidget.sip | 120 + sip/tqt/tqtextbrowser.sip | 65 + sip/tqt/tqtextcodec.sip | 132 + sip/tqt/tqtextedit.sip | 402 + sip/tqt/tqtextstream.sip | 199 + sip/tqt/tqtextview.sip | 45 + sip/tqt/tqthread.sip | 83 + sip/tqt/tqtimer.sip | 57 + sip/tqt/tqtmod.sip | 279 + sip/tqt/tqtoolbar.sip | 73 + sip/tqt/tqtoolbox.sip | 84 + sip/tqt/tqtoolbutton.sip | 105 + sip/tqt/tqtooltip.sip | 105 + sip/tqt/tqtranslator.sip | 113 + sip/tqt/tqurl.sip | 110 + sip/tqt/tqurlinfo.sip | 90 + sip/tqt/tqurloperator.sip | 96 + sip/tqt/tquuid.sip | 74 + sip/tqt/tqvalidator.sip | 169 + sip/tqt/tqvaluelist.sip | 173 + sip/tqt/tqvariant.sip | 378 + sip/tqt/tqvbox.sip | 43 + sip/tqt/tqvbuttongroup.sip | 44 + sip/tqt/tqvgroupbox.sip | 44 + sip/tqt/tqwaitcondition.sip | 53 + sip/tqt/tqwhatsthis.sip | 60 + sip/tqt/tqwidget.sip | 410 + sip/tqt/tqwidgetlist.sip | 107 + sip/tqt/tqwidgetstack.sip | 76 + sip/tqt/tqwindowdefs.sip | 51 + sip/tqt/tqwindowdefs_qws.sip | 29 + sip/tqt/tqwindowdefs_x11.sip | 37 + sip/tqt/tqwindowsstyle.sip | 120 + sip/tqt/tqwindowsxpstyle.sip | 31 + sip/tqt/tqwizard.sip | 102 + sip/tqt/tqwmatrix.sip | 142 + sip/tqt/tqworkspace.sip | 84 + sip/tqt/versions.sip | 92 + sip/tqtaxcontainer/copying.sip | 51 + sip/tqtaxcontainer/tqaxbase.sip | 86 + sip/tqtaxcontainer/tqaxobject.sip | 37 + sip/tqtaxcontainer/tqaxwidget.sip | 37 + sip/tqtaxcontainer/tqtaxcontainermod.sip | 32 + sip/tqtcanvas/copying.sip | 51 + sip/tqtcanvas/tqcanvas.sip | 749 ++ sip/tqtcanvas/tqtcanvasmod.sip | 70 + sip/tqtext/copying.sip | 51 + sip/tqtext/tqextscintilla.sip | 411 + sip/tqtext/tqextscintillaapis.sip | 42 + sip/tqtext/tqextscintillabase.sip | 1024 ++ sip/tqtext/tqextscintillacommand.sip | 44 + sip/tqtext/tqextscintillacommandset.sip | 52 + sip/tqtext/tqextscintilladocument.sip | 42 + sip/tqtext/tqextscintillalexer.sip | 80 + sip/tqtext/tqextscintillalexerbash.sip | 80 + sip/tqtext/tqextscintillalexerbatch.sip | 62 + sip/tqtext/tqextscintillalexercpp.sip | 98 + sip/tqtext/tqextscintillalexercsharp.sip | 47 + sip/tqtext/tqextscintillalexercss.sip | 81 + sip/tqtext/tqextscintillalexerdiff.sip | 57 + sip/tqtext/tqextscintillalexerhtml.sip | 178 + sip/tqtext/tqextscintillalexeridl.sip | 43 + sip/tqtext/tqextscintillalexerjava.sip | 41 + sip/tqtext/tqextscintillalexerjavascript.sip | 47 + sip/tqtext/tqextscintillalexerlua.sip | 79 + sip/tqtext/tqextscintillalexermakefile.sip | 60 + sip/tqtext/tqextscintillalexerperl.sip | 96 + sip/tqtext/tqextscintillalexerpov.sip | 85 + sip/tqtext/tqextscintillalexerproperties.sip | 68 + sip/tqtext/tqextscintillalexerpython.sip | 94 + sip/tqtext/tqextscintillalexerruby.sip | 128 + sip/tqtext/tqextscintillalexersql.sip | 105 + sip/tqtext/tqextscintillalexertex.sip | 57 + sip/tqtext/tqextscintillamacro.sip | 49 + sip/tqtext/tqextscintillaprinter.sip | 45 + sip/tqtext/tqtextmod.sip | 107 + sip/tqtgl/copying.sip | 51 + sip/tqtgl/tqgl.sip | 276 + sip/tqtgl/tqglcolormap.sip | 59 + sip/tqtgl/tqtglmod.sip | 71 + sip/tqtnetwork/copying.sip | 51 + sip/tqtnetwork/tqdns.sip | 272 + sip/tqtnetwork/tqftp.sip | 171 + sip/tqtnetwork/tqhostaddress.sip | 89 + sip/tqtnetwork/tqhttp.sip | 263 + sip/tqtnetwork/tqlocalfs.sip | 54 + sip/tqtnetwork/tqnetwork.sip | 32 + sip/tqtnetwork/tqserversocket.sip | 58 + sip/tqtnetwork/tqsocket.sip | 241 + sip/tqtnetwork/tqsocketdevice.sip | 168 + sip/tqtnetwork/tqtnetworkmod.sip | 78 + sip/tqtpe/copying.sip | 51 + sip/tqtpe/tqpeapplication.sip | 223 + sip/tqtpe/tqpeapplnk.sip | 157 + sip/tqtpe/tqpeconfig.sip | 78 + sip/tqtpe/tqpefilemanager.sip | 53 + sip/tqtpe/tqpefileselector.sip | 69 + sip/tqtpe/tqpefontdatabase.sip | 67 + sip/tqtpe/tqpeglobal.sip | 83 + sip/tqtpe/tqpemenubar.sip | 42 + sip/tqtpe/tqpemenubutton.sip | 61 + sip/tqtpe/tqpeqcopenvelope.sip | 39 + sip/tqtpe/tqpeqdawg.sip | 65 + sip/tqtpe/tqperesource.sip | 50 + sip/tqtpe/tqpetimestring.sip | 71 + sip/tqtpe/tqpetoolbar.sip | 42 + sip/tqtpe/tqtpemod.sip | 94 + sip/tqtsql/copying.sip | 51 + sip/tqtsql/tqdatabrowser.sip | 144 + sip/tqtsql/tqdatatable.sip | 185 + sip/tqtsql/tqdataview.sip | 54 + sip/tqtsql/tqeditorfactory.sip | 49 + sip/tqtsql/tqsql.sip | 74 + sip/tqtsql/tqsqlcursor.sip | 140 + sip/tqtsql/tqsqldatabase.sip | 135 + sip/tqtsql/tqsqldriver.sip | 86 + sip/tqtsql/tqsqleditorfactory.sip | 51 + sip/tqtsql/tqsqlerror.sip | 62 + sip/tqtsql/tqsqlfield.sip | 91 + sip/tqtsql/tqsqlform.sip | 68 + sip/tqtsql/tqsqlindex.sip | 60 + sip/tqtsql/tqsqlpropertymap.sip | 59 + sip/tqtsql/tqsqlquery.sip | 103 + sip/tqtsql/tqsqlrecord.sip | 171 + sip/tqtsql/tqsqlresult.sip | 69 + sip/tqtsql/tqsqlselectcursor.sip | 88 + sip/tqtsql/tqtsqlmod.sip | 88 + sip/tqttable/copying.sip | 51 + sip/tqttable/tqtable.sip | 441 + sip/tqttable/tqttablemod.sip | 70 + sip/tqtui/copying.sip | 51 + sip/tqtui/tqtuimod.sip | 71 + sip/tqtui/tqwidgetfactory.sip | 57 + sip/tqtxml/copying.sip | 51 + sip/tqtxml/tqdom.sip | 826 ++ sip/tqtxml/tqtxmlmod.sip | 80 + 696 files changed, 68774 insertions(+), 68774 deletions(-) delete mode 100644 doc/PyQt.html delete mode 100644 doc/PyQt.sgml create mode 100644 doc/PyTQt.html create mode 100644 doc/PyTQt.sgml delete mode 100644 doc/qtdocs.sip create mode 100644 doc/tqtdocs.sip delete mode 100644 examples/canvas/qt-trans.xpm delete mode 100644 examples/canvas/qtlogo.png create mode 100644 examples/canvas/tqt-trans.xpm create mode 100644 examples/canvas/tqtlogo.png delete mode 100755 examples/qdir.py delete mode 100755 examples/qmag.py delete mode 100644 examples/qt.png delete mode 100644 examples/qtlogo.png create mode 100755 examples/tqdir.py create mode 100755 examples/tqmag.py create mode 100644 examples/tqt.png create mode 100644 examples/tqtlogo.png delete mode 100644 pylupdate3/LICENSE.GPL delete mode 100644 pylupdate3/fetchtr.cpp delete mode 100644 pylupdate3/main.cpp delete mode 100644 pylupdate3/merge.cpp delete mode 100644 pylupdate3/metatranslator.cpp delete mode 100644 pylupdate3/metatranslator.h delete mode 100644 pylupdate3/numberh.cpp delete mode 100644 pylupdate3/proparser.cpp delete mode 100644 pylupdate3/proparser.h delete mode 100644 pylupdate3/pylupdate-prof.sbf delete mode 100644 pylupdate3/pylupdate.pro.in delete mode 100644 pylupdate3/pylupdate.sbf delete mode 100644 pylupdate3/sametexth.cpp delete mode 100644 pyqtconfig.py.in create mode 100644 pytqlupdate3/LICENSE.GPL create mode 100644 pytqlupdate3/fetchtr.cpp create mode 100644 pytqlupdate3/main.cpp create mode 100644 pytqlupdate3/merge.cpp create mode 100644 pytqlupdate3/metatranslator.cpp create mode 100644 pytqlupdate3/metatranslator.h create mode 100644 pytqlupdate3/numberh.cpp create mode 100644 pytqlupdate3/proparser.cpp create mode 100644 pytqlupdate3/proparser.h create mode 100644 pytqlupdate3/pytqlupdate-prof.sbf create mode 100644 pytqlupdate3/pytqlupdate.pro.in create mode 100644 pytqlupdate3/pytqlupdate.sbf create mode 100644 pytqlupdate3/sametexth.cpp create mode 100644 pytqtconfig.py.in create mode 100644 pytquic3/LICENSE.GPL create mode 100644 pytquic3/domtool.cpp create mode 100644 pytquic3/domtool.h create mode 100644 pytquic3/embed.cpp create mode 100644 pytquic3/form.cpp create mode 100644 pytquic3/globaldefs.h create mode 100644 pytquic3/main.cpp create mode 100644 pytquic3/object.cpp create mode 100644 pytquic3/parser.cpp create mode 100644 pytquic3/parser.h create mode 100644 pytquic3/pytquic-prof.sbf create mode 100644 pytquic3/pytquic.pro.in create mode 100644 pytquic3/pytquic.sbf create mode 100644 pytquic3/subclassing.cpp create mode 100644 pytquic3/uic.cpp create mode 100644 pytquic3/uic.h create mode 100644 pytquic3/widgetdatabase.cpp create mode 100644 pytquic3/widgetdatabase.h create mode 100644 pytquic3/widgetinterface.h delete mode 100644 pyuic3/LICENSE.GPL delete mode 100644 pyuic3/domtool.cpp delete mode 100644 pyuic3/domtool.h delete mode 100644 pyuic3/embed.cpp delete mode 100644 pyuic3/form.cpp delete mode 100644 pyuic3/globaldefs.h delete mode 100644 pyuic3/main.cpp delete mode 100644 pyuic3/object.cpp delete mode 100644 pyuic3/parser.cpp delete mode 100644 pyuic3/parser.h delete mode 100644 pyuic3/pyuic-prof.sbf delete mode 100644 pyuic3/pyuic.pro.in delete mode 100644 pyuic3/pyuic.sbf delete mode 100644 pyuic3/subclassing.cpp delete mode 100644 pyuic3/uic.cpp delete mode 100644 pyuic3/uic.h delete mode 100644 pyuic3/widgetdatabase.cpp delete mode 100644 pyuic3/widgetdatabase.h delete mode 100644 pyuic3/widgetinterface.h delete mode 100644 sip/pyqt-gpl.sip create mode 100644 sip/pytqt-gpl.sip delete mode 100644 sip/qt/copying.sip delete mode 100644 sip/qt/qaccel.sip delete mode 100644 sip/qt/qaction.sip delete mode 100644 sip/qt/qapplication.sip delete mode 100644 sip/qt/qassistantclient.sip delete mode 100644 sip/qt/qbitmap.sip delete mode 100644 sip/qt/qbrush.sip delete mode 100644 sip/qt/qbutton.sip delete mode 100644 sip/qt/qbuttongroup.sip delete mode 100644 sip/qt/qbytearray.sip delete mode 100644 sip/qt/qcdestyle.sip delete mode 100644 sip/qt/qcheckbox.sip delete mode 100644 sip/qt/qclipboard.sip delete mode 100644 sip/qt/qcolor.sip delete mode 100644 sip/qt/qcolordialog.sip delete mode 100644 sip/qt/qcolorgroup.sip delete mode 100644 sip/qt/qcombobox.sip delete mode 100644 sip/qt/qcommonstyle.sip delete mode 100644 sip/qt/qcstring.sip delete mode 100644 sip/qt/qcursor.sip delete mode 100644 sip/qt/qdatastream.sip delete mode 100644 sip/qt/qdatetime.sip delete mode 100644 sip/qt/qdatetimeedit.sip delete mode 100644 sip/qt/qdesktopwidget.sip delete mode 100644 sip/qt/qdial.sip delete mode 100644 sip/qt/qdialog.sip delete mode 100644 sip/qt/qdir.sip delete mode 100644 sip/qt/qdockarea.sip delete mode 100644 sip/qt/qdockwindow.sip delete mode 100644 sip/qt/qdragobject.sip delete mode 100644 sip/qt/qdrawutil.sip delete mode 100644 sip/qt/qdropsite.sip delete mode 100644 sip/qt/qerrormessage.sip delete mode 100644 sip/qt/qevent.sip delete mode 100644 sip/qt/qeventloop.sip delete mode 100644 sip/qt/qfile.sip delete mode 100644 sip/qt/qfiledialog.sip delete mode 100644 sip/qt/qfileinfo.sip delete mode 100644 sip/qt/qfont.sip delete mode 100644 sip/qt/qfontdatabase.sip delete mode 100644 sip/qt/qfontdialog.sip delete mode 100644 sip/qt/qfontinfo.sip delete mode 100644 sip/qt/qfontmetrics.sip delete mode 100644 sip/qt/qframe.sip delete mode 100644 sip/qt/qglobal.sip delete mode 100644 sip/qt/qgrid.sip delete mode 100644 sip/qt/qgridview.sip delete mode 100644 sip/qt/qgroupbox.sip delete mode 100644 sip/qt/qhbox.sip delete mode 100644 sip/qt/qhbuttongroup.sip delete mode 100644 sip/qt/qheader.sip delete mode 100644 sip/qt/qhgroupbox.sip delete mode 100644 sip/qt/qiconset.sip delete mode 100644 sip/qt/qiconview.sip delete mode 100644 sip/qt/qimage.sip delete mode 100644 sip/qt/qinputdialog.sip delete mode 100644 sip/qt/qinterlacestyle.sip delete mode 100644 sip/qt/qiodevice.sip delete mode 100644 sip/qt/qkeysequence.sip delete mode 100644 sip/qt/qlabel.sip delete mode 100644 sip/qt/qlayout.sip delete mode 100644 sip/qt/qlcdnumber.sip delete mode 100644 sip/qt/qlibrary.sip delete mode 100644 sip/qt/qlineedit.sip delete mode 100644 sip/qt/qlistbox.sip delete mode 100644 sip/qt/qlistview.sip delete mode 100644 sip/qt/qlocale.sip delete mode 100644 sip/qt/qmainwindow.sip delete mode 100644 sip/qt/qmemarray.sip delete mode 100644 sip/qt/qmenubar.sip delete mode 100644 sip/qt/qmenudata.sip delete mode 100644 sip/qt/qmessagebox.sip delete mode 100644 sip/qt/qmetaobject.sip delete mode 100644 sip/qt/qmime.sip delete mode 100644 sip/qt/qmotifplusstyle.sip delete mode 100644 sip/qt/qmotifstyle.sip delete mode 100644 sip/qt/qmovie.sip delete mode 100644 sip/qt/qmultilinedit.sip delete mode 100644 sip/qt/qmutex.sip delete mode 100644 sip/qt/qnamespace.sip delete mode 100644 sip/qt/qnetworkprotocol.sip delete mode 100644 sip/qt/qobject.sip delete mode 100644 sip/qt/qobjectcleanuphandler.sip delete mode 100644 sip/qt/qobjectlist.sip delete mode 100644 sip/qt/qpaintdevice.sip delete mode 100644 sip/qt/qpaintdevicemetrics.sip delete mode 100644 sip/qt/qpainter.sip delete mode 100644 sip/qt/qpair.sip delete mode 100644 sip/qt/qpalette.sip delete mode 100644 sip/qt/qpen.sip delete mode 100644 sip/qt/qpicture.sip delete mode 100644 sip/qt/qpixmap.sip delete mode 100644 sip/qt/qpixmapcache.sip delete mode 100644 sip/qt/qplatinumstyle.sip delete mode 100644 sip/qt/qpoint.sip delete mode 100644 sip/qt/qpointarray.sip delete mode 100644 sip/qt/qpopupmenu.sip delete mode 100644 sip/qt/qprintdialog.sip delete mode 100644 sip/qt/qprinter.sip delete mode 100644 sip/qt/qprocess.sip delete mode 100644 sip/qt/qprogressbar.sip delete mode 100644 sip/qt/qprogressdialog.sip delete mode 100644 sip/qt/qptrlist.sip delete mode 100644 sip/qt/qpushbutton.sip delete mode 100644 sip/qt/qradiobutton.sip delete mode 100644 sip/qt/qrangecontrol.sip delete mode 100644 sip/qt/qrect.sip delete mode 100644 sip/qt/qregexp.sip delete mode 100644 sip/qt/qregion.sip delete mode 100644 sip/qt/qscrollbar.sip delete mode 100644 sip/qt/qscrollview.sip delete mode 100644 sip/qt/qsemaphore.sip delete mode 100644 sip/qt/qsessionmanager.sip delete mode 100644 sip/qt/qsettings.sip delete mode 100644 sip/qt/qsgistyle.sip delete mode 100644 sip/qt/qsignalmapper.sip delete mode 100644 sip/qt/qsimplerichtext.sip delete mode 100644 sip/qt/qsize.sip delete mode 100644 sip/qt/qsizegrip.sip delete mode 100644 sip/qt/qsizepolicy.sip delete mode 100644 sip/qt/qslider.sip delete mode 100644 sip/qt/qsocketnotifier.sip delete mode 100644 sip/qt/qsound.sip delete mode 100644 sip/qt/qspinbox.sip delete mode 100644 sip/qt/qsplashscreen.sip delete mode 100644 sip/qt/qsplitter.sip delete mode 100644 sip/qt/qstatusbar.sip delete mode 100644 sip/qt/qstring.sip delete mode 100644 sip/qt/qstringlist.sip delete mode 100644 sip/qt/qstrlist.sip delete mode 100644 sip/qt/qstyle.sip delete mode 100644 sip/qt/qstylefactory.sip delete mode 100644 sip/qt/qstylesheet.sip delete mode 100644 sip/qt/qsyntaxhighlighter.sip delete mode 100644 sip/qt/qtabbar.sip delete mode 100644 sip/qt/qtabdialog.sip delete mode 100644 sip/qt/qtabwidget.sip delete mode 100644 sip/qt/qtextbrowser.sip delete mode 100644 sip/qt/qtextcodec.sip delete mode 100644 sip/qt/qtextedit.sip delete mode 100644 sip/qt/qtextstream.sip delete mode 100644 sip/qt/qtextview.sip delete mode 100644 sip/qt/qthread.sip delete mode 100644 sip/qt/qtimer.sip delete mode 100644 sip/qt/qtmod.sip delete mode 100644 sip/qt/qtoolbar.sip delete mode 100644 sip/qt/qtoolbox.sip delete mode 100644 sip/qt/qtoolbutton.sip delete mode 100644 sip/qt/qtooltip.sip delete mode 100644 sip/qt/qtranslator.sip delete mode 100644 sip/qt/qurl.sip delete mode 100644 sip/qt/qurlinfo.sip delete mode 100644 sip/qt/qurloperator.sip delete mode 100644 sip/qt/quuid.sip delete mode 100644 sip/qt/qvalidator.sip delete mode 100644 sip/qt/qvaluelist.sip delete mode 100644 sip/qt/qvariant.sip delete mode 100644 sip/qt/qvbox.sip delete mode 100644 sip/qt/qvbuttongroup.sip delete mode 100644 sip/qt/qvgroupbox.sip delete mode 100644 sip/qt/qwaitcondition.sip delete mode 100644 sip/qt/qwhatsthis.sip delete mode 100644 sip/qt/qwidget.sip delete mode 100644 sip/qt/qwidgetlist.sip delete mode 100644 sip/qt/qwidgetstack.sip delete mode 100644 sip/qt/qwindowdefs.sip delete mode 100644 sip/qt/qwindowdefs_qws.sip delete mode 100644 sip/qt/qwindowdefs_x11.sip delete mode 100644 sip/qt/qwindowsstyle.sip delete mode 100644 sip/qt/qwindowsxpstyle.sip delete mode 100644 sip/qt/qwizard.sip delete mode 100644 sip/qt/qwmatrix.sip delete mode 100644 sip/qt/qworkspace.sip delete mode 100644 sip/qt/versions.sip delete mode 100644 sip/qtaxcontainer/copying.sip delete mode 100644 sip/qtaxcontainer/qaxbase.sip delete mode 100644 sip/qtaxcontainer/qaxobject.sip delete mode 100644 sip/qtaxcontainer/qaxwidget.sip delete mode 100644 sip/qtaxcontainer/qtaxcontainermod.sip delete mode 100644 sip/qtcanvas/copying.sip delete mode 100644 sip/qtcanvas/qcanvas.sip delete mode 100644 sip/qtcanvas/qtcanvasmod.sip delete mode 100644 sip/qtext/copying.sip delete mode 100644 sip/qtext/qextscintilla.sip delete mode 100644 sip/qtext/qextscintillaapis.sip delete mode 100644 sip/qtext/qextscintillabase.sip delete mode 100644 sip/qtext/qextscintillacommand.sip delete mode 100644 sip/qtext/qextscintillacommandset.sip delete mode 100644 sip/qtext/qextscintilladocument.sip delete mode 100644 sip/qtext/qextscintillalexer.sip delete mode 100644 sip/qtext/qextscintillalexerbash.sip delete mode 100644 sip/qtext/qextscintillalexerbatch.sip delete mode 100644 sip/qtext/qextscintillalexercpp.sip delete mode 100644 sip/qtext/qextscintillalexercsharp.sip delete mode 100644 sip/qtext/qextscintillalexercss.sip delete mode 100644 sip/qtext/qextscintillalexerdiff.sip delete mode 100644 sip/qtext/qextscintillalexerhtml.sip delete mode 100644 sip/qtext/qextscintillalexeridl.sip delete mode 100644 sip/qtext/qextscintillalexerjava.sip delete mode 100644 sip/qtext/qextscintillalexerjavascript.sip delete mode 100644 sip/qtext/qextscintillalexerlua.sip delete mode 100644 sip/qtext/qextscintillalexermakefile.sip delete mode 100644 sip/qtext/qextscintillalexerperl.sip delete mode 100644 sip/qtext/qextscintillalexerpov.sip delete mode 100644 sip/qtext/qextscintillalexerproperties.sip delete mode 100644 sip/qtext/qextscintillalexerpython.sip delete mode 100644 sip/qtext/qextscintillalexerruby.sip delete mode 100644 sip/qtext/qextscintillalexersql.sip delete mode 100644 sip/qtext/qextscintillalexertex.sip delete mode 100644 sip/qtext/qextscintillamacro.sip delete mode 100644 sip/qtext/qextscintillaprinter.sip delete mode 100644 sip/qtext/qtextmod.sip delete mode 100644 sip/qtgl/copying.sip delete mode 100644 sip/qtgl/qgl.sip delete mode 100644 sip/qtgl/qglcolormap.sip delete mode 100644 sip/qtgl/qtglmod.sip delete mode 100644 sip/qtnetwork/copying.sip delete mode 100644 sip/qtnetwork/qdns.sip delete mode 100644 sip/qtnetwork/qftp.sip delete mode 100644 sip/qtnetwork/qhostaddress.sip delete mode 100644 sip/qtnetwork/qhttp.sip delete mode 100644 sip/qtnetwork/qlocalfs.sip delete mode 100644 sip/qtnetwork/qnetwork.sip delete mode 100644 sip/qtnetwork/qserversocket.sip delete mode 100644 sip/qtnetwork/qsocket.sip delete mode 100644 sip/qtnetwork/qsocketdevice.sip delete mode 100644 sip/qtnetwork/qtnetworkmod.sip delete mode 100644 sip/qtpe/copying.sip delete mode 100644 sip/qtpe/qpeapplication.sip delete mode 100644 sip/qtpe/qpeapplnk.sip delete mode 100644 sip/qtpe/qpeconfig.sip delete mode 100644 sip/qtpe/qpefilemanager.sip delete mode 100644 sip/qtpe/qpefileselector.sip delete mode 100644 sip/qtpe/qpefontdatabase.sip delete mode 100644 sip/qtpe/qpeglobal.sip delete mode 100644 sip/qtpe/qpemenubar.sip delete mode 100644 sip/qtpe/qpemenubutton.sip delete mode 100644 sip/qtpe/qpeqcopenvelope.sip delete mode 100644 sip/qtpe/qpeqdawg.sip delete mode 100644 sip/qtpe/qperesource.sip delete mode 100644 sip/qtpe/qpetimestring.sip delete mode 100644 sip/qtpe/qpetoolbar.sip delete mode 100644 sip/qtpe/qtpemod.sip delete mode 100644 sip/qtsql/copying.sip delete mode 100644 sip/qtsql/qdatabrowser.sip delete mode 100644 sip/qtsql/qdatatable.sip delete mode 100644 sip/qtsql/qdataview.sip delete mode 100644 sip/qtsql/qeditorfactory.sip delete mode 100644 sip/qtsql/qsql.sip delete mode 100644 sip/qtsql/qsqlcursor.sip delete mode 100644 sip/qtsql/qsqldatabase.sip delete mode 100644 sip/qtsql/qsqldriver.sip delete mode 100644 sip/qtsql/qsqleditorfactory.sip delete mode 100644 sip/qtsql/qsqlerror.sip delete mode 100644 sip/qtsql/qsqlfield.sip delete mode 100644 sip/qtsql/qsqlform.sip delete mode 100644 sip/qtsql/qsqlindex.sip delete mode 100644 sip/qtsql/qsqlpropertymap.sip delete mode 100644 sip/qtsql/qsqlquery.sip delete mode 100644 sip/qtsql/qsqlrecord.sip delete mode 100644 sip/qtsql/qsqlresult.sip delete mode 100644 sip/qtsql/qsqlselectcursor.sip delete mode 100644 sip/qtsql/qtsqlmod.sip delete mode 100644 sip/qttable/copying.sip delete mode 100644 sip/qttable/qtable.sip delete mode 100644 sip/qttable/qttablemod.sip delete mode 100644 sip/qtui/copying.sip delete mode 100644 sip/qtui/qtuimod.sip delete mode 100644 sip/qtui/qwidgetfactory.sip delete mode 100644 sip/qtxml/copying.sip delete mode 100644 sip/qtxml/qdom.sip delete mode 100644 sip/qtxml/qtxmlmod.sip create mode 100644 sip/tqt/copying.sip create mode 100644 sip/tqt/tqaccel.sip create mode 100644 sip/tqt/tqaction.sip create mode 100644 sip/tqt/tqapplication.sip create mode 100644 sip/tqt/tqassistantclient.sip create mode 100644 sip/tqt/tqbitmap.sip create mode 100644 sip/tqt/tqbrush.sip create mode 100644 sip/tqt/tqbutton.sip create mode 100644 sip/tqt/tqbuttongroup.sip create mode 100644 sip/tqt/tqbytearray.sip create mode 100644 sip/tqt/tqcdestyle.sip create mode 100644 sip/tqt/tqcheckbox.sip create mode 100644 sip/tqt/tqclipboard.sip create mode 100644 sip/tqt/tqcolor.sip create mode 100644 sip/tqt/tqcolordialog.sip create mode 100644 sip/tqt/tqcolorgroup.sip create mode 100644 sip/tqt/tqcombobox.sip create mode 100644 sip/tqt/tqcommonstyle.sip create mode 100644 sip/tqt/tqcstring.sip create mode 100644 sip/tqt/tqcursor.sip create mode 100644 sip/tqt/tqdatastream.sip create mode 100644 sip/tqt/tqdatetime.sip create mode 100644 sip/tqt/tqdatetimeedit.sip create mode 100644 sip/tqt/tqdesktopwidget.sip create mode 100644 sip/tqt/tqdial.sip create mode 100644 sip/tqt/tqdialog.sip create mode 100644 sip/tqt/tqdir.sip create mode 100644 sip/tqt/tqdockarea.sip create mode 100644 sip/tqt/tqdockwindow.sip create mode 100644 sip/tqt/tqdragobject.sip create mode 100644 sip/tqt/tqdrawutil.sip create mode 100644 sip/tqt/tqdropsite.sip create mode 100644 sip/tqt/tqerrormessage.sip create mode 100644 sip/tqt/tqevent.sip create mode 100644 sip/tqt/tqeventloop.sip create mode 100644 sip/tqt/tqfile.sip create mode 100644 sip/tqt/tqfiledialog.sip create mode 100644 sip/tqt/tqfileinfo.sip create mode 100644 sip/tqt/tqfont.sip create mode 100644 sip/tqt/tqfontdatabase.sip create mode 100644 sip/tqt/tqfontdialog.sip create mode 100644 sip/tqt/tqfontinfo.sip create mode 100644 sip/tqt/tqfontmetrics.sip create mode 100644 sip/tqt/tqframe.sip create mode 100644 sip/tqt/tqglobal.sip create mode 100644 sip/tqt/tqgrid.sip create mode 100644 sip/tqt/tqgridview.sip create mode 100644 sip/tqt/tqgroupbox.sip create mode 100644 sip/tqt/tqhbox.sip create mode 100644 sip/tqt/tqhbuttongroup.sip create mode 100644 sip/tqt/tqheader.sip create mode 100644 sip/tqt/tqhgroupbox.sip create mode 100644 sip/tqt/tqiconset.sip create mode 100644 sip/tqt/tqiconview.sip create mode 100644 sip/tqt/tqimage.sip create mode 100644 sip/tqt/tqinputdialog.sip create mode 100644 sip/tqt/tqinterlacestyle.sip create mode 100644 sip/tqt/tqiodevice.sip create mode 100644 sip/tqt/tqkeysequence.sip create mode 100644 sip/tqt/tqlabel.sip create mode 100644 sip/tqt/tqlayout.sip create mode 100644 sip/tqt/tqlcdnumber.sip create mode 100644 sip/tqt/tqlibrary.sip create mode 100644 sip/tqt/tqlineedit.sip create mode 100644 sip/tqt/tqlistbox.sip create mode 100644 sip/tqt/tqlistview.sip create mode 100644 sip/tqt/tqlocale.sip create mode 100644 sip/tqt/tqmainwindow.sip create mode 100644 sip/tqt/tqmemarray.sip create mode 100644 sip/tqt/tqmenubar.sip create mode 100644 sip/tqt/tqmenudata.sip create mode 100644 sip/tqt/tqmessagebox.sip create mode 100644 sip/tqt/tqmetaobject.sip create mode 100644 sip/tqt/tqmime.sip create mode 100644 sip/tqt/tqmotifplusstyle.sip create mode 100644 sip/tqt/tqmotifstyle.sip create mode 100644 sip/tqt/tqmovie.sip create mode 100644 sip/tqt/tqmultilinedit.sip create mode 100644 sip/tqt/tqmutex.sip create mode 100644 sip/tqt/tqnamespace.sip create mode 100644 sip/tqt/tqnetworkprotocol.sip create mode 100644 sip/tqt/tqobject.sip create mode 100644 sip/tqt/tqobjectcleanuphandler.sip create mode 100644 sip/tqt/tqobjectlist.sip create mode 100644 sip/tqt/tqpaintdevice.sip create mode 100644 sip/tqt/tqpaintdevicemetrics.sip create mode 100644 sip/tqt/tqpainter.sip create mode 100644 sip/tqt/tqpair.sip create mode 100644 sip/tqt/tqpalette.sip create mode 100644 sip/tqt/tqpen.sip create mode 100644 sip/tqt/tqpicture.sip create mode 100644 sip/tqt/tqpixmap.sip create mode 100644 sip/tqt/tqpixmapcache.sip create mode 100644 sip/tqt/tqplatinumstyle.sip create mode 100644 sip/tqt/tqpoint.sip create mode 100644 sip/tqt/tqpointarray.sip create mode 100644 sip/tqt/tqpopupmenu.sip create mode 100644 sip/tqt/tqprintdialog.sip create mode 100644 sip/tqt/tqprinter.sip create mode 100644 sip/tqt/tqprocess.sip create mode 100644 sip/tqt/tqprogressbar.sip create mode 100644 sip/tqt/tqprogressdialog.sip create mode 100644 sip/tqt/tqptrlist.sip create mode 100644 sip/tqt/tqpushbutton.sip create mode 100644 sip/tqt/tqradiobutton.sip create mode 100644 sip/tqt/tqrangecontrol.sip create mode 100644 sip/tqt/tqrect.sip create mode 100644 sip/tqt/tqregexp.sip create mode 100644 sip/tqt/tqregion.sip create mode 100644 sip/tqt/tqscrollbar.sip create mode 100644 sip/tqt/tqscrollview.sip create mode 100644 sip/tqt/tqsemaphore.sip create mode 100644 sip/tqt/tqsessionmanager.sip create mode 100644 sip/tqt/tqsettings.sip create mode 100644 sip/tqt/tqsgistyle.sip create mode 100644 sip/tqt/tqsignalmapper.sip create mode 100644 sip/tqt/tqsimplerichtext.sip create mode 100644 sip/tqt/tqsize.sip create mode 100644 sip/tqt/tqsizegrip.sip create mode 100644 sip/tqt/tqsizepolicy.sip create mode 100644 sip/tqt/tqslider.sip create mode 100644 sip/tqt/tqsocketnotifier.sip create mode 100644 sip/tqt/tqsound.sip create mode 100644 sip/tqt/tqspinbox.sip create mode 100644 sip/tqt/tqsplashscreen.sip create mode 100644 sip/tqt/tqsplitter.sip create mode 100644 sip/tqt/tqstatusbar.sip create mode 100644 sip/tqt/tqstring.sip create mode 100644 sip/tqt/tqstringlist.sip create mode 100644 sip/tqt/tqstrlist.sip create mode 100644 sip/tqt/tqstyle.sip create mode 100644 sip/tqt/tqstylefactory.sip create mode 100644 sip/tqt/tqstylesheet.sip create mode 100644 sip/tqt/tqsyntaxhighlighter.sip create mode 100644 sip/tqt/tqtabbar.sip create mode 100644 sip/tqt/tqtabdialog.sip create mode 100644 sip/tqt/tqtabwidget.sip create mode 100644 sip/tqt/tqtextbrowser.sip create mode 100644 sip/tqt/tqtextcodec.sip create mode 100644 sip/tqt/tqtextedit.sip create mode 100644 sip/tqt/tqtextstream.sip create mode 100644 sip/tqt/tqtextview.sip create mode 100644 sip/tqt/tqthread.sip create mode 100644 sip/tqt/tqtimer.sip create mode 100644 sip/tqt/tqtmod.sip create mode 100644 sip/tqt/tqtoolbar.sip create mode 100644 sip/tqt/tqtoolbox.sip create mode 100644 sip/tqt/tqtoolbutton.sip create mode 100644 sip/tqt/tqtooltip.sip create mode 100644 sip/tqt/tqtranslator.sip create mode 100644 sip/tqt/tqurl.sip create mode 100644 sip/tqt/tqurlinfo.sip create mode 100644 sip/tqt/tqurloperator.sip create mode 100644 sip/tqt/tquuid.sip create mode 100644 sip/tqt/tqvalidator.sip create mode 100644 sip/tqt/tqvaluelist.sip create mode 100644 sip/tqt/tqvariant.sip create mode 100644 sip/tqt/tqvbox.sip create mode 100644 sip/tqt/tqvbuttongroup.sip create mode 100644 sip/tqt/tqvgroupbox.sip create mode 100644 sip/tqt/tqwaitcondition.sip create mode 100644 sip/tqt/tqwhatsthis.sip create mode 100644 sip/tqt/tqwidget.sip create mode 100644 sip/tqt/tqwidgetlist.sip create mode 100644 sip/tqt/tqwidgetstack.sip create mode 100644 sip/tqt/tqwindowdefs.sip create mode 100644 sip/tqt/tqwindowdefs_qws.sip create mode 100644 sip/tqt/tqwindowdefs_x11.sip create mode 100644 sip/tqt/tqwindowsstyle.sip create mode 100644 sip/tqt/tqwindowsxpstyle.sip create mode 100644 sip/tqt/tqwizard.sip create mode 100644 sip/tqt/tqwmatrix.sip create mode 100644 sip/tqt/tqworkspace.sip create mode 100644 sip/tqt/versions.sip create mode 100644 sip/tqtaxcontainer/copying.sip create mode 100644 sip/tqtaxcontainer/tqaxbase.sip create mode 100644 sip/tqtaxcontainer/tqaxobject.sip create mode 100644 sip/tqtaxcontainer/tqaxwidget.sip create mode 100644 sip/tqtaxcontainer/tqtaxcontainermod.sip create mode 100644 sip/tqtcanvas/copying.sip create mode 100644 sip/tqtcanvas/tqcanvas.sip create mode 100644 sip/tqtcanvas/tqtcanvasmod.sip create mode 100644 sip/tqtext/copying.sip create mode 100644 sip/tqtext/tqextscintilla.sip create mode 100644 sip/tqtext/tqextscintillaapis.sip create mode 100644 sip/tqtext/tqextscintillabase.sip create mode 100644 sip/tqtext/tqextscintillacommand.sip create mode 100644 sip/tqtext/tqextscintillacommandset.sip create mode 100644 sip/tqtext/tqextscintilladocument.sip create mode 100644 sip/tqtext/tqextscintillalexer.sip create mode 100644 sip/tqtext/tqextscintillalexerbash.sip create mode 100644 sip/tqtext/tqextscintillalexerbatch.sip create mode 100644 sip/tqtext/tqextscintillalexercpp.sip create mode 100644 sip/tqtext/tqextscintillalexercsharp.sip create mode 100644 sip/tqtext/tqextscintillalexercss.sip create mode 100644 sip/tqtext/tqextscintillalexerdiff.sip create mode 100644 sip/tqtext/tqextscintillalexerhtml.sip create mode 100644 sip/tqtext/tqextscintillalexeridl.sip create mode 100644 sip/tqtext/tqextscintillalexerjava.sip create mode 100644 sip/tqtext/tqextscintillalexerjavascript.sip create mode 100644 sip/tqtext/tqextscintillalexerlua.sip create mode 100644 sip/tqtext/tqextscintillalexermakefile.sip create mode 100644 sip/tqtext/tqextscintillalexerperl.sip create mode 100644 sip/tqtext/tqextscintillalexerpov.sip create mode 100644 sip/tqtext/tqextscintillalexerproperties.sip create mode 100644 sip/tqtext/tqextscintillalexerpython.sip create mode 100644 sip/tqtext/tqextscintillalexerruby.sip create mode 100644 sip/tqtext/tqextscintillalexersql.sip create mode 100644 sip/tqtext/tqextscintillalexertex.sip create mode 100644 sip/tqtext/tqextscintillamacro.sip create mode 100644 sip/tqtext/tqextscintillaprinter.sip create mode 100644 sip/tqtext/tqtextmod.sip create mode 100644 sip/tqtgl/copying.sip create mode 100644 sip/tqtgl/tqgl.sip create mode 100644 sip/tqtgl/tqglcolormap.sip create mode 100644 sip/tqtgl/tqtglmod.sip create mode 100644 sip/tqtnetwork/copying.sip create mode 100644 sip/tqtnetwork/tqdns.sip create mode 100644 sip/tqtnetwork/tqftp.sip create mode 100644 sip/tqtnetwork/tqhostaddress.sip create mode 100644 sip/tqtnetwork/tqhttp.sip create mode 100644 sip/tqtnetwork/tqlocalfs.sip create mode 100644 sip/tqtnetwork/tqnetwork.sip create mode 100644 sip/tqtnetwork/tqserversocket.sip create mode 100644 sip/tqtnetwork/tqsocket.sip create mode 100644 sip/tqtnetwork/tqsocketdevice.sip create mode 100644 sip/tqtnetwork/tqtnetworkmod.sip create mode 100644 sip/tqtpe/copying.sip create mode 100644 sip/tqtpe/tqpeapplication.sip create mode 100644 sip/tqtpe/tqpeapplnk.sip create mode 100644 sip/tqtpe/tqpeconfig.sip create mode 100644 sip/tqtpe/tqpefilemanager.sip create mode 100644 sip/tqtpe/tqpefileselector.sip create mode 100644 sip/tqtpe/tqpefontdatabase.sip create mode 100644 sip/tqtpe/tqpeglobal.sip create mode 100644 sip/tqtpe/tqpemenubar.sip create mode 100644 sip/tqtpe/tqpemenubutton.sip create mode 100644 sip/tqtpe/tqpeqcopenvelope.sip create mode 100644 sip/tqtpe/tqpeqdawg.sip create mode 100644 sip/tqtpe/tqperesource.sip create mode 100644 sip/tqtpe/tqpetimestring.sip create mode 100644 sip/tqtpe/tqpetoolbar.sip create mode 100644 sip/tqtpe/tqtpemod.sip create mode 100644 sip/tqtsql/copying.sip create mode 100644 sip/tqtsql/tqdatabrowser.sip create mode 100644 sip/tqtsql/tqdatatable.sip create mode 100644 sip/tqtsql/tqdataview.sip create mode 100644 sip/tqtsql/tqeditorfactory.sip create mode 100644 sip/tqtsql/tqsql.sip create mode 100644 sip/tqtsql/tqsqlcursor.sip create mode 100644 sip/tqtsql/tqsqldatabase.sip create mode 100644 sip/tqtsql/tqsqldriver.sip create mode 100644 sip/tqtsql/tqsqleditorfactory.sip create mode 100644 sip/tqtsql/tqsqlerror.sip create mode 100644 sip/tqtsql/tqsqlfield.sip create mode 100644 sip/tqtsql/tqsqlform.sip create mode 100644 sip/tqtsql/tqsqlindex.sip create mode 100644 sip/tqtsql/tqsqlpropertymap.sip create mode 100644 sip/tqtsql/tqsqlquery.sip create mode 100644 sip/tqtsql/tqsqlrecord.sip create mode 100644 sip/tqtsql/tqsqlresult.sip create mode 100644 sip/tqtsql/tqsqlselectcursor.sip create mode 100644 sip/tqtsql/tqtsqlmod.sip create mode 100644 sip/tqttable/copying.sip create mode 100644 sip/tqttable/tqtable.sip create mode 100644 sip/tqttable/tqttablemod.sip create mode 100644 sip/tqtui/copying.sip create mode 100644 sip/tqtui/tqtuimod.sip create mode 100644 sip/tqtui/tqwidgetfactory.sip create mode 100644 sip/tqtxml/copying.sip create mode 100644 sip/tqtxml/tqdom.sip create mode 100644 sip/tqtxml/tqtxmlmod.sip diff --git a/build.py b/build.py index 80e48f9..456f080 100644 --- a/build.py +++ b/build.py @@ -19,7 +19,7 @@ # # This is the build script for PyTQt. It should be run in the top level # directory of the source distribution and by the Python interpreter for which -# it is being built. It uses either qmake or tmake to do the hard work of +# it is being built. It uses either tqmake or tmake to do the hard work of # generating the platform specific Makefiles. @@ -46,14 +46,14 @@ config = sip_tqt_config.SIPConfig("PyTQt 3.18.1") # Initialise the globals. sipMajorVersion = config.sip_version >> 16 -sciIncDir = config.qt_inc_dir -sciLibDir = config.qt_lib_dir +sciIncDir = config.tqt_inc_dir +sciLibDir = config.tqt_lib_dir sciLib = None sciVersion = None binDir = config.default_bin_dir modDir = config.default_mod_dir sipDir = config.default_sip_dir -buildModules = ["qt"] +buildModules = ["tqt"] tempBuildDir = None catCppFiles = 0 catSplit = 1 @@ -71,14 +71,14 @@ def usage(rcode = 2): print(" %s [-h] [-a version] [-b dir] [-c] [-d dir] [-g] [-j #] [-n dir] [-o dir] [-r] [-v dir]" % sip_tqt_config.script()) print("where:") print(" -h display this help message") - print(" -a tag explicitly enable the qtpe module") + print(" -a tag explicitly enable the tqtpe module") print(" -b dir where pyuic and pylupdate will be installed [default %s]" % config.default_bin_dir) print(" -c concatenate each module's C++ source files") print(" -d dir where the PyTQt modules will be installed [default %s]" % config.default_mod_dir) print(" -g always release the GIL (SIP-TQt v3.x behaviour)") print(" -j # split the concatenated C++ source files into # pieces [default 1]") - print(" -n dir the directory containing the TQScintilla header files [default %s]" % config.qt_inc_dir) - print(" -o dir the directory containing the TQScintilla library [default %s]" % config.qt_lib_dir) + print(" -n dir the directory containing the TQScintilla header files [default %s]" % config.tqt_inc_dir) + print(" -o dir the directory containing the TQScintilla library [default %s]" % config.tqt_lib_dir) print(" -r generate code with tracing enabled [default disabled]") print(" -v dir where the PyTQt .sip files will be installed [default %s]" % config.default_sip_dir) @@ -87,7 +87,7 @@ def usage(rcode = 2): def mkTempBuildDir(olddir=None): """Create a temporary build directory for a console application called - qttest, complete with patched Makefile. The global tempBuildDir is set to + tqttest, complete with patched Makefile. The global tempBuildDir is set to the name of the directory. The temporary directory becomes the current directory. @@ -107,26 +107,26 @@ def mkTempBuildDir(olddir=None): prevdir = sip_tqt_config.push_dir(tempBuildDir) - sip_tqt_config.copy_to_file("qttest.pro.in", + sip_tqt_config.copy_to_file("tqttest.pro.in", """TEMPLATE = app -TARGET = qttest +TARGET = tqttest CONFIG += console warn_off @TEST_OPENGL@ @BLX_CONFIG_APP@ -INCLUDEPATH = @BLX_INCLUDEPATH@ @TEST_QSCINTILLA_INC@ +INCLUDEPATH = @BLX_INCLUDEPATH@ @TEST_TQSCINTILLA_INC@ DEFINES = @BLX_DEFINES@ -SOURCES = qttest.cpp -LIBS += @TEST_QUI_LIB@ @TEST_QSCINTILLA_LIB@ +SOURCES = tqttest.cpp +LIBS += @TEST_TQUI_LIB@ @TEST_TQSCINTILLA_LIB@ """) # Disable OpenGL, tqui and TQScintilla support by default. config.patches["@TEST_OPENGL@"] = "" - config.patches["@TEST_QUI_LIB@"] = "" - config.patches["@TEST_QSCINTILLA_INC@"] = "" - config.patches["@TEST_QSCINTILLA_LIB@"] = "" + config.patches["@TEST_TQUI_LIB@"] = "" + config.patches["@TEST_TQSCINTILLA_INC@"] = "" + config.patches["@TEST_TQSCINTILLA_LIB@"] = "" # Create a dummy source file to suppress a qmake warning. - sip_tqt_config.copy_to_file("qttest.cpp", "") + sip_tqt_config.copy_to_file("tqttest.cpp", "") - config.create_makefile("qttest.pro") + config.create_makefile("tqttest.pro") else: sip_tqt_config.pop_dir(olddir) prevdir = None @@ -152,7 +152,7 @@ def tryModule(maindir, mname, incfile, ctor): if not os.access(msip, os.F_OK): return - sip_tqt_config.copy_to_file("qttest.cpp", + sip_tqt_config.copy_to_file("tqttest.cpp", """#include <%s> int main(int argc,char **argv) @@ -177,7 +177,7 @@ def checkTQScintilla(): sciglobal = os.path.join(sciIncDir, "tqextscintillaglobal.h") if os.access(sciglobal,os.F_OK): - config.patches["@PYQT_QSCINTILLA_INC@"] = sciIncDir + config.patches["@PYTQT_TQSCINTILLA_INC@"] = sciIncDir sip_tqt_config.inform("%s contains tqextscintillaglobal.h." % (sciIncDir)) @@ -209,13 +209,13 @@ def checkTQScintilla(): else: sciLib = sip_tqt_config.escape("-L" + sciLibDir) + " -ltqscintilla" - config.patches["@PYQT_QSCINTILLA_LIB@"] = sciLib + config.patches["@PYTQT_TQSCINTILLA_LIB@"] = sciLib else: - sip_tqt_config.inform("The TQScintilla library could not be found in %s and so the qtext module will not be built. If TQScintilla is installed then use the -o argument to explicitly specify the correct directory." % (sciLibDir)) + sip_tqt_config.inform("The TQScintilla library could not be found in %s and so the tqtext module will not be built. If TQScintilla is installed then use the -o argument to explicitly specify the correct directory." % (sciLibDir)) sciVersion = -1 else: - sip_tqt_config.inform("tqextscintillaglobal.h could not be found in %s and so the qtext module will not be built. If TQScintilla is installed then use the -n argument to explicitly specify the correct directory." % sciIncDir) + sip_tqt_config.inform("tqextscintillaglobal.h could not be found in %s and so the tqtext module will not be built. If TQScintilla is installed then use the -n argument to explicitly specify the correct directory." % sciIncDir) sciVersion = -1 @@ -225,54 +225,54 @@ def moduleChecks(maindir): """ sip_tqt_config.inform("Checking which additional PyTQt modules to build."); - tryModule(maindir,"qtcanvas", "qcanvas.h", "TQCanvas()") - tryModule(maindir,"qtnetwork", "qsocket.h", "TQSocket()") - tryModule(maindir,"qttable", "qtable.h", "TQTable()") - tryModule(maindir,"qtxml", "qdom.h", "TQDomImplementation()") + tryModule(maindir,"tqtcanvas", "tqcanvas.h", "TQCanvas()") + tryModule(maindir,"tqtnetwork", "tqsocket.h", "TQSocket()") + tryModule(maindir,"tqttable", "tqtable.h", "TQTable()") + tryModule(maindir,"tqtxml", "tqdom.h", "TQDomImplementation()") - if config.qt_version >= 0x030000: - tryModule(maindir,"qtsql", "qsql.h", "TQSql()") + if config.tqt_version >= 0x030000: + tryModule(maindir,"tqtsql", "tqsql.h", "TQSql()") - # We need a different Makefile for the qtgl module. + # We need a different Makefile for the tqtgl module. config.patches["@TEST_OPENGL@"] = "opengl" - config.create_makefile("qttest.pro") + config.create_makefile("tqttest.pro") - tryModule(maindir,"qtgl", "qgl.h", "TQGLWidget()") + tryModule(maindir,"tqtgl", "tqgl.h", "TQGLWidget()") # Put things back. config.patches["@TEST_OPENGL@"] = "" - config.create_makefile("qttest.pro") + config.create_makefile("tqttest.pro") # Check for the tqui library. - if config.qt_version >= 0x030000: + if config.tqt_version >= 0x030000: if sys.platform == "win32": tquilib = r"$(TQTDIR)\lib\tqui.lib" else: tquilib = "-ltqui" - config.patches["@PYQT_QUI_LIB@"] = tquilib + config.patches["@PYTQT_TQUI_LIB@"] = tquilib - config.patches["@TEST_QUI_LIB@"] = tquilib - config.create_makefile("qttest.pro") + config.patches["@TEST_TQUI_LIB@"] = tquilib + config.create_makefile("tqttest.pro") - tryModule(maindir,"qtui", "qwidgetfactory.h", "TQWidgetFactory()") + tryModule(maindir,"tqtui", "tqwidgetfactory.h", "TQWidgetFactory()") # Put things back. - config.patches["@TEST_QUI_LIB@"] = "" - config.create_makefile("qttest.pro") + config.patches["@TEST_TQUI_LIB@"] = "" + config.create_makefile("tqttest.pro") # Check for the TQScintilla library. if sciVersion >= 0: - config.patches["@TEST_QSCINTILLA_INC@"] = sciIncDir - config.patches["@TEST_QSCINTILLA_LIB@"] = sciLib - config.create_makefile("qttest.pro") + config.patches["@TEST_TQSCINTILLA_INC@"] = sciIncDir + config.patches["@TEST_TQSCINTILLA_LIB@"] = sciLib + config.create_makefile("tqttest.pro") - tryModule(maindir,"qtext", "tqextscintillabase.h", "TQextScintillaBase()") + tryModule(maindir,"tqtext", "tqextscintillabase.h", "TQextScintillaBase()") # Put things back. - config.patches["@TEST_QSCINTILLA_INC@"] = "" - config.patches["@TEST_QSCINTILLA_LIB@"] = "" - config.create_makefile("qttest.pro") + config.patches["@TEST_TQSCINTILLA_INC@"] = "" + config.patches["@TEST_TQSCINTILLA_LIB@"] = "" + config.create_makefile("tqttest.pro") def generateFeatures(featfile): @@ -302,7 +302,7 @@ def generateFeatures(featfile): "WORKSPACE"] # Generate the program which will generate the features file. - f = open("qttest.cpp","w") + f = open("tqttest.cpp","w") # Escape the backslashes so that the name can be embedded in a C++ string. ffstr = string.replace(featfile, "\\", "\\\\") @@ -328,7 +328,7 @@ int main(int argc,char **argv) #endif #if (defined(Q_OS_WIN32) || defined(Q_OS_WIN64)) && TQT_VERSION >= 0x030000 - if (qWinVersion() != TQt::WV_XP) + if (tqWinVersion() != TQt::WV_XP) fprintf(fp,"-x TQt_STYLE_WINDOWSXP\\n"); #endif """ % (ffstr, ffstr)) @@ -352,18 +352,18 @@ int main(int argc,char **argv) f.close() sip_tqt_config.run_make() - sip_tqt_config.run_program(os.path.join(os.getcwd(), "qttest")) + sip_tqt_config.run_program(os.path.join(os.getcwd(), "tqttest")) sip_tqt_config.run_make("clean") sip_tqt_config.inform("Generated the features file.") -def generateSource(mname, plattag, qttag, xtrtag): +def generateSource(mname, plattag, tqttag, xtrtag): """Generate the C++ source code for a particular PyTQt module. mname is the name of the module. plattag is the SIP-TQt tag for the platform. - qttag is the SIP-TQt tag for the TQt version. + tqttag is the SIP-TQt tag for the TQt version. xtrtag is an optional extra SIP-TQt tag. """ sip_tqt_config.inform("Generating the C++ source for the %s module." % mname) @@ -381,7 +381,7 @@ def generateSource(mname, plattag, qttag, xtrtag): pro = mname + ".pro" argv = ["-t", plattag, - "-t", qttag, + "-t", tqttag, "-z", "features", "-I", "sip", "-m", mname + "/" + pro + ".in", @@ -474,8 +474,8 @@ def main(argv): if opt == "-h": usage(0) elif opt == "-a": - global qpeTag - qpeTag = arg + global tqpeTag + tqpeTag = arg elif opt == "-b": global binDir binDir = arg @@ -522,19 +522,19 @@ def main(argv): sip_tqt_config.error("Please copy the license file %s to the sip directory.\n" % config.license_file) # Check the TQt version. - if config.qt_version == 0: + if config.tqt_version == 0: sip_tqt_config.error("SIP-TQt has been built with TQt support disabled.\n") # Early versions of TQt for the Mac didn't include everything. Rather than # maintain these in the future we just mandate a later version. - if sys.platform == "darwin" and config.qt_version < 0x030100: + if sys.platform == "darwin" and config.tqt_version < 0x030100: sip_tqt_config.error("PyTQt for MacOS/X requires TQt v3.1.0 or later.\n") # Check the installation directory is valid and add it as a patch. if not os.access(modDir,os.F_OK): sip_tqt_config.error("The %s PyTQt destination directory does not seem to exist. Use the -d argument to set the correct directory." % (modDir)) - config.patches["@PYQT_MODDIR@"] = sip_tqt_config.escape(modDir) + config.patches["@PYTQT_MODDIR@"] = sip_tqt_config.escape(modDir) sip_tqt_config.inform("%s is the PyTQt installation directory." % (modDir)) @@ -544,7 +544,7 @@ def main(argv): else: warn = "warn_off" - config.patches["@PYQT_WARN@"] = warn + config.patches["@PYTQT_WARN@"] = warn # Create patches to allow some modules to link against others. if sipMajorVersion >= 4: @@ -552,52 +552,52 @@ def main(argv): elif sys.platform == "win32": modlink = sip_tqt_config.escape(os.path.join(modDir, "libtqtc.lib")) else: - modlink = sip_tqt_config.escape("-L" + modDir) + " -lqtcmodule" + modlink = sip_tqt_config.escape("-L" + modDir) + " -ltqtcmodule" - config.patches["@PYQT_QT_MODULE@"] = modlink + config.patches["@PYTQT_TQT_MODULE@"] = modlink if sipMajorVersion >= 4: modlink = "" elif sys.platform == "win32": modlink = sip_tqt_config.escape(os.path.join(modDir, "libtqttablec.lib")) + " " + sip_tqt_config.escape(os.path.join(modDir, "libtqtc.lib")) else: - modlink = sip_tqt_config.escape("-L" + modDir) + " -lqttablecmodule -lqtcmodule" + modlink = sip_tqt_config.escape("-L" + modDir) + " -ltqttablecmodule -ltqtcmodule" - config.patches["@PYQT_QTTABLE_MODULE@"] = modlink + config.patches["@PYTQT_TQTTABLE_MODULE@"] = modlink # The professional edition needs special handling if XML support is needed. - if config.qt_edition == "professional": + if config.tqt_edition == "professional": rbprof = "rbprof" else: rbprof = "" - config.patches["@PYQT_RBPROF@"] = rbprof + config.patches["@PYTQT_RBPROF@"] = rbprof # Link in the qassistantclient library for TQt v3.1+. - qaclib = "" + tqaclib = "" - if config.qt_version >= 0x030100: + if config.tqt_version >= 0x030100: if sys.platform == "win32": - qaclib = r"$(TQTDIR)\lib\qassistantclient.lib" + tqaclib = r"$(TQTDIR)\lib\tqassistantclient.lib" else: - qaclib = "-lqassistantclient" + tqaclib = "-ltqassistantclient" - config.patches["@PYQT_QASSISTANTCLIENT_LIB@"] = qaclib + config.patches["@PYTQT_QASSISTANTCLIENT_LIB@"] = tqaclib # Check for TQScintilla. - if config.qt_version >= 0x030000: + if config.tqt_version >= 0x030000: checkTQScintilla() # Create a build directory that we can compile test programs. maindir = mkTempBuildDir() # Check what additional modules to build. - if config.qt_version >= 0x020000: + if config.tqt_version >= 0x020000: moduleChecks(maindir) # Work out the platform and TQt version tags to pass to SIP-TQt to generate the # code we need. - if config.qt_lib == "qte": + if config.tqt_lib == "tqte": plattag = "WS_QWS" elif sys.platform == "win32": plattag = "WS_WIN" @@ -606,7 +606,7 @@ def main(argv): else: plattag = "WS_X11" - qttags = { + tqttags = { 0x020000: "TQt_1_43", 0x020100: "TQt_2_00", 0x020200: "TQt_2_1_0", @@ -626,7 +626,7 @@ def main(argv): 0x040000: "TQt_3_3_0" } - qttag = versionToTag(config.qt_version, qttags, "TQt") + tqttag = versionToTag(config.tqt_version, tqttags, "TQt") # Work out the TQScintilla tag. if sciVersion >= 0: @@ -648,20 +648,20 @@ def main(argv): subdirs = [] for mname in buildModules: - if mname == "qtext": + if mname == "tqtext": xtratag = scitag else: xtratag = None - generateSource(mname, plattag, qttag, xtratag) + generateSource(mname, plattag, tqttag, xtratag) subdirs.append(mname) - # We handle the qtpe module explicitly rather than auto-detect. This is + # We handle the tqtpe module explicitly rather than auto-detect. This is # because it does things a bit differently and I'm too lazy to deal with it # properly at the moment. - if qpeTag: - generateSource("qtpe", plattag, qttag, qpeTag) - subdirs.append("qtpe") + if tqpeTag: + generateSource("tqtpe", plattag, tqttag, tqpeTag) + subdirs.append("tqtpe") # Install the .sip files. sip_tqt_config.inform("Creating Makefile for .sip files.") @@ -683,23 +683,23 @@ def main(argv): subdirs.append("sip") # See which version of pyuic to build. - config.patches["@PYQT_BINDIR@"] = sip_tqt_config.escape(binDir) + config.patches["@PYTQT_BINDIR@"] = sip_tqt_config.escape(binDir) - if config.qt_version >= 0x030000: - sip_tqt_config.inform("Creating Makefile for pyuic3.") - subdirs.append("pyuic3") - olddir = sip_tqt_config.push_dir("pyuic3") + if config.tqt_version >= 0x030000: + sip_tqt_config.inform("Creating Makefile for pytquic3.") + subdirs.append("pytquic3") + olddir = sip_tqt_config.push_dir("pytquic3") - config.create_makefile("pyuic.pro", []) + config.create_makefile("pytquic.pro", []) sip_tqt_config.pop_dir(olddir) # Build pylupdate if TQt v3.0 or later. - if config.qt_version >= 0x030000: - sip_tqt_config.inform("Creating Makefile for pylupdate3.") - subdirs.append("pylupdate3") - olddir = sip_tqt_config.push_dir("pylupdate3") + if config.tqt_version >= 0x030000: + sip_tqt_config.inform("Creating Makefile for pytqlupdate3.") + subdirs.append("pytqlupdate3") + olddir = sip_tqt_config.push_dir("pytqlupdate3") - config.create_makefile("pylupdate.pro", []) + config.create_makefile("pytqlupdate.pro", []) sip_tqt_config.pop_dir(olddir) # Generate the top-level Makefile. diff --git a/configure.py b/configure.py index 56c3537..30b117a 100644 --- a/configure.py +++ b/configure.py @@ -33,51 +33,51 @@ import sip_tqt_config src_dir = os.path.dirname(os.path.abspath(__file__)) # Initialise the globals. -pyqt_version = 0x031201 -pyqt_version_str = "3.18.1" +pytqt_version = 0x031201 +pytqt_version_str = "3.18.1" sip_min_version = 0x040800 # Try and find a TQt installation to use as the default. try: - qt_dir = os.environ["TQTDIR"] + tqt_dir = os.environ["TQTDIR"] except KeyError: - qt_dir = "" - - -qt_version = 0 -qt_edition = "" -qt_incdir = None -qt_libdir = None -qt_threaded = 0 -qt_winconfig = "" - -pyqt = None -pyqt_modules = [] -qt_sip_flags = [] -qtext_sip_flags = [] -qtpe_sip_flags = [] -qsci_version = 0 + tqt_dir = "" + + +tqt_version = 0 +tqt_edition = "" +tqt_incdir = None +tqt_libdir = None +tqt_threaded = 0 +tqt_winconfig = "" + +pytqt = None +pytqt_modules = [] +tqt_sip_flags = [] +tqtext_sip_flags = [] +tqtpe_sip_flags = [] +tqsci_version = 0 disabled_classes = [] if sys.platform == "win32": - qsci_define = "TQEXTSCINTILLA_DLL" + tqsci_define = "TQEXTSCINTILLA_DLL" else: - qsci_define = "" + tqsci_define = "" # Get the SIP-TQt configuration. sipcfg = sip_tqt_config.Configuration() # Command line options. opt_tqtlib = None -opt_qconfigdir = None -opt_pyqtbindir = sipcfg.default_bin_dir -opt_pyqtmoddir = os.path.join(sipcfg.default_mod_dir, "PyTQt") -opt_pyqtsipdir = sipcfg.default_sip_dir -opt_qtpetag = None -opt_qsciincdir = None -opt_qscilibdir = None +opt_tqconfigdir = None +opt_pytqtbindir = sipcfg.default_bin_dir +opt_pytqtmoddir = os.path.join(sipcfg.default_mod_dir, "PyTQt") +opt_pytqtsipdir = sipcfg.default_sip_dir +opt_tqtpetag = None +opt_tqsciincdir = None +opt_tqscilibdir = None opt_static = 0 opt_debug = 0 opt_concat = 0 @@ -97,22 +97,22 @@ def usage(rcode = 2): rcode is the return code passed back to the calling process. """ - if qt_dir: - def_qt_dir = qt_dir + if tqt_dir: + def_tqt_dir = tqt_dir else: - def_qt_dir = "none" + def_tqt_dir = "none" sys.stdout.write("Usage:\n") sys.stdout.write(" python configure.py [-h] [-a tag] [-b dir] [-c] [-d dir] [-e lib] [-f] [-g dir] [-i] [-j #] [-k] [-l dir] [-m dir] [-n dir] [-o dir] [-q dir] [-r] [-s] [-u] [-v dir] [-w] [-y lib] option=value option+=value ...\n") sys.stdout.write("where:\n") sys.stdout.write(" -h display this help message\n") - sys.stdout.write(" -a tag explicitly enable the qtpe module\n") - sys.stdout.write(" -b dir where pyuic and pylupdate will be installed [default %s]\n" % opt_pyqtbindir) + sys.stdout.write(" -a tag explicitly enable the tqtpe module\n") + sys.stdout.write(" -b dir where pytquic and pytqlupdate will be installed [default %s]\n" % opt_pytqtbindir) sys.stdout.write(" -c concatenate each module's C/C++ source files\n") - sys.stdout.write(" -d dir where the PyTQt modules will be installed [default %s]\n" % opt_pyqtmoddir) + sys.stdout.write(" -d dir where the PyTQt modules will be installed [default %s]\n" % opt_pytqtmoddir) sys.stdout.write(" -e lib explicitly specify the python library\n") sys.stdout.write(" -f keep any existing features file (when cross-compiling) [default remove]\n") - sys.stdout.write(" -g dir where the TQt qconfig.h file can be found [default TQt include directory]\n") + sys.stdout.write(" -g dir where the TQt tqconfig.h file can be found [default TQt include directory]\n") sys.stdout.write(" -i enable checking of signed interpreters using the VendorID package [default disabled]\n") sys.stdout.write(" -j # split the concatenated C++ source files into # pieces [default 1]\n") sys.stdout.write(" -k build the PyTQt modules as static libraries\n") @@ -120,13 +120,13 @@ def usage(rcode = 2): sys.stdout.write(" -m dir the directory containing the VendorID library [default %s]\n" % opt_vendlibdir) sys.stdout.write(" -n dir the directory containing the TQScintilla header files [default TQt include directory]\n") sys.stdout.write(" -o dir the directory containing the TQScintilla library [default TQt lib directory]\n") - sys.stdout.write(" -q dir the root directory of the TQt installation [default %s]\n" % def_qt_dir) + sys.stdout.write(" -q dir the root directory of the TQt installation [default %s]\n" % def_tqt_dir) sys.stdout.write(" -r generate code with tracing enabled [default disabled]\n") sys.stdout.write(" -s TQScintilla is a static library and not a DLL (Windows only)\n") sys.stdout.write(" -u build with debugging symbols (requires a debug build of Python on Windows\n") - sys.stdout.write(" -v dir where the PyTQt .sip files will be installed [default %s]\n" % opt_pyqtsipdir) + sys.stdout.write(" -v dir where the PyTQt .sip files will be installed [default %s]\n" % opt_pytqtsipdir) sys.stdout.write(" -w don't suppress compiler output during configuration\n") - sys.stdout.write(" -y lib explicitly specify the type of TQt library, either qt, qt-mt, qte, qte-mt, qtmt, tqt, tqt-mt, tqte, tqte-mt or tqtmt\n") + sys.stdout.write(" -y lib explicitly specify the type of TQt library, either tqt, tqt-mt, tqte, tqte-mt or tqtmt\n") sys.stdout.write(" -z accept the license terms without prompting\n") sys.exit(rcode) @@ -151,7 +151,7 @@ class ConfigureBase: """ return [] - def qt_version_tags(self): + def tqt_version_tags(self): """Get the versions tags for the configuration. Returns a dictionary of versions and corresponding tags. @@ -181,66 +181,66 @@ class ConfigureBase: def module_dir(self): """Return the configuration's module directory. """ - return opt_pyqtmoddir + return opt_pytqtmoddir def module_installs(self): """Return a list of files to install in the module directory other than the modules themselves. """ - return ["__init__.py", "pyqtconfig.py"] + return ["__init__.py", "pytqtconfig.py"] def sip_dir(self): """Return the configuration's .sip files directory. """ - return opt_pyqtsipdir + return opt_pytqtsipdir class ConfigurePyTQt3(ConfigureBase): """This class defines the methods to configure PyTQt v3. """ def check_modules(self): - pyqt_modules.append("qt") + pytqt_modules.append("tqt") - check_module("qtcanvas", "qcanvas.h", "TQCanvas()") - check_module("qtnetwork", "qsocket.h", "TQSocket()") - check_module("qttable", "qtable.h", "TQTable()") - check_module("qtxml", "qdom.h", "TQDomImplementation()") - check_module("qtgl", "qgl.h", "TQGLWidget()", opengl=1) + check_module("tqtcanvas", "tqcanvas.h", "TQCanvas()") + check_module("tqtnetwork", "tqsocket.h", "TQSocket()") + check_module("tqttable", "tqtable.h", "TQTable()") + check_module("tqtxml", "tqdom.h", "TQDomImplementation()") + check_module("tqtgl", "tqgl.h", "TQGLWidget()", opengl=1) - if qt_version >= 0x030000: - check_module("qtui", "qwidgetfactory.h", "TQWidgetFactory()", lib="tqui") + if tqt_version >= 0x030000: + check_module("tqtui", "tqwidgetfactory.h", "TQWidgetFactory()", lib="tqui") - if qt_edition in ("enterprise", "free"): - check_module("qtsql", "qsql.h", "TQSql()") + if tqt_edition in ("enterprise", "free"): + check_module("tqtsql", "tqsql.h", "TQSql()") if sys.platform == "win32" and sipcfg.sip_version >= 0x040200: - check_module("qtaxcontainer", "qaxobject.h", "TQAxObject()", lib="qaxcontainer") + check_module("tqtaxcontainer", "tqaxobject.h", "TQAxObject()", lib="tqaxcontainer") - if qsci_version: - check_module("qtext", "tqextscintillabase.h", "TQextScintillaBase()", define=qsci_define, include_dir=opt_qsciincdir, lib_dir=opt_qscilibdir, lib="tqscintilla") + if tqsci_version: + check_module("tqtext", "tqextscintillabase.h", "TQextScintillaBase()", define=tqsci_define, include_dir=opt_tqsciincdir, lib_dir=opt_tqscilibdir, lib="tqscintilla") - if opt_qtpetag: - pyqt_modules.append("qtpe") + if opt_tqtpetag: + pytqt_modules.append("tqtpe") - qtmod_lib = None + tqtmod_lib = None - if qt_version >= 0x030100: + if tqt_version >= 0x030100: sip_tqt_config.inform("Checking to see if the TQAssistantClient class is available...") - if check_class("qassistantclient.h", "TQAssistantClient(\"foo\")", lib="qassistantclient"): - qtmod_lib = "qassistantclient" + if check_class("tqassistantclient.h", "TQAssistantClient(\"foo\")", lib="tqassistantclient"): + tqtmod_lib = "tqassistantclient" else: - if check_class("ntqassistantclient.h", "TQAssistantClient(\"foo\")", lib="qassistantclient"): - qtmod_lib = "qassistantclient" + if check_class("ntqassistantclient.h", "TQAssistantClient(\"foo\")", lib="tqassistantclient"): + tqtmod_lib = "tqassistantclient" else: disabled_classes.append("TQAssistantClient") - return qtmod_lib + return tqtmod_lib def sip_flags(self): return get_feature_flags() - def qt_version_tags(self): + def tqt_version_tags(self): return { 0x010403: None, 0x020000: "TQt_1_43", @@ -265,102 +265,102 @@ class ConfigurePyTQt3(ConfigureBase): } def code(self, extra_include_dirs, extra_lib_dir, extra_libs): - generate_code("qt", extra_include_dirs=extra_include_dirs, extra_lib_dir=extra_lib_dir, extra_libs=extra_libs) + generate_code("tqt", extra_include_dirs=extra_include_dirs, extra_lib_dir=extra_lib_dir, extra_libs=extra_libs) - if "qtext" in pyqt_modules: - generate_code("qtext", extra_define=qsci_define, extra_include_dirs=[opt_qsciincdir], extra_lib_dir=opt_qscilibdir, extra_libs=["tqscintilla"]+extra_libs, sip_flags=qtext_sip_flags) + if "tqtext" in pytqt_modules: + generate_code("tqtext", extra_define=tqsci_define, extra_include_dirs=[opt_tqsciincdir], extra_lib_dir=opt_tqscilibdir, extra_libs=["tqscintilla"]+extra_libs, sip_flags=tqtext_sip_flags) - if "qtgl" in pyqt_modules: - generate_code("qtgl", opengl=1, extra_include_dirs=extra_include_dirs, extra_lib_dir=extra_lib_dir, extra_libs=extra_libs) + if "tqtgl" in pytqt_modules: + generate_code("tqtgl", opengl=1, extra_include_dirs=extra_include_dirs, extra_lib_dir=extra_lib_dir, extra_libs=extra_libs) - if "qtpe" in pyqt_modules: - generate_code("qtpe", extra_include_dirs=extra_include_dirs, extra_lib_dir=extra_lib_dir, extra_libs=["qpe"]+extra_libs, sip_flags=qtpe_sip_flags) + if "tqtpe" in pytqt_modules: + generate_code("tqtpe", extra_include_dirs=extra_include_dirs, extra_lib_dir=extra_lib_dir, extra_libs=["tqpe"]+extra_libs, sip_flags=tqtpe_sip_flags) - if "qtui" in pyqt_modules: - generate_code("qtui", extra_include_dirs=extra_include_dirs, extra_lib_dir=extra_lib_dir, extra_libs=["tqui"]+extra_libs) + if "tqtui" in pytqt_modules: + generate_code("tqtui", extra_include_dirs=extra_include_dirs, extra_lib_dir=extra_lib_dir, extra_libs=["tqui"]+extra_libs) - if "qtaxcontainer" in pyqt_modules: - generate_code("qtaxcontainer", extra_include_dirs=extra_include_dirs, extra_lib_dir=extra_lib_dir, extra_libs=["qaxcontainer"]+extra_libs) + if "tqtaxcontainer" in pytqt_modules: + generate_code("tqtaxcontainer", extra_include_dirs=extra_include_dirs, extra_lib_dir=extra_lib_dir, extra_libs=["tqaxcontainer"]+extra_libs) # The rest don't need special handling. - for m in ("qtcanvas", "qtnetwork", "qtsql", "qttable", "qtxml"): - if m in pyqt_modules: + for m in ("tqtcanvas", "tqtnetwork", "tqtsql", "tqttable", "tqtxml"): + if m in pytqt_modules: generate_code(m, extra_include_dirs=extra_include_dirs, extra_lib_dir=extra_lib_dir, extra_libs=extra_libs) def tools(self): tool_dirs = [] - if qt_version >= 0x030000: + if tqt_version >= 0x030000: # The Professional Edition needs special handling. - prof = (qt_edition == "professional") + prof = (tqt_edition == "professional") - sip_tqt_config.inform("Creating pyuic Makefile...") + sip_tqt_config.inform("Creating pytquic Makefile...") - if prof or "qtxml" not in pyqt_modules: - buildfile= "pyuic-prof.sbf" + if prof or "tqtxml" not in pytqt_modules: + buildfile= "pytquic-prof.sbf" - for xml in ("qdom.cpp", "qxml.cpp"): - shutil.copyfile(qt_dir + "/src/xml/" + xml, "pyuic3/" + xml) + for xml in ("tqdom.cpp", "tqxml.cpp"): + shutil.copyfile(tqt_dir + "/src/xml/" + xml, "pytquic3/" + xml) else: - buildfile= "pyuic.sbf" + buildfile= "pytquic.sbf" makefile = sip_tqt_config.ProgramMakefile( configuration=sipcfg, - build_file=os.path.join(src_dir, "pyuic3", buildfile), - dir="pyuic3", - install_dir=opt_pyqtbindir, + build_file=os.path.join(src_dir, "pytquic3", buildfile), + dir="pytquic3", + install_dir=opt_pytqtbindir, console=1, - qt=1, + tqt=1, warnings=1 ) makefile.extra_defines.append("UIC") - makefile.extra_defines.append("QT_INTERNAL_XML") + makefile.extra_defines.append("TQT_INTERNAL_XML") - if prof or "qtxml" not in pyqt_modules: + if prof or "tqtxml" not in pytqt_modules: makefile.extra_defines.append("TQT_MODULE_XML") - if qt_version < 0x030100: - makefile.extra_include_dirs.append(qt_dir + "/src/3rdparty/zlib") - makefile.extra_include_dirs.append(os.path.join(src_dir, "pyuic3")) + if tqt_version < 0x030100: + makefile.extra_include_dirs.append(tqt_dir + "/src/3rdparty/zlib") + makefile.extra_include_dirs.append(os.path.join(src_dir, "pytquic3")) - if not os.access("pyuic3", os.F_OK): - os.mkdir("pyuic3") + if not os.access("pytquic3", os.F_OK): + os.mkdir("pytquic3") makefile.generate() - tool_dirs.append("pyuic3") + tool_dirs.append("pytquic3") - sip_tqt_config.inform("Creating pylupdate Makefile...") + sip_tqt_config.inform("Creating pytqlupdate Makefile...") - if prof or "qtxml" not in pyqt_modules: - buildfile= "pylupdate-prof.sbf" + if prof or "tqtxml" not in pytqt_modules: + buildfile= "pytqlupdate-prof.sbf" - shutil.copyfile(qt_dir + "/src/xml/qxml.cpp", "pylupdate3/qxml.cpp") + shutil.copyfile(tqt_dir + "/src/xml/tqxml.cpp", "pytqlupdate3/tqxml.cpp") else: - buildfile= "pylupdate.sbf" + buildfile= "pytqlupdate.sbf" makefile = sip_tqt_config.ProgramMakefile( configuration=sipcfg, - build_file=os.path.join(src_dir, "pylupdate3", buildfile), - dir="pylupdate3", - install_dir=opt_pyqtbindir, + build_file=os.path.join(src_dir, "pytqlupdate3", buildfile), + dir="pytqlupdate3", + install_dir=opt_pytqtbindir, console=1, - qt=1, + tqt=1, warnings=1 ) - makefile.extra_defines.append("QT_INTERNAL_XML") + makefile.extra_defines.append("TQT_INTERNAL_XML") - if prof or "qtxml" not in pyqt_modules: + if prof or "tqtxml" not in pytqt_modules: makefile.extra_defines.append("TQT_MODULE_XML") - makefile.extra_include_dirs.append(os.path.join(src_dir, "pylupdate3")) + makefile.extra_include_dirs.append(os.path.join(src_dir, "pytqlupdate3")) - if not os.access("pylupdate3", os.F_OK): - os.mkdir("pylupdate3") + if not os.access("pytqlupdate3", os.F_OK): + os.mkdir("pytqlupdate3") makefile.generate() - tool_dirs.append("pylupdate3") + tool_dirs.append("pytqlupdate3") return tool_dirs @@ -368,29 +368,29 @@ class ConfigurePyTQt3(ConfigureBase): def inform_user(): """Tell the user the option values that are going to be used. """ - if qt_edition: - edstr = qt_edition + " edition " + if tqt_edition: + edstr = tqt_edition + " edition " else: edstr = "" - sip_tqt_config.inform("TQt v%s %sis being used." % (sip_tqt_config.version_to_string(qt_version), edstr)) + sip_tqt_config.inform("TQt v%s %sis being used." % (sip_tqt_config.version_to_string(tqt_version), edstr)) sip_tqt_config.inform("SIP-TQt %s is being used." % sipcfg.sip_version_str) - sip_tqt_config.inform("These PyTQt modules will be built: %s." % ' '.join(pyqt_modules)) + sip_tqt_config.inform("These PyTQt modules will be built: %s." % ' '.join(pytqt_modules)) if disabled_classes: sip_tqt_config.inform("Support for these TQt classes has been disabled: %s." % ' '.join(disabled_classes)) - sip_tqt_config.inform("The PyTQt modules will be installed in %s." % opt_pyqtmoddir) - sip_tqt_config.inform("The PyTQt .sip files will be installed in %s." % opt_pyqtsipdir) + sip_tqt_config.inform("The PyTQt modules will be installed in %s." % opt_pytqtmoddir) + sip_tqt_config.inform("The PyTQt .sip files will be installed in %s." % opt_pytqtsipdir) - sip_tqt_config.inform("The TQt header files are in %s." % qt_incdir) - sip_tqt_config.inform("The %s TQt library is in %s." % (opt_tqtlib, qt_libdir)) + sip_tqt_config.inform("The TQt header files are in %s." % tqt_incdir) + sip_tqt_config.inform("The %s TQt library is in %s." % (opt_tqtlib, tqt_libdir)) - if qt_version >= 0x020000: - sip_tqt_config.inform("pyuic will be installed in %s." % opt_pyqtbindir) + if tqt_version >= 0x020000: + sip_tqt_config.inform("pyuic will be installed in %s." % opt_pytqtbindir) - if qt_version >= 0x030000: - sip_tqt_config.inform("pylupdate will be installed in %s." % opt_pyqtbindir) + if tqt_version >= 0x030000: + sip_tqt_config.inform("pylupdate will be installed in %s." % opt_pytqtbindir) if opt_vendorcheck: sip_tqt_config.inform("PyTQt will only be usable with signed interpreters.") @@ -407,64 +407,64 @@ def create_config(module, template, macros): sip_tqt_config.inform("Creating %s..." % module) content = { - "pyqt_config_args": sys.argv[1:], - "pyqt_version": pyqt_version, - "pyqt_version_str": pyqt_version_str, - "pyqt_bin_dir": opt_pyqtbindir, - "pyqt_mod_dir": opt_pyqtmoddir, - "pyqt_sip_dir": opt_pyqtsipdir, - "pyqt_modules": pyqt_modules, - "pyqt_qt_sip_flags": qt_sip_flags, - "qt_version": qt_version, - "qt_edition": qt_edition, - "qt_winconfig": qt_winconfig, - "qt_framework": 0, - "qt_threaded": qt_threaded, - "qt_dir": qt_dir, - "qt_inc_dir": qt_incdir, - "qt_lib": opt_tqtlib, - "qt_lib_dir": qt_libdir + "pytqt_config_args": sys.argv[1:], + "pytqt_version": pytqt_version, + "pytqt_version_str": pytqt_version_str, + "pytqt_bin_dir": opt_pytqtbindir, + "pytqt_mod_dir": opt_pytqtmoddir, + "pytqt_sip_dir": opt_pytqtsipdir, + "pytqt_modules": pytqt_modules, + "pytqt_tqt_sip_flags": tqt_sip_flags, + "tqt_version": tqt_version, + "tqt_edition": tqt_edition, + "tqt_winconfig": tqt_winconfig, + "tqt_framework": 0, + "tqt_threaded": tqt_threaded, + "tqt_dir": tqt_dir, + "tqt_inc_dir": tqt_incdir, + "tqt_lib": opt_tqtlib, + "tqt_lib_dir": tqt_libdir } - if "qtaxcontainer" in pyqt_modules: - content["pyqt_qtaxcontainer_sip_flags"] = qt_sip_flags + if "tqtaxcontainer" in pytqt_modules: + content["pytqt_tqtaxcontainer_sip_flags"] = tqt_sip_flags - if "qtcanvas" in pyqt_modules: - content["pyqt_qtcanvas_sip_flags"] = qt_sip_flags + if "tqtcanvas" in pytqt_modules: + content["pytqt_tqtcanvas_sip_flags"] = tqt_sip_flags - if "qtext" in pyqt_modules: - content["pyqt_qtext_sip_flags"] = qtext_sip_flags + if "tqtext" in pytqt_modules: + content["pytqt_tqtext_sip_flags"] = tqtext_sip_flags # These are internal. - content["_pyqt_qscintilla_defines"] = qsci_define - content["_pyqt_qscintilla_inc_dir"] = opt_qsciincdir - content["_pyqt_qscintilla_lib_dir"] = opt_qscilibdir + content["_pytqt_tqscintilla_defines"] = tqsci_define + content["_pytqt_tqscintilla_inc_dir"] = opt_tqsciincdir + content["_pytqt_tqscintilla_lib_dir"] = opt_tqscilibdir - if "qtgl" in pyqt_modules: - content["pyqt_qtgl_sip_flags"] = qt_sip_flags + if "tqtgl" in pytqt_modules: + content["pytqt_tqtgl_sip_flags"] = tqt_sip_flags - if "qtnetwork" in pyqt_modules: - content["pyqt_qtnetwork_sip_flags"] = qt_sip_flags + if "tqtnetwork" in pytqt_modules: + content["pytqt_tqtnetwork_sip_flags"] = tqt_sip_flags - if "qtpe" in pyqt_modules: - content["pyqt_qtpe_sip_flags"] = qtpe_sip_flags + if "tqtpe" in pytqt_modules: + content["pytqt_tqtpe_sip_flags"] = tqtpe_sip_flags - if "qtsql" in pyqt_modules: - content["pyqt_qtsql_sip_flags"] = qt_sip_flags + if "tqtstql" in pytqt_modules: + content["pytqt_tqtsql_sip_flags"] = tqt_sip_flags - if "qttable" in pyqt_modules: - content["pyqt_qttable_sip_flags"] = qt_sip_flags + if "tqttable" in pytqt_modules: + content["pytqt_tqttable_sip_flags"] = tqt_sip_flags - if "qtui" in pyqt_modules: - content["pyqt_qtui_sip_flags"] = qt_sip_flags + if "tqtui" in pytqt_modules: + content["pytqt_tqtui_sip_flags"] = tqt_sip_flags - if "qtxml" in pyqt_modules: - content["pyqt_qtxml_sip_flags"] = qt_sip_flags + if "tqtxml" in pytqt_modules: + content["pytqt_tqtxml_sip_flags"] = tqt_sip_flags sip_tqt_config.create_config_module(module, template, content, macros) -def compile_qt_program(name, define=None, include_dir=None, lib_dir=None, lib=None, opengl=0, python=0, debug=0): +def compile_tqt_program(name, define=None, include_dir=None, lib_dir=None, lib=None, opengl=0, python=0, debug=0): """Compile a simple TQt application. name is the name of the single source file. @@ -481,7 +481,7 @@ def compile_qt_program(name, define=None, include_dir=None, lib_dir=None, lib=No Returns the name of the executable suitable for running or None if it wasn't created. """ - makefile = sip_tqt_config.ProgramMakefile(sipcfg, console=1, qt=1, warnings=0, opengl=opengl, python=python, debug=debug) + makefile = sip_tqt_config.ProgramMakefile(sipcfg, console=1, tqt=1, warnings=0, opengl=opengl, python=python, debug=debug) if define: makefile.extra_defines.append(define) @@ -537,38 +537,38 @@ def compile_qt_program(name, define=None, include_dir=None, lib_dir=None, lib=No return exe -def check_qscintilla(): +def check_tqscintilla(): """See if TQScintilla can be found and what its version is. """ # Set the defaults if they haven't been explicitly specified. - global opt_qsciincdir, opt_qscilibdir + global opt_tqsciincdir, opt_tqscilibdir - if opt_qsciincdir is None: - opt_qsciincdir = qt_incdir + if opt_tqsciincdir is None: + opt_tqsciincdir = tqt_incdir - if opt_qscilibdir is None: - opt_qscilibdir = qt_libdir + if opt_tqscilibdir is None: + opt_tqscilibdir = tqt_libdir # Find the TQScintilla header files. - sciglobal = os.path.join(opt_qsciincdir, "tqextscintillaglobal.h") + sciglobal = os.path.join(opt_tqsciincdir, "tqextscintillaglobal.h") if os.access(sciglobal, os.F_OK): # Get the TQScintilla version number. - global qsci_version + global tqsci_version - qsci_version, sciversstr = sip_tqt_config.read_version(sciglobal, "TQScintilla", "TQSCINTILLA_VERSION", "TQSCINTILLA_VERSION_STR") + tqsci_version, sciversstr = sip_tqt_config.read_version(sciglobal, "TQScintilla", "TQSCINTILLA_VERSION", "TQSCINTILLA_VERSION_STR") - if glob.glob(os.path.join(opt_qscilibdir, "*tqscintilla*")): + if glob.glob(os.path.join(opt_tqscilibdir, "*tqscintilla*")): sip_tqt_config.inform("TQScintilla %s is being used." % sciversstr) # If we find a snapshot then set a negative version number as a # special case. if sciversstr.find("snapshot") >= 0: - qsci_version = -1 + tqsci_version = -1 else: - sip_tqt_config.inform("The TQScintilla library could not be found in %s and so the qtext module will not be built. If TQScintilla is installed then use the -o argument to explicitly specify the correct directory." % opt_qscilibdir) + sip_tqt_config.inform("The TQScintilla library could not be found in %s and so the tqtext module will not be built. If TQScintilla is installed then use the -o argument to explicitly specify the correct directory." % opt_tqscilibdir) else: - sip_tqt_config.inform("tqextscintillaglobal.h could not be found in %s and so the qtext module will not be built. If TQScintilla is installed then use the -n argument to explicitly specify the correct directory." % opt_qsciincdir) + sip_tqt_config.inform("tqextscintillaglobal.h could not be found in %s and so the tqtext module will not be built. If TQScintilla is installed then use the -n argument to explicitly specify the correct directory." % opt_tqsciincdir) def check_vendorid(): @@ -608,10 +608,10 @@ def check_module(mname, incfile, ctor, define=None, include_dir=None, lib_dir=No sip_tqt_config.inform("Checking to see if the %s module should be built..." % mname) if check_class(incfile, ctor, define, include_dir, lib_dir, lib, opengl): - pyqt_modules.append(mname) + pytqt_modules.append(mname) else: if check_class("nt" + incfile, ctor, define, include_dir, lib_dir, lib, opengl): - pyqt_modules.append(mname) + pytqt_modules.append(mname) def check_class(incfile, ctor, define=None, include_dir=None, lib_dir=None, lib=None, opengl=0): @@ -641,7 +641,7 @@ int main(int argc, char **argv) f.close() - return compile_qt_program(cfgtest, define, include_dir, lib_dir, lib, opengl) + return compile_tqt_program(cfgtest, define, include_dir, lib_dir, lib, opengl) def check_plugin(cname, incfile): @@ -735,7 +735,7 @@ int main(int argc,char **argv) f.close() # Build the program. - exe = compile_qt_program("mkfeatures.cpp", include_dir=sipcfg.py_inc_dir, python=1) + exe = compile_tqt_program("mkfeatures.cpp", include_dir=sipcfg.py_inc_dir, python=1) if not exe: sip_tqt_config.error("Unable to build mkfeatures utility.") @@ -746,14 +746,14 @@ int main(int argc,char **argv) sip_tqt_config.error("There was an error creating the features file.") # Check what features have been implemented as plugins and disable them. - plugins = [("STYLE_CDE", "qcdestyle.h", "TQCDEStyle"), - ("STYLE_INTERLACE", "qinterlacestyle.h", "TQInterlaceStyle"), - ("STYLE_MOTIF", "qmotifstyle.h", "TQMotifStyle"), - ("STYLE_MOTIFPLUS", "qmotifplusstyle.h", "TQMotifPlusStyle"), - ("STYLE_PLATINUM", "qplatinumstyle.h", "TQPlatinumStyle"), - ("STYLE_SGI", "qsgistyle.h", "TQSGIStyle"), - ("STYLE_WINDOWSXP", "qwindowsxpstyle.h", "TQWindowsXPStyle"), - ("STYLE_WINDOWS", "qwindowsstyle.h", "TQWindowsStyle")] + plugins = [("STYLE_CDE", "tqcdestyle.h", "TQCDEStyle"), + ("STYLE_INTERLACE", "tqinterlacestyle.h", "TQInterlaceStyle"), + ("STYLE_MOTIF", "tqmotifstyle.h", "TQMotifStyle"), + ("STYLE_MOTIFPLUS", "tqmotifplusstyle.h", "TQMotifPlusStyle"), + ("STYLE_PLATINUM", "tqplatinumstyle.h", "TQPlatinumStyle"), + ("STYLE_SGI", "tqsgistyle.h", "TQSGIStyle"), + ("STYLE_WINDOWSXP", "tqwindowsxpstyle.h", "TQWindowsXPStyle"), + ("STYLE_WINDOWS", "tqwindowsstyle.h", "TQWindowsStyle")] f = open(name, "a") @@ -797,16 +797,16 @@ def get_feature_flags(): def set_sip_flags(): """Set the SIP-TQt platform, version and feature flags. """ - qt_sip_flags.extend(pyqt.sip_flags()) + tqt_sip_flags.extend(pytqt.sip_flags()) # If we don't check for signed interpreters, we exclude the 'VendorID' # feature if not opt_vendorcheck: - qt_sip_flags.append("-x") - qt_sip_flags.append("VendorID") + tqt_sip_flags.append("-x") + tqt_sip_flags.append("VendorID") # Handle the platform tag. - if opt_qtpetag: + if opt_tqtpetag: plattag = "WS_QWS" elif sys.platform == "win32": plattag = "WS_WIN" @@ -818,24 +818,24 @@ def set_sip_flags(): else: plattag = "WS_X11" - qt_sip_flags.append("-t") - qt_sip_flags.append(plattag) + tqt_sip_flags.append("-t") + tqt_sip_flags.append(plattag) # Handle the TQt version tag. - verstag = sip_tqt_config.version_to_sip_tag(qt_version, pyqt.qt_version_tags(), "TQt") + verstag = sip_tqt_config.version_to_sip_tag(tqt_version, pytqt.tqt_version_tags(), "TQt") if verstag: - qt_sip_flags.append("-t") - qt_sip_flags.append(verstag) + tqt_sip_flags.append("-t") + tqt_sip_flags.append(verstag) # The flags so far are common. - for f in qt_sip_flags: - qtext_sip_flags.append(f) - qtpe_sip_flags.append(f) + for f in tqt_sip_flags: + tqtext_sip_flags.append(f) + tqtpe_sip_flags.append(f) # Handle the TQScintilla version tag. - if qsci_version: - qscitags = { + if tqsci_version: + tqscitags = { 0x010100: None, 0x010200: "TQScintilla_1_1", 0x010300: "TQScintilla_1_2", @@ -846,16 +846,16 @@ def set_sip_flags(): 0x020000: "TQScintilla_1_7" } - verstag = sip_tqt_config.version_to_sip_tag(qsci_version, qscitags, "TQScintilla") + verstag = sip_tqt_config.version_to_sip_tag(tqsci_version, tqscitags, "TQScintilla") if verstag: - qtext_sip_flags.append("-t") - qtext_sip_flags.append(verstag) + tqtext_sip_flags.append("-t") + tqtext_sip_flags.append(verstag) # Handle the TQtopia tag. - if opt_qtpetag: - qtpe_sip_flags.append("-t") - qtpe_sip_flags.append(opt_qtpetag) + if opt_tqtpetag: + tqtpe_sip_flags.append("-t") + tqtpe_sip_flags.append(opt_tqtpetag) def generate_code(mname, extra_cflags=None, extra_cxxflags=None, extra_define=None, extra_include_dirs=None, extra_lflags=None, extra_lib_dir=None, extra_libs=None, opengl=0, sip_flags=None): @@ -891,7 +891,7 @@ def generate_code(mname, extra_cflags=None, extra_cxxflags=None, extra_define=No argv = ['"' + sipcfg.sip_bin + '"'] if sip_flags is None: - sip_flags = qt_sip_flags + sip_flags = tqt_sip_flags argv.extend(sip_flags) @@ -930,15 +930,15 @@ def generate_code(mname, extra_cflags=None, extra_cxxflags=None, extra_define=No for s in glob.glob("sip/" + mname + "/*.sip"): sipfiles.append(os.path.join(src_dir, "sip", mname, os.path.basename(s))) - installs.append([sipfiles, os.path.join(pyqt.sip_dir(), mname)]) + installs.append([sipfiles, os.path.join(pytqt.sip_dir(), mname)]) makefile = sip_tqt_config.SIPModuleMakefile( configuration=sipcfg, build_file=mname + ".sbf", dir=mname, - install_dir=pyqt.module_dir(), + install_dir=pytqt.module_dir(), installs=installs, - qt=1, + tqt=1, opengl=opengl, warnings=1, static=opt_static, @@ -989,20 +989,20 @@ def check_license(): lname = "GNU General Public License" lfile = None - sip_tqt_config.inform("This is the %s version of PyTQt %s (licensed under the %s) for Python %s on %s." % (ltype, pyqt_version_str, lname, sys.version[0].split(), sys.platform)) + sip_tqt_config.inform("This is the %s version of PyTQt %s (licensed under the %s) for Python %s on %s." % (ltype, pytqt_version_str, lname, sys.version[0].split(), sys.platform)) # Common checks. if ltype == "GPL" and sys.platform == "win32": error("You cannot use the GPL version of PyTQt under Windows.") try: - qted = qt_edition + tqted = tqt_edition except AttributeError: - qted = None + tqted = None - if qted and ltype != "internal": - if (qted == "free" and ltype != "GPL") or (qted != "free" and ltype == "GPL"): - sip_tqt_config.error("This version of PyTQt and the %s edition of TQt have incompatible licenses." % qted) + if tqted and ltype != "internal": + if (tqted == "free" and ltype != "GPL") or (tqted != "free" and ltype == "GPL"): + sip_tqt_config.error("This version of PyTQt and the %s edition of TQt have incompatible licenses." % tqted) # Confirm the license. sys.stdout.write(""" @@ -1050,9 +1050,9 @@ def get_build_macros(overrides): """ # Get the name of the qmake configuration file to take the macros from. if "QMAKESPEC" in list(os.environ.keys()): - fname = os.path.join(qt_dir, "mkspecs", os.environ["QMAKESPEC"], "qmake.conf") + fname = os.path.join(tqt_dir, "mkspecs", os.environ["QMAKESPEC"], "qmake.conf") else: - fname = os.path.join(qt_dir, "mkspecs", "default", "qmake.conf") + fname = os.path.join(tqt_dir, "mkspecs", "default", "qmake.conf") if not os.access(fname, os.F_OK): sip_tqt_config.error("Unable to find the default configuration file %s. You can use the QMAKESPEC environment variable to specify the correct platform instead of \"default\"." % fname) @@ -1064,18 +1064,18 @@ def get_build_macros(overrides): names.append("MOC") # Make sure $TQTDIR reflects any directory passed on the command line. - os.environ["TQTDIR"] = qt_dir + os.environ["TQTDIR"] = tqt_dir properties = { - "QT_INSTALL_BINS": os.path.join(qt_dir, "bin"), - "QT_INSTALL_HEADERS": os.path.join(qt_dir, "include"), - "QT_INSTALL_LIBS": os.path.join(qt_dir, "lib") + "TQT_INSTALL_BINS": os.path.join(tqt_dir, "bin"), + "TQT_INSTALL_HEADERS": os.path.join(tqt_dir, "include"), + "TQT_INSTALL_LIBS": os.path.join(tqt_dir, "lib") } return sip_tqt_config.parse_build_macros(fname, names, overrides, properties) -def check_qt_installation(macros): +def check_tqt_installation(macros): """Check the TQt installation and get the version number and edition. macros is the dictionary of build macros. @@ -1084,97 +1084,97 @@ def check_qt_installation(macros): generator = macros["MAKEFILE_GENERATOR"] # Set the TQt include and lib directories. - global qt_incdir, qt_libdir + global tqt_incdir, tqt_libdir - qt_incdir = macros["INCDIR_TQT"] + tqt_incdir = macros["INCDIR_TQT"] - if not qt_incdir: - qt_incdir = os.path.join(qt_dir, "include") - macros["INCDIR_TQT"] = qt_incdir + if not tqt_incdir: + tqt_incdir = os.path.join(tqt_dir, "include") + macros["INCDIR_TQT"] = tqt_incdir - qt_libdir = macros["LIBDIR_TQT"] + tqt_libdir = macros["LIBDIR_TQT"] - if not qt_libdir: - qt_libdir = os.path.join(qt_dir, "lib") - macros["LIBDIR_TQT"] = qt_libdir + if not tqt_libdir: + tqt_libdir = os.path.join(tqt_dir, "lib") + macros["LIBDIR_TQT"] = tqt_libdir # Check the TQt header files have been installed. Quietly check for TQt v4. - qt4_d = os.path.join(qt_incdir, "TQtCore") + tqt4_d = os.path.join(tqt_incdir, "TQtCore") - qglobal = os.path.join(qt4_d, "qglobal.h") + tqglobal = os.path.join(tqt4_d, "tqglobal.h") - if not os.access(qglobal, os.F_OK): - qglobal = os.path.join(qt_incdir, "qglobal.h") + if not os.access(tqglobal, os.F_OK): + tqglobal = os.path.join(tqt_incdir, "tqglobal.h") - if not os.access(qglobal, os.F_OK): - qglobal = os.path.join(qt_incdir, "ntqglobal.h") + if not os.access(tqglobal, os.F_OK): + tqglobal = os.path.join(tqt_incdir, "ntqglobal.h") - if not os.access(qglobal, os.F_OK): - sip_tqt_config.error("qglobal.h or ntqglobal.h could not be found in %s." % qt_incdir) + if not os.access(tqglobal, os.F_OK): + sip_tqt_config.error("tqglobal.h or ntqglobal.h could not be found in %s." % tqt_incdir) # Get the TQt version number. - global qt_version + global tqt_version - qt_version, ignore = sip_tqt_config.read_version(qglobal, "TQt", "TQT_VERSION") + tqt_version, ignore = sip_tqt_config.read_version(tqglobal, "TQt", "TQT_VERSION") # Early versions of TQt for the Mac didn't include everything. Rather than # maintain these in the future we just mandate a later version. - if sys.platform == "darwin" and qt_version < 0x030100: + if sys.platform == "darwin" and tqt_version < 0x030100: sip_tqt_config.error("PyTQt for MacOS/X requires TQt v3.1.0 or later.") # The way SIP-TQt v4.2 and later handle connections between signals and Python # slots only works with TQt v3 and later. Therefore TQt v2 and earlier needs # SIP-TQt v3. - if qt_version < 0x030000: + if tqt_version < 0x030000: sip_tqt_config.error("TQt v2.x and earlier require SIP-TQt v3.x.") - if qt_version >= 0x040000: - sip_tqt_config.error("TQt v4.x requires PyTQt v4.x.") + if tqt_version >= 0x040000: + sip_tqt_config.error("TQt v4.x requires PyTQt v5.x.") # Try and work out which edition it is. - global qt_edition + global tqt_edition - if qt_version >= 0x030000: - if opt_qconfigdir: - qconfigdir = opt_qconfigdir + if tqt_version >= 0x030000: + if opt_tqconfigdir: + tqconfigdir = opt_tqconfigdir else: - qconfigdir = qt_incdir + tqconfigdir = tqt_incdir - qconfig = os.path.join(qconfigdir, "qconfig.h") + tqconfig = os.path.join(tqconfigdir, "tqconfig.h") - if not os.access(qconfig,os.F_OK): - qconfig = os.path.join(qconfigdir, "ntqconfig.h") + if not os.access(tqconfig,os.F_OK): + tqconfig = os.path.join(tqconfigdir, "ntqconfig.h") - if not os.access(qconfig,os.F_OK): - sip_tqt_config.error("qconfig.h or ntqconfig.h could not be found in %s." % qconfigdir) + if not os.access(tqconfig,os.F_OK): + sip_tqt_config.error("tqconfig.h or ntqconfig.h could not be found in %s." % tqconfigdir) - f = open(qconfig) + f = open(tqconfig) l = f.readline() while l: wl = l.split() if len(wl) == 3 and wl[0] == "#define" and wl[1] == "QT_PRODUCT_LICENSE": - qt_edition = wl[2][4:-1] + tqt_edition = wl[2][4:-1] break l = f.readline() f.close() - if not qt_edition: - sip_tqt_config.error("The TQt edition could not be determined by parsing %s." % qconfig) - elif qt_version == 0x020300 and sys.platform == "win32": + if not tqt_edition: + sip_tqt_config.error("The TQt edition could not be determined by parsing %s." % tqconfig) + elif tqt_version == 0x020300 and sys.platform == "win32": # See if we have the TQt v2 non-commercial version. - if os.access(os.path.join(qt_libdir, "qt-mt230nc.lib"), os.F_OK): - qt_edition = "non-commercial" + if os.access(os.path.join(tqt_libdir, "tqt-mt230nc.lib"), os.F_OK): + tqt_edition = "non-commercial" if sys.platform == "win32": # Work out how TQt was built on Windows. - global qt_winconfig + global tqt_winconfig try: - f = open(os.path.join(qt_dir, ".qtwinconfig"), "r") + f = open(os.path.join(tqt_dir, ".tqtwinconfig"), "r") except IOError: f = None @@ -1185,37 +1185,37 @@ def check_qt_installation(macros): val = cfg.find("=") if val >= 0: - qt_winconfig = string.strip(cfg[val + 1:]) + tqt_winconfig = string.strip(cfg[val + 1:]) else: # Assume it was built as a DLL. - qt_winconfig = "shared" + tqt_winconfig = "shared" # Determine the TQt library to link against and if it has thread support. - global qt_threaded + global tqt_threaded - resolve_qt3_library(generator) + resolve_tqt3_library(generator) - if opt_tqtlib in ("qt-mt", "qt-mtedu", "qt-mteval", "qte-mt", "qtmt", "qtmtedu", "qtmteval", "tqt-mt", "tqt-mtedu", "tqt-mteval", "tqte-mt", "tqtmt", "tqtmtedu", "tqtmteval"): - qt_threaded = 1 + if opt_tqtlib in ("tqt-mt", "tqt-mtedu", "tqt-mteval", "tqte-mt", "tqtmt", "tqtmtedu", "tqtmteval", "tqt-mt", "tqt-mtedu", "tqt-mteval", "tqte-mt", "tqtmt", "tqtmtedu", "tqtmteval"): + tqt_threaded = 1 - global pyqt + global pytqt - pyqt = ConfigurePyTQt3() + pytqt = ConfigurePyTQt3() # We haven't yet factored out sip_tqt_config's knowledge of how to build TQt # binaries and it is expecting to find these in the configuration when it # generates the Makefiles. - sipcfg.qt_version = qt_version - sipcfg.qt_edition = qt_edition - sipcfg.qt_winconfig = qt_winconfig - sipcfg.qt_framework = 0 - sipcfg.qt_threaded = qt_threaded - sipcfg.qt_dir = qt_dir - sipcfg.qt_lib = opt_tqtlib - sipcfg.qt_lib_dir = qt_libdir + sipcfg.tqt_version = tqt_version + sipcfg.tqt_edition = tqt_edition + sipcfg.tqt_winconfig = tqt_winconfig + sipcfg.tqt_framework = 0 + sipcfg.tqt_threaded = tqt_threaded + sipcfg.tqt_dir = tqt_dir + sipcfg.tqt_lib = opt_tqtlib + sipcfg.tqt_lib_dir = tqt_libdir -def resolve_qt3_library(generator): +def resolve_tqt3_library(generator): """See which version of the TQt v3 library can be found. (We can't trust the configuration files.) @@ -1224,20 +1224,20 @@ def resolve_qt3_library(generator): global opt_tqtlib if opt_tqtlib: - if not is_qt_library(generator, opt_tqtlib): - sip_tqt_config.error("The %s TQt library could not be found in %s." % (opt_tqtlib, qt_libdir)) + if not is_tqt_library(generator, opt_tqtlib): + sip_tqt_config.error("The %s TQt library could not be found in %s." % (opt_tqtlib, tqt_libdir)) else: - stlib = is_qt_library(generator, "tqt") - mtlib = is_qt_library(generator, "tqt-mt") - edlib = is_qt_library(generator, "tqt-mtedu") - evlib = is_qt_library(generator, "tqt-mteval") - emlib = is_qt_library(generator, "tqte") - etlib = is_qt_library(generator, "tqte-mt") + stlib = is_tqt_library(generator, "tqt") + mtlib = is_tqt_library(generator, "tqt-mt") + edlib = is_tqt_library(generator, "tqt-mtedu") + evlib = is_tqt_library(generator, "tqt-mteval") + emlib = is_tqt_library(generator, "tqte") + etlib = is_tqt_library(generator, "tqte-mt") # Borland likes to be a little different. - bmtlib = is_qt_library(generator, "tqtmt") - bedlib = is_qt_library(generator, "tqtmtedu") - bevlib = is_qt_library(generator, "tqtmteval") + bmtlib = is_tqt_library(generator, "tqtmt") + bedlib = is_tqt_library(generator, "tqtmtedu") + bevlib = is_tqt_library(generator, "tqtmteval") names = [] @@ -1278,13 +1278,13 @@ def resolve_qt3_library(generator): names.append(opt_tqtlib) if not names: - sip_tqt_config.error("No TQt libraries could be found in %s." % qt_libdir) + sip_tqt_config.error("No TQt libraries could be found in %s." % tqt_libdir) if len(names) > 1: sip_tqt_config.error("These TQt libraries were found: %s. Use the -y argument to explicitly specify which you want to use." % ' '.join(names)) -def is_qt_library(generator, lib): +def is_tqt_library(generator, lib): """See if a particular TQt library is installed. generator is the name of the Makefile generator. @@ -1296,7 +1296,7 @@ def is_qt_library(generator, lib): lpatts = ["lib" + lib + ".*"] for lpatt in lpatts: - lmatch = glob.glob(os.path.join(qt_libdir, lpatt)) + lmatch = glob.glob(os.path.join(tqt_libdir, lpatt)) if lmatch: return lmatch @@ -1320,11 +1320,11 @@ def main(argv): except getopt.GetoptError: usage() - global qt_dir, opt_tqtlib, opt_qconfigdir - global opt_pyqtbindir, opt_pyqtmoddir, opt_pyqtsipdir - global opt_qtpetag, opt_static, opt_debug, opt_concat + global tqt_dir, opt_tqtlib, opt_tqconfigdir + global opt_pytqtbindir, opt_pytqtmoddir, opt_pytqtsipdir + global opt_tqtpetag, opt_static, opt_debug, opt_concat global opt_split, opt_tracing, opt_verbose, opt_keepfeatures - global opt_qsciincdir, opt_qscilibdir, qsci_define + global opt_tqsciincdir, opt_tqscilibdir, tqsci_define global opt_vendorcheck, opt_vendincdir, opt_vendlibdir global opt_libpython global opt_accept_license @@ -1335,19 +1335,19 @@ def main(argv): if opt == "-h": usage(0) elif opt == "-a": - opt_qtpetag = arg + opt_tqtpetag = arg elif opt == "-b": - opt_pyqtbindir = os.path.abspath(arg) + opt_pytqtbindir = os.path.abspath(arg) elif opt == "-c": opt_concat = 1 elif opt == "-d": - opt_pyqtmoddir = os.path.abspath(arg) + opt_pytqtmoddir = os.path.abspath(arg) elif opt == "-e": opt_libpython = arg elif opt == "-f": opt_keepfeatures = 1 elif opt == "-g": - opt_qconfigdir = os.path.abspath(arg) + opt_tqconfigdir = os.path.abspath(arg) elif opt == "-i": opt_vendorcheck = 1 elif opt == "-j": @@ -1362,23 +1362,23 @@ def main(argv): elif opt == "-m": opt_vendlibdir = arg elif opt == "-n": - opt_qsciincdir = arg + opt_tqsciincdir = arg elif opt == "-o": - opt_qscilibdir = arg + opt_tqscilibdir = arg elif opt == "-q": - qt_dir = os.path.abspath(arg) + tqt_dir = os.path.abspath(arg) elif opt == "-r": opt_tracing = 1 elif opt == "-s": - qsci_define = "" + tqsci_define = "" elif opt == "-u": opt_debug = 1 elif opt == "-v": - opt_pyqtsipdir = os.path.abspath(arg) + opt_pytqtsipdir = os.path.abspath(arg) elif opt == "-w": opt_verbose = 1 elif opt == "-y": - if arg in ("qt", "qt-mt", "qt-mtedu", "qt-mteval", "qte", "qte-mt", "qtmt", "qtmtedu", "tqt", "tqt-mt", "tqt-mtedu", "tqt-mteval", "tqte", "tqte-mt", "tqtmt", "tqtmtedu"): + if arg in ("tqt", "tqt-mt", "tqt-mtedu", "tqt-mteval", "tqte", "tqte-mt", "tqtmt", "tqtmtedu", "tqt", "tqt-mt", "tqt-mtedu", "tqt-mteval", "tqte", "tqte-mt", "tqtmt", "tqtmtedu"): opt_tqtlib = arg else: usage() @@ -1386,7 +1386,7 @@ def main(argv): opt_accept_license = 1 # Check that we know the name of the TQt root directory. - if not qt_dir: + if not tqt_dir: sip_tqt_config.error("A TQt installation could not be found. Use use the -q argument or the TQTDIR environment variable to explicitly specify the correct directory.") # When building static libraries, signed interpreter checking makes no @@ -1403,7 +1403,7 @@ def main(argv): sipcfg.set_build_macros(macros) # Check TQt is what we need. - check_qt_installation(macros) + check_tqt_installation(macros) # Check the licenses are compatible. if opt_accept_license == 1: @@ -1412,10 +1412,10 @@ def main(argv): check_license() # Check for TQScintilla. - check_qscintilla() + check_tqscintilla() # Check which modules to build. - qtmod_lib = pyqt.check_modules() + tqtmod_lib = pytqt.check_modules() # Check for the VendorID package. check_vendorid() @@ -1431,8 +1431,8 @@ def main(argv): extra_include_dirs = [] extra_libs = [] - if qtmod_lib: - extra_libs.append(qtmod_lib) + if tqtmod_lib: + extra_libs.append(tqtmod_lib) if opt_libpython: extra_libs.append(opt_libpython) @@ -1444,22 +1444,22 @@ def main(argv): else: extra_lib_dir = None - pyqt.code(extra_include_dirs, extra_lib_dir, extra_libs) + pytqt.code(extra_include_dirs, extra_lib_dir, extra_libs) # Create the additional Makefiles. sip_tqt_config.inform("Creating top level Makefile...") sip_tqt_config.ParentMakefile( configuration=sipcfg, - subdirs=pyqt_modules + pyqt.tools(), - installs=(pyqt.module_installs(), pyqt.module_dir()) + subdirs=pytqt_modules + pytqt.tools(), + installs=(pytqt.module_installs(), pytqt.module_dir()) ).generate() # Install module initialization script. create_config("__init__.py", os.path.join(src_dir, "module-init.py"), macros) # Install the configuration module. - create_config("pyqtconfig.py", os.path.join(src_dir, "pyqtconfig.py.in"), macros) + create_config("pytqtconfig.py", os.path.join(src_dir, "pytqtconfig.py.in"), macros) ############################################################################### diff --git a/doc/PyQt.html b/doc/PyQt.html deleted file mode 100644 index 05c0b69..0000000 --- a/doc/PyQt.html +++ /dev/null @@ -1,12845 +0,0 @@ - -Python Bindings for TQt (3.18.1)

Python Bindings for TQt (3.18.1)

Phil Thompson

This document describes a set of Python bindings for the TQt widget set. - Contact the author at <phil@riverbankcomputing.co.uk>. -


Introduction

PyTQt is a set of Python bindings for the TQt toolkit and available for all -platforms supported by TQt, including Windows, Linux, UNIX, MacOS/X and embedded -systems such as the Sharp Zaurus and the Compaq iPAQ. They have been tested -against TQt versions 1.43 to 3.3.7, TQt Non-commercial, TQtopia 1.5.0, and Python -versions 1.5 to 2.5. TQt/Embedded v3 is not supported. TQt v4 is supported -by PyTQt v4.

PyTQt is available under the GPL license for use with the GPL version of TQt, a -a commercial license for use with the commercial version of TQt, a -non-commercial license for use with the non-commercial version of TQt v2, and an -educational license for use with the educational version of TQt.

PyTQt is built using SIP (a tool for generating Python extension modules for -C++ class libraries). SIP v4.6 or later must be installed in order to build -and run this version of PyTQt.

PyTQt for MacOS/X requires TQt v3.1.0 or later and Python v2.3 or later.

The bindings are implemented as a number of Python modules

  • qt is the main module and contains the core classes and most -user interface widgets.

  • qtaxcontainer contains a sub-set of the classes implemented -in TQt's TQAxContainer module, part of TQt's ActiveTQt framework.

  • qtcanvas contains the classes implemented in TQt's Canvas -module.

  • qtgl contains the classes implemented in TQt's OpenGL module.

  • qtnetwork contains the classes implemented in TQt's Network -module.

  • qtpe contains the classes implemented in TQtopia (originally -called the TQt Palmtop Environment). It is only supported with TQt/Embedded.

  • qtsql contains the classes implemented in TQt's SQL module.

  • qttable contains the classes implemented in TQt's Table -module.

  • qtui contains the classes implemented in TQt's tqui library. -These allow GUIs to be created directly from TQt Designer's -.ui files.

  • qtxml contains the classes implemented in TQt's XML module.

  • qtext contains useful third-party classes that are not part -of TQt. At the moment it contains bindings for TQScintilla, the port to TQt of -the Scintilla programmer's editor class.

PyTQt also includes the pyuic and -pylupdate utilities which correspond to the TQt -uic and lupdate utilities. -pyuic converts the GUI designs created with TQt Designer to -executable Python code. pylupdate scans Python code, -extracts all strings that are candidates for internationalisation, and creates -an XML file for use by TQt Linguist.

-
-

Other PyTQt Goodies

Using TQt Designer

TQt Designer is a GPL'ed GUI design editor provided by Trolltech as part of TQt. -It generates an XML description of a GUI design. TQt includes -uic which generates C++ code from that XML.

PyTQt includes pyuic which generates Python code from the -same XML. The Python code is self contained and can be executed immediately.

It is sometimes useful to be able to include some specific Python code in the -output generated by pyuic. For example, if you are using -custom widgets, pyuic has no way of knowing the name of the -Python module containing the widget and so cannot generate the required -import statement. To help get around this, -pyuic will extract any lines entered in the -Comment field of TQt Designer's -Form Settings dialog that begin with -Python: and copies them to the generated output.

Here's a simple example showing the contents of the Comment -field.

This comment will be ignored by pyuic.
-Python:
-Python:# Import our custom widget.
-Python:from foo import bar

Here's the corresponding output from pyuic.

from PyTQt.qt import *
-
-# Import our custom widget.
-from foo import bar

Thanks to Christian Bird, pyuic will extract Python code -entered using TQt Designer to implement slots. In TQt Designer, when you need to -edit a slot and the source editor appears, enter Python code between the curly -braces. Don't worry about the correct starting indent level, each line is -prepended with a correct indentation.

Make sure that the ui.h file is in the same directory as the -.ui file when using pyuic. The -.ui file implies the name of the .ui.h -file so there is no need to specify it on the command line.

Here's an example of a simple slot.

void DebMainWindowFrm::browsePushButtonClicked()
-{
-if self.debugging:
-    TQMessageBox.critical(self, "Event", "browse pushbutton was clicked!")
-}

Here is the resulting code when pyuic is run.

class DebMainWindowFrm(TQMainWindow):
-    ...stuff...
-    def browsePushButtonClicked(self):
-        if self.debugging:
-            TQMessageBox.critical(self, "Event", "browse pushbutton was clicked!")

Note that indenting is as normal and that self and all other -parameters passed to the slot are available.

If you use this, you will need to turn off all of the fancy options for the C++ -editor in Designer as it tries to force C++ syntax and that's naturally -annoying when trying to code in Python.


Using TQt Linguist

TQt includes the lupdate program which parses C++ source -files converting calls to the QT_TR_NOOP() and -QT_TRANSLATE_NOOP() macros to .ts -language source files. The lrelease program is then used to -generate .qm binary language files that are distributed with -your application.

Thanks to Detlev Offenbach, PyTQt includes the pylupdate -program. This generates the same .ts language source files -from your PyTQt source files.


Deploying Commercial PyTQt Applications

When deploying commercial PyTQt applications it is necessary to discourage users -from accessing the underlying PyTQt modules for themselves. A user that used -the modules shipped with your application to develop new applications would -themselves be considered a developer and would need their own commercial TQt and -PyTQt licenses.

One solution to this problem is the -VendorID -package. This allows you to build Python extension modules that can only be -imported by a digitally signed custom interpreter. The package enables you to -create such an interpreter with your application embedded within it. The -result is an interpreter that can only run your application, and PyTQt modules -that can only be imported by that interpreter. You can use the package to -similarly restrict access to any extension module.

In order to build PyTQt with support for the VendorID package, pass the --i command line flag to configure.py.


pyqtconfig and Build System Support

The SIP build system (ie. the sipconfig module) is described -in the SIP documentation. PyTQt includes the pyqtconfig -module that can be used by configuration scripts of other bindings that are -built on top of PyTQt.

The pyqtconfig module contains the following classes:

Configuration(sipconfig.Configuration)

This class encapsulates additional configuration values, specific to PyTQt, that -can be accessed as instance variables.

The following configuration values are provided (in addition to those provided -by the sipconfig.Configuration class):

pyqt_bin_dir

The name of the directory containing the pyuic and -pylupdate executables.

pyqt_mod_dir

The name of the directory containing the PyTQt modules.

pyqt_modules

A string containing the names of the PyTQt modules that were installed.

pyqt_qt_sip_flags

A string of the SIP flags used to generate the code for the -qt module and which should be added to those needed by any -module that imports the qt module.

pyqt_qtaxcontainer_sip_flags

A string of the SIP flags used to generate the code for the -qtaxcontainer module and which should be added to those -needed by any module that imports the qtaxcontainer module.

pyqt_qtcanvas_sip_flags

A string of the SIP flags used to generate the code for the -qtcanvas module and which should be added to those needed by -any module that imports the qtcanvas module.

pyqt_qtext_sip_flags

A string of the SIP flags used to generate the code for the -qtext module and which should be added to those needed by -any module that imports the qtext module.

pyqt_qtgl_sip_flags

A string of the SIP flags used to generate the code for the -qtgl module and which should be added to those needed by any -module that imports the qtgl module.

pyqt_qtnetwork_sip_flags

A string of the SIP flags used to generate the code for the -qtnetwork module and which should be added to those needed -by any module that imports the qtnetwork module.

pyqt_qtsql_sip_flags

A string of the SIP flags used to generate the code for the -qtsql module and which should be added to those needed by -any module that imports the qtsql module.

pyqt_qttable_sip_flags

A string of the SIP flags used to generate the code for the -qttable module and which should be added to those needed by -any module that imports the qttable module.

pyqt_qtui_sip_flags

A string of the SIP flags used to generate the code for the -qtui module and which should be added to those needed by any -module that imports the qtui module.

pyqt_qtxml_sip_flags

A string of the SIP flags used to generate the code for the -qtxml module and which should be added to those needed by -any module that imports the qtxml module.

pyqt_sip_dir

The name of the base directory where the .sip files for each -of the PyTQt modules is installed. A sub-directory exists with the same name as -the module.

pyqt_version

The PyTQt version as a 3 part hexadecimal number (eg. v3.10 is represented as -0x030a00).

pyqt_version_str

The PyTQt version as a string. For development snapshots it will start with -snapshot-.

TQtModuleMakefile(sipconfig.SIPModuleMakefile)

The Makefile class for modules that import the qt module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().

TQtAxContainerModuleMakefile(TQtModuleMakefile)

The Makefile class for modules that import the qtaxcontainer -module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().

TQtCanvasModuleMakefile(TQtModuleMakefile)

The Makefile class for modules that import the qtcanvas -module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().

TQtExtModuleMakefile(TQtModuleMakefile)

The Makefile class for modules that import the qtext module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().

TQtGLModuleMakefile(TQtModuleMakefile)

The Makefile class for modules that import the qtgl module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().

TQtNetworkModuleMakefile(TQtModuleMakefile)

The Makefile class for modules that import the qtnetwork -module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().

TQtTableModuleMakefile(TQtModuleMakefile)

The Makefile class for modules that import the qttable -module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().

TQtSQLModuleMakefile(TQtTableModuleMakefile)

The Makefile class for modules that import the qtsql module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().

TQtUIModuleMakefile(TQtModuleMakefile)

The Makefile class for modules that import the qtui module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().

TQtXMLModuleMakefile(TQtModuleMakefile)

The Makefile class for modules that import the qtxml module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().


Things to be Aware Of

super and Wrapped Classes

Internally PyTQt implements a lazy technique for attribute lookup where -attributes are only placed in type and instance dictionaries when they are -first referenced. This technique is needed to reduce the time taken to import -large modules such as PyTQt.

In most circumstances this technique is transparent to an application. The -exception is when super is used with a PyTQt class. The way -that super is currently implemented means that the lazy -lookup is bypassed resulting in AttributeError exceptions -unless the attribute has been previously referenced.

Note that this restriction applies to any class wrapped by SIP and not just -PyTQt.


Python Strings, TQt Strings and Unicode

Unicode support was added to TQt in v2.0 and to Python in v1.6. In TQt, Unicode -support is implemented using the TQString class. It is -important to understand that TQStrings, Python string objects -and Python Unicode objects are all different but conversions between them are -automatic in many cases and easy to achieve manually when needed.

Whenever PyTQt expects a TQString as a function argument, a -Python string object or a Python Unicode object can be provided instead, and -PyTQt will do the necessary conversion automatically.

You may also manually convert Python string and Unicode objects to -TQStrings by using the TQString constructor -as demonstrated in the following code fragment.

qs1 = TQString('Converted Python string object')
-qs2 = TQString(u'Converted Python Unicode object')

In order to convert a TQString to a Python string object use -the Python str() function. Applying -str() to a null TQString and an empty -TQString both result in an empty Python string object.

In order to convert a TQString to a Python Unicode object use -the Python unicode() function. Applying -unicode() to a null TQString and an empty -TQString both result in an empty Python Unicode object.


Access to Protected Member Functions

When an instance of a C++ class is not created from Python it is not possible -to access the protected member functions, or emit the signals, of that -instance. Attempts to do so will raise a Python exception. Also, any Python -methods corresponding to the instance's virtual member functions will never be -called.


None and NULL

Throughout the bindings, the None value can be specified -wherever NULL is acceptable to the underlying C++ code.

Equally, NULL is converted to None -whenever it is returned by the underlying C++ code.


Support for C++ void * Data Types

PyTQt represents void * values as objects of type -sip.voidptr. Such values are often used to pass the -addresses of external objects between different Python modules. To make this -easier, a Python integer (or anything that Python can convert to an integer) -can be used whenever a sip.voidptr is expected.

A sip.voidptr may be converted to a Python integer by using -the int() builtin function.

A sip.voidptr may be converted to a Python string by using -its asstring() method. The asstring() -method takes an integer argument which is the length of the data in bytes.


Support for Threads

PyTQt implements the full set of TQt's thread classes. Python, of course, also -has its own thread extension modules. If you are using SIP v4 (or later) and -Python v2.3.5 (or later) then PyTQt does not impose any additional restrictions. -(Read the relevant part of the TQt documentation to understand the restrictions -imposed by the TQt API.)

If you are using earlier versions of either SIP or Python then it is possible -to use either of the APIs so long as you follow some simple rules.

  • If you use the TQt API then the very first import of one of -the PyTQt modules must be done from the main thread.

  • If you use the Python API then all calls to PyTQt (including any -imports) must be done from one thread only. Therefore, if -you want to make calls to PyTQt from several threads then you must use the TQt -API.

  • If you want to use both APIs in the same application then all calls to PyTQt -must be done from threads created using the TQt API.

The above comments actually apply to any SIP generated module, not just PyTQt.


Garbage Collection

C++ does not garbage collect unreferenced class instances, whereas Python does. -In the following C++ fragment both colours exist even though the first can no -longer be referenced from within the program:

c = new TQColor();
-c = new TQColor();

In the corresponding Python fragment, the first colour is destroyed when -the second is assigned to c:

c = TQColor()
-c = TQColor()

In Python, each colour must be assigned to different names. Typically this -is done within class definitions, so the code fragment would be something like:

self.c1 = TQColor()
-self.c2 = TQColor()

Sometimes a TQt class instance will maintain a pointer to another instance and -will eventually call the destructor of that second instance. The most common -example is that a TQObject (and any of its sub-classes) keeps -pointers to its children and will automatically call their destructors. In -these cases, the corresponding Python object will also keep a reference to the -corresponding child objects.

So, in the following Python fragment, the first TQLabel is -not destroyed when the second is assigned to l because the -parent TQWidget still has a reference to it.

p = TQWidget()
-l = TQLabel('First label',p)
-l = TQLabel('Second label',p)

C++ Variables

Access to C++ variables is supported. They are accessed as Python instance -variables. For example:

tab = TQTab()
-tab.label = "First Tab"
-tab.r = TQRect(10,10,75,30)

Global variables and static class variables are effectively read-only. They -can be assigned to, but the underlying C++ variable will not be changed. This -may change in the future.

Access to protected C++ class variables is not supported. This may change in -the future.


Multiple Inheritance

It is not possible to define a new Python class that sub-classes from more than -one TQt class.


i18n Support

TQt implements i18n support through the TQt Linguist application, the -TQTranslator class, and the -TQApplication::translate(), TQObject::tr() -and TQObject::trUtf8() methods. Usually the -tr() method is used to obtain the correct translation of a -message. The translation process uses a message context to allow the same -message to be translated differently. tr() is actually -generated by moc and uses the hardcoded class name as the -context. On the other hand, TQApplication::translate() -allows to context to be explicitly stated.

Unfortunately, because of the way TQt implents tr() (and -trUtf8()) it is not possible for PyTQt to exactly reproduce -its behavour. The PyTQt implementation of tr() (and -trUtf8()) uses the class name of the instance as the -context. The key difference, and the source of potential problems, is that the -context is determined dynamically in PyTQt, but is hardcoded in TQt. In other -words, the context of a translation may change depending on an instance's class -hierarchy.

class A(TQObject):
-    def __init__(self):
-        TQObject.__init__(self)
-
-    def hello(self):
-        return self.tr("Hello")
-
-class B(A):
-    def __init__(self):
-        A.__init__(self)
-
-a = A()
-a.hello()
-
-b = B()
-b.hello()

In the above the message is translated by a.hello() using a -context of A, and by b.hello() using a -context of B. In the equivalent C++ version the context -would be A in both cases.

The PyTQt behaviour is unsatisfactory and may be changed in the future. It is -recommended that TQApplication.translate() be used in -preference to tr() (and trUtf8()). This -is guaranteed to work with current and future versions of PyTQt and makes it -much easier to share message files between Python and C++ code. Below is the -alternative implementation of A that uses -TQApplication.translate().

class A(TQObject):
-    def __init__(self):
-        TQObject.__init__(self)
-
-    def hello(self):
-        return tqApp.translate("A","Hello")

Note that the code generated by pyuic uses -TQApplication.translate().


Signal and Slot Support

A signal may be either a TQt signal (specified using -SIGNAL()) or a Python signal (specified using -PYSIGNAL()).

A slot can be either a Python callable object, a TQt signal (specified using -SIGNAL()), a Python signal (specified using -PYSIGNAL()), or a TQt slot (specified using -SLOT()).

You connect signals to slots (and other signals) as you would from C++. For -example:

TQObject.connect(a,SIGNAL("TQtSig()"),pyFunction)
-TQObject.connect(a,SIGNAL("TQtSig()"),pyClass.pyMethod)
-TQObject.connect(a,SIGNAL("TQtSig()"),PYSIGNAL("PySig"))
-TQObject.connect(a,SIGNAL("TQtSig()"),SLOT("TQtSlot()"))
-TQObject.connect(a,PYSIGNAL("PySig"),pyFunction)
-TQObject.connect(a,PYSIGNAL("PySig"),pyClass.pyMethod)
-TQObject.connect(a,PYSIGNAL("PySig"),SIGNAL("TQtSig()"))
-TQObject.connect(a,PYSIGNAL("PySig"),SLOT("TQtSlot()"))

When a slot is a Python method that corresponds to a TQt slot then a signal can -be connected to either the Python method or the TQt slot. The following -connections achieve the same effect.

sbar = TQScrollBar()
-lcd = TQLCDNumber()
-
-TQObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd.display)
-TQObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd,SLOT("display(int)"))

The difference is that the second connection is made at the C++ level and is -more efficient.

Disconnecting signals works in exactly the same way.

Any instance of a class that is derived from the TQObject -class can emit a signal using the emit method. This takes -two arguments. The first is the Python or TQt signal, the second is a Python -tuple which are the arguments to the signal. For example:

a.emit(SIGNAL("clicked()"),())
-a.emit(PYSIGNAL("pySig"),("Hello","World"))

Note that when a slot is a Python callable object its reference count is not -increased. This means that a class instance can be deleted without having to -explicitly disconnect any signals connected to its methods. However, it also -means that using lambda expressions as slots will not work unless you keep a -separate reference to the expression to prevent it from being immediately -garbage collected.

TQt allows a signal to be connected to a slot that requires fewer arguments than -the signal passes. The extra arguments are quietly discarded. Python slots -can be used in the same way.


Static Member Functions

Static member functions are implemented as Python class functions. -For example the C++ static member function -TQObject::connect() is called from Python as -TQObject.connect() or self.connect() if -called from a sub-class of TQObject.


Enumerated Types

Enumerated types are implemented as a set of simple variables corresponding to -the separate enumerated values.

When using an enumerated value the name of the class (or a sub-class) in which -the enumerated type was defined in must be included. For example:

TQt.SolidPattern
-TQWidget.TabFocus
-TQFrame.TabFocus

Module Reference Documentation

The following sections should be used in conjunction with the normal class -documentation - only the differences specific to the Python bindings are -documented here.

In these sections, Not yet implemented -implies that the feature can be easily implemented if needed. Not -implemented implies that the feature will not be implemented, either -because it cannot be or because it is not appropriate.

If a class is described as being fully implemented then -all non-private member functions and all public class variables have been -implemented.

If an operator has been implemented then it is stated explicitly.

Classes that are not mentioned have not yet been implemented.


qt Module Reference

TQt Constants

All constant values defined by TQt have equivalent constants defined to Python.


TQt (TQt v2+)

TQt is fully implemented.


TQAccel

TQAccel is fully implemented.


TQAction (TQt v2.2+)

TQAction is fully implemented.


TQActionGroup (TQt v2.2+)

TQActionGroup is fully implemented.


TQApplication

TQApplication(int &argc, char **argv);

This takes one parameter which is a list of argument strings. Arguments -used by TQt are removed from the list.

TQApplication(int &argc, char **argv, bool GUIenabled);

This takes two parameters, the first of which is a list of argument strings. -Arguments used by TQt are removed from the list.

TQApplication(int &argc, char **argv, Type type);

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+)

int exec();

This has been renamed to exec_loop in Python.


TQAssistantClient (TQt v3.1+)

TQAssistantClient is fully implemented.


TQBitmap

TQBitmap is fully implemented.


TQBrush

TQBrush is fully implemented, including the Python -== and != operators.


TQButton

TQButton is fully implemented.


TQButtonGroup

TQButtonGroup is fully implemented.


TQByteArray

A Python string can be used whenever a TQByteArray can be -used. A TQByteArray can be converted to a Python string -using the Python str() function.

TQByteArray &assign(const char *data, uint size);

Not implemented.

char &at(uint i);

Not yet implemented.

int contains(const char &d);

Not yet implemented.

bool fill(const char &d, int size = -1);

Not yet implemented.

int find(const char &d, uint i = 0);

Not yet implemented.

void resetRawData(const char *data, uintsize);

Not implemented.

TQByteArray &setRawData(const char *data, uintsize);

Not implemented.


TQCDEStyle (TQt v2+)

TQCDEStyle is fully implemented.


TQCheckBox

TQCheckBox is fully implemented.


TQClipboard

void *data const(const char *format);

Not yet implemented (TQt v1.x).

void setData(const char *format, void *);

Not yet implemented (TQt v1.x).


TQColor

The Python == and != operators are -supported.

void getHsv(int *h, int *s, int *v);

This takes no parameters and returns the h, -s and v values as a tuple.

void getRgb(int *r, int *g, int *b);

This takes no parameters and returns the r, -g and b values as a tuple.

void hsv(int *h, int *s, int *v);

This takes no parameters and returns the h, -s and v values as a tuple.

void rgb(int *r, int *g, int *b);

This takes no parameters and returns the r, -g and b values as a tuple.


TQColorDialog (TQt v2+)

static TQRgb getRgba(TQRgb initial, bool *ok, TQWidget *parent = 0, const char *name = 0);

This takes the initial, parent and -name parameters and returns a tuple containing the -TQRgb result and the ok value.


TQColorGroup

TQColorGroup is fully implemented.


TQComboBox

TQComboBox is fully implemented.


TQCommonStyle (TQt v2+)

virtual void getButtonShift(int &x, int &y);

This takes no parameters and returns a tuple of the x and -y values. (TQt v2)

virtual void tabbarMetrics(const TQTabBar *t, int &hframe, int &vframe, int &overlap);

This takes only the t parameter and returns a tuple of the -hframe, vframe and -overlap values. (TQt v2)


TQCString (TQt v2+)

A Python string can be used whenever a TQCString can be used. -A TQCString can be converted to a Python string using the -Python str() function.

TQCString &sprintf(const char *format, ...);

Not implemented.

short toShort(bool *ok = 0);

This returns a tuple of the short result and the -ok value.

ushort toUShort(bool *ok = 0);

This returns a tuple of the ushort result and the -ok value.

int toInt(bool *ok = 0);

This returns a tuple of the int result and the -ok value.

uint toUInt(bool *ok = 0);

This returns a tuple of the uint result and the -ok value.

long toLong(bool *ok = 0);

This returns a tuple of the long result and the -ok value.

ulong toULong(bool *ok = 0);

This returns a tuple of the ulong result and the -ok value.

float toFloat(bool *ok = 0);

This returns a tuple of the float result and the -ok value.

double toDouble(bool *ok = 0);

This returns a tuple of the double result and the -ok value.


TQCursor

TQCursor is fully implemented.


TQDataStream

TQDataStream &readBytes(const char *&s, uint &l);

This takes no parameters. The TQDataStream result and the -data read are returned as a tuple.

TQDataStream &readRawBytes(const char *s, uint l);

This takes only the l parameter. The -TQDataStream result and the data read are returned as a -tuple.

TQDataStream &writeBytes(const char *s, uint len);

len is derived from s and not passed as a -parameter.

TQDataStream &writeRawBytes(const char *s, uint len);

len is derived from s and not passed as a -parameter.


TQDate

The Python -==, !=, -<, <=, ->, >= -and __nonzero__ -operators are supported.

int weekNumber(int *yearNum = 0);

This takes no parameters and returns the week number and the year number as a -tuple. (TQt v3.1+)


TQDateTime

TQDateTime is fully implemented, including the Python -==, !=, -<, <=, ->, >= -and __nonzero__ -operators.


TQTime

TQTime is fully implemented, including the Python -==, !=, -<, <=, ->, >= -and __nonzero__ -operators.


TQDateEdit (TQt v3+)

TQDateEdit is fully implemented.


TQTimeEdit (TQt v3+)

TQTimeEdit is fully implemented.


TQDateTimeEdit (TQt v3+)

TQDateTimeEdit is fully implemented.


TQDesktopWidget (TQt v3+)

TQDesktopWidget is fully implemented.


TQDial (TQt v2.2+)

TQDial is fully implemented.


TQDialog

int exec();

This has been renamed to exec_loop in Python.

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 TQObject.deleteLater() or other techniques.


TQDir

TQDir is fully implemented, including the Python -len, [] (for reading slices and -individual elements), ==, != and -in operators


TQFileInfoList

This class isn't implemented. Whenever a TQFileInfoList is -the return type of a function or the type of an argument, a Python list of -TQFileInfo instances is used instead.


TQDockArea (TQt v3+)

bool hasDockWindow const(TQDockWindow *w, int *index = 0);

This takes the w parameter and returns the index of the -TQDockWIndow or -1 if the TQDockArea does not contain the TQDockWindow.


TQDockWindow (TQt v3+)

TQDockWindow is fully implemented.


TQColorDrag (TQt v2.1+)

TQColorDrag is fully implemented.


TQDragObject

TQDragObject is fully implemented.


TQImageDrag

TQImageDrag is fully implemented.


TQStoredDrag

TQStoredDrag is fully implemented.


TQTextDrag

TQTextDrag is fully implemented.


TQUriDrag (TQt v2+)

TQUriDrag is fully implemented.


TQUrlDrag (TQt v1.x)

TQUrlDrag is fully implemented.


TQDropSite

TQDropSite is fully implemented.


TQErrorMessage (TQt v3+)

TQErrorMessage is fully implemented.


TQEvent

TQEvent is fully implemented.

Instances of TQEvents are automatically converted to the -correct sub-class.


TQChildEvent

TQChildEvent is fully implemented.


TQCloseEvent

TQCloseEvent is fully implemented.


TQIconDragEvent (TQt v3.3+)

TQIconDragEvent is fully implemented.


TQContextMenuEvent (TQt v3+)

TQContextMenuEvent is fully implemented.


TQCustomEvent

TQCustomEvent is fully implemented. Any Python object can be -passed as the event data and its reference count is increased.


TQDragEnterEvent

TQDragEnterEvent is fully implemented.


TQDragLeaveEvent

TQDragLeaveEvent is fully implemented.


TQDragMoveEvent

TQDragMoveEvent is fully implemented.


TQDropEvent

TQDropEvent is fully implemented.


TQFocusEvent

TQFocusEvent is fully implemented.


TQHideEvent

TQHideEvent is fully implemented.


TQIMComposeEvent (TQt v3.1+)

TQIMComposeEvent is fully implemented.


TQIMEvent (TQt v3+)

TQIMEvent is fully implemented.


TQKeyEvent

TQKeyEvent is fully implemented.


TQMouseEvent

TQMouseEvent is fully implemented.


TQMoveEvent

TQMoveEvent is fully implemented.


TQPaintEvent

TQPaintEvent is fully implemented.


TQResizeEvent

TQResizeEvent is fully implemented.


TQShowEvent

TQShowEvent is fully implemented.


TQTabletEvent (TQt v3+)

TQTabletEvent is fully implemented.


TQTimerEvent

TQTimerEvent is fully implemented.


TQWheelEvent (TQt v2+)

TQWheelEvent is fully implemented.


TQEventLoop (TQt v3.1+)

virtual int exec();

This has been renamed to exec_loop in Python.


TQFile

bool open(int m, FILE *f);

Not implemented.

TQ_LONG readBlock(char *data, TQ_ULONG len);

This takes a single len parameter. The -data is returned if there was no error, otherwise -None is returned.

TQ_LONG readLine(char *data, TQ_ULONG maxlen);

This takes a single maxlen parameter. The -data is returned if there was no error, otherwise -None is returned.

static void setDecodingFunction(EncoderFn f);

Not yet implemented. (TQt v2+)

static void setEncodingFunction(EncoderFn f);

Not yet implemented. (TQt v2+)

TQ_LONG writeBlock(const char *data, TQ_ULONG len);

len is derived from data and not passed -as a parameter.


TQFileDialog

TQFileDialog is fully implemented.


TQFileIconProvider

TQFileIconProvider is fully implemented.


TQFilePreview

TQFilePreview 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.

class FilePreview(TQFilePreview):
-    pass
-
-class Preview(TQLabel):
-    def __init__(self, parent=None):
-        TQLabel.__init__(self, parent)
-        self.preview = FilePreview()
-        self.preview.previewUrl = self.previewUrl

Note that TQFilePreview cannot be instantiated directly because it is abstract. -Thanks to Hans-Peter Jansen for this trick.


TQFileInfo

TQFileInfo is fully implemented.


TQFont

TQFont is fully implemented, including the Python -== and != operators.


TQFontDatabase (TQt v2.1+)

TQFontDatabase is fully implemented.


TQFontDialog (TQt v2+)

static TQFont getFont(bool *ok, const TQFont &def, TQWidget *parent = 0, const char *name = 0);

This takes the def, parent and -name parameters and returns a tuple containing the -TQFont result and the ok value.

static TQFont getFont(bool *ok, TQWidget *parent = 0, const char *name = 0);

This takes the parent and name parameters -and returns a tuple containing the TQFont result and the -ok value.


TQFontInfo

TQFontInfo is fully implemented.


TQFontMetrics

TQRect boundingRect(int x, int y, int w, int h, int flags, const TQString &str, int len = -1, int tabstops = 0, int *tabarray = 0);

The tabarray parameter is a Python list of integers.

TQSize size(int flags, const TQString &str, int len = -1, int tabstops = 0, int *tabarray = 0);

The tabarray parameter is a Python list of integers.


TQFrame

TQFrame is fully implemented.


TQGManager (TQt v1.x)

TQGManager is fully implemented.


TQChain (TQt v1.x)

TQChain is implemented as an opaque class.


TQGrid (TQt v2+)

TQGrid is fully implemented.


TQGridView (TQt v3+)

TQGridView is fully implemented.


TQGroupBox

TQGroupBox is fully implemented.


TQHBox (TQt v2+)

TQHBox is fully implemented.


TQHButtonGroup (TQt v2+)

TQHButtonGroup is fully implemented.


TQHeader

TQHeader is fully implemented.


TQHGroupBox (TQt v2+)

TQHGroupBox is fully implemented.


TQIconSet

TQIconSet is fully implemented.


TQIconFactory (TQt v3.1+)

TQIconFactory is fully implemented.


TQIconView (TQt v2.1+)

TQIconViewItem *makeRowLayout(TQIconViewItem *begin, int &y);

Not yet implemented.


TQIconViewItem (TQt v2.1+)

TQIconViewItem is fully implemented.


TQIconDrag (TQt v2.1+)

TQIconDrag is fully implemented.


TQIconDragItem (TQt v2.1+)

TQIconDragItem is fully implemented.


TQImage

The Python == and != operators are -supported.

TQImage(const char *xpm[]);

This takes a list of strings as its parameter.

TQImage(uchar *data, int w, int h, int depth, TQRgb *colorTable, int numColors, Endian bitOrder);

The colorTable parameter is a list of TQRgb instances or -None. (TQt v2.1+)

uchar *bits();

The return value is a sip.voidptr object which is only -useful if passed to another Python module.

TQRgb *colorTable();

The return value is a sip.voidptr object which is only -useful if passed to another Python module.

TQImage convertDepthWithPalette(int, TQRgb *p, int pc, int cf = 0);

Not implemented.

uchar **jumpTable();

The return value is a sip.voidptr object which is only -useful if passed to another Python module.

bool loadFromData(const uchar *buf, uint len, const char *format = 0, ColorMode mode = Auto);

len is derived from buf and not passed as -a parameter.

uchar *scanLine(int i);

The return value is a sip.voidptr object which is only -useful if passed to another Python module.


TQImageIO

static void defineIOHandler(const char *format, const char *header, const char *flags, image_io_handler read_image, image_io_handler write_image);

Not implemented.


TQImageTextKeyLang

TQImageTextKeyLang is fully implemented.


TQInputDialog (TQt v2.1+)

static TQString getText(const TQString &caption, const TQString &label, const TQString &text = TQString::null, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);

The ok is not passed and the returned value is a tuple of -the TQString result and the ok flag. -(TQt v2.1 - v2.3.1)

static TQString getText(const TQString &caption, const TQString &label, TQLineEdit::EchoModeecho, const TQString &text = TQString::null, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);

The ok is not passed and the returned value is a tuple of -the TQString result and the ok flag. -(TQt v2.2 - v2.3.1)

static TQString getText(const TQString &caption, const TQString &label, TQLineEdit::EchoModeecho = TQLineEdit::Normal, const TQString &text = TQString::null, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);

The ok is not passed and the returned value is a tuple of -the TQString result and the ok flag. -(TQt v3+)

static int getInteger(const TQString &caption, const TQString &label, int num = 0, int from = -2147483647, int to = 2147483647, int step = 1, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);

The ok is not passed and the returned value is a tuple of -the int result and the ok flag.

static double getDouble(const TQString &caption, const TQString &label, double num = 0, double from = -2147483647, double to = 2147483647, int step = 1, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);

The ok is not passed and the returned value is a tuple of -the double result and the ok flag.

static TQString getItem(const TQString &caption, const TQString &label, const TQStringList &list, int current = 0, bool editable = TRUE, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);

The ok is not passed and the returned value is a tuple of -the TQString result and the ok flag.


TQInterlaceStyle (TQt v2.3.1+)

void scrollBarMetrics(const TQTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

This takes only the sb parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values.


TQIODevice

TQIODevice is fully implemented.


TQKeySequence (TQt v3+)

TQKeySequence is fully implemented including the operators -==, !=, TQString() and -int(). A TQString instance or a Python -integer may be used whenever a TQKeySequence can be used.


TQLabel

TQLabel is fully implemented.


TQLayout

TQLayout is fully implemented.


TQBoxLayout

TQBoxLayout is fully implemented.


TQGLayoutIterator (TQt v2+)

TQGLayoutIterator is fully implemented.


TQGridLayout

bool findWidget(TQWidget *w, int *row, int *col);

This takes the w parameter and returns a tuple containing -the bool result, row and -col. (TQt v2+)


TQHBoxLayout

TQHBoxLayout is fully implemented.


TQLayoutItem (TQt v2+)

TQLayoutItem is fully implemented.


TQLayoutIterator (TQt v2+)

TQLayoutItem *next();

This is a wrapper around the TQLayoutIterator -++ operator.


TQSpacerItem (TQt v2+)

TQSpacerItem is fully implemented.


TQVBoxLayout

TQVBoxLayout is fully implemented.


TQWidgetItem (TQt v2+)

TQWidgetItem is fully implemented.


TQLCDNumber

TQLCDNumber is fully implemented.


TQLibrary (TQt v3+)

TQLibrary is fully implemented.


TQLineEdit

int characterAt(int xpos, TQChar *chr);

This takes only the xpos parameter and returns the int -result and the chr value as a tuple. (TQt v3+)

void del();

This has been renamed delChar in Python. (TQt v2+)

bool getSelection(int *start, int *end);

This takes no parameters and returns the bool result and the -start and end values as a tuple. -(TQt v3+)


TQPtrList<type> (TQt v2)

Types based on the TQPtrList template are automatically -converted to and from Python lists of the type.


TQListBox

bool itemYPos(int index, int *yPos);

This takes the index parameter and returns a tuple -containing the bool result and yPos. -(TQt v1.x)


TQListBoxItem

TQListBoxItem is fully implemented.


TQListBoxPixmap

TQListBoxPixmap is fully implemented.


TQListBoxText

TQListBoxText is fully implemented.


TQListView

TQListView is fully implemented.

Note that to remove a child TQListViewItem you must first -call takeItem() and then del().


TQListViewItem

TQListViewItem is fully implemented.

Note that to remove a child TQListViewItem you must first -call takeItem() and then del().


TQCheckListItem

TQCheckListItem is fully implemented.


TQListViewItemIterator (TQt v2+)

TQListViewItemIterator is fully implemented.


TQLocale (TQt v3.3+)

short toShort(bool *ok = 0);

This returns a tuple of the short result and the -ok value.

ushort toUShort(bool *ok = 0);

This returns a tuple of the ushort result and the -ok value.

int toInt(bool *ok = 0);

This returns a tuple of the int result and the -ok value.

uint toUInt(bool *ok = 0);

This returns a tuple of the uint result and the -ok value.

TQ_LONG toLong(bool *ok = 0);

This returns a tuple of the long result and the -ok value.

TQ_ULONG toULong(bool *ok = 0);

This returns a tuple of the ulong result and the -ok value.

float toFloat(bool *ok = 0);

This returns a tuple of the float result and the -ok value.

double toDouble(bool *ok = 0);

This returns a tuple of the double result and the -ok value.


TQMainWindow

TQTextStream &operator<<(TQTextStream &, const TQMainWindow &);

This operator is fully implemented. (TQt v3+)

TQTextStream &operator>>(TQTextStream &, TQMainWindow &);

This operator is fully implemented. (TQt v3+)

bool getLocation(TQToolBar *tb, ToolBarDock &dock, int &index, bool &nl, int &extraOffset);

This takes only the tb parameter and returns a tuple of the -result, dock, index, -nl and extraOffset values. (TQt v2.1.0+)

TQPtrList<TQToolBar> toolBars(ToolBarDock dock);

This returns a list of TQToolBar instances. (TQt v2.1.0+)


TQMemArray<type> (TQt v3+)

Types based on the TQMemArray template are automatically -converted to and from Python lists of the type.


TQMenuBar

TQMenuBar is fully implemented.


TQMenuData

TQMenuItem *findItem(int id, TQMenuData **parent);

Not implemented.


TQCustomMenuItem (TQt v2.1+)

TQCustomMenuItem is fully implemented.


TQMenuItem

TQMenuItem is an internal TQt class.


TQMessageBox

TQMessageBox is fully implemented.


TQMetaObject

int numClassInfo const(bool super = FALSE);

Not implemented.

const TQClassInfo *classInfo const(bool super = FALSE);

Not implemented.


TQMetaProperty

TQMetaProperty is fully implemented.


TQMimeSource (TQt v2+)

TQMimeSource is fully implemented.


TQMimeSourceFactory (TQt v2+)

TQMimeSourceFactory is fully implemented.


TQWindowsMime (TQt v3+)

TQWindowsMime is fully implemented.


TQMotifPlusStyle (TQt v2.2+)

void getButtonShift(int &x, int &y);

This takes no parameters and returns a tuple of the x and -y values. (TQt v2)

void scrollBarMetrics(const TQScrollBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

This takes only the sb parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. -(TQt v2)


TQMotifStyle (TQt v2+)

void scrollBarMetrics(const TQTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

This takes only the sb parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. -(TQt v2)

void tabbarMetrics(const TQTabBar *t, int &hframe, int &vframe, int &overlap);

This takes only the t parameter and returns a tuple of the -hframe, vframe and -overlap values. (TQt v2)


TQMovie

TQMovie(TQDataSource *src, int bufsize = 1024);

Not implemented.

void pushData(const uchar *data, int length);

length is derived from data and not -passed as a parameter. (TQt v2.2.0+)


TQMultiLineEdit

void cursorPosition const(int *line, int *col);

This takes no parameters and returns a tuple of the line and -col values. (TQt v1.x, TQt v2.x)

virtual void del();

This has been renamed delChar in Python. (TQt v1.x, TQt v2.x)

void getCursorPosition const(int *line, int *col);

This takes no parameters and returns a tuple of the line and -col values. (TQt v1.x, TQt v2.x)

bool getMarkedRegion(int *line1, int *col1, int *line2, int *col2);

This takes no parameters and returns a tuple of the bool result and the -line1, col1, line2 and -col2 values.


TQMutex (TQt v2.2+)

TQMutex is fully implemented.


TQMutexLocker (TQt v3.1+)

TQMutexLocker is fully implemented.


TQNetworkOperation (TQt v2.1+)

TQNetworkOperation is fully implemented.


TQNetworkProtocol (TQt v2.1+)

TQNetworkProtocol is fully implemented.


TQNetworkProtocolFactoryBase (TQt v2.1+)

TQNetworkProtocolFactoryBase is fully implemented.


TQObject

bool disconnect(const TQObject *receiver, const char *member = 0);

Not yet implemented.

bool disconnect(const char *signal = 0, const TQObject *receiver = 0, const char *member = 0);

Not yet implemented.

static bool disconnect(const TQObject *sender, const char *signal, const TQObject *receiver, const char *member);

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 -signal and receiver parameters is not yet -supported.


TQObjectCleanupHandler (TQt v3+)

TQObjectCleanupHandler is fully implemented.


TQObjectList

This class isn't implemented. Whenever a TQObjectList is the -return type of a function or the type of an argument, a Python list of -TQObject instances is used instead.


TQPaintDeviceMetrics

TQPaintDeviceMetrics is fully implemented.


TQPaintDevice

virtual bool cmd(int, TQPainter *, TQPDevCmdParam *);

Not implemented.


TQPainter

TQRect boundingRect(int x, int y, int w, int h, int flags, const char *str, int len = -1, char **intern = 0);

The intern parameter is not supported.

TQRect boundingRect(const TQRect&, int flags, const char *str, int len = -1, char **intern = 0);

The intern parameter is not supported.

void drawText(int x, int y, int w, int h, int flags, const char *str, int len = -1, TQRect *br = 0, char **intern = 0);

The intern parameter is not supported.

void drawText(const TQRect&, int flags, const char *str, int len = -1, TQRect *br = 0, char **intern = 0);

The intern parameter is not supported.

void setTabArray(int *ta);

This takes a single parameter which is a list of tab stops.

int *tabArray();

This returns a list of tab stops.


TQPalette

TQPalette is fully implemented, including the Python -== and != operators.


TQPixmap

TQPixmap(const char *xpm[]);

This takes a list of strings as its parameter.

bool loadFromData(const uchar *buf, uint len, const char *format = 0, ColorMode mode = Auto);

len is derived from buf and not passed as -a parameter.

bool loadFromData(const uchar *buf, uint len, const char *format, int conversion_flags);

Not implemented.


TQPixmapCache (TQt v3+)

TQPixmapCache is fully implemented.


TQPair<type,type> (TQt v3+)

Types based on the TQPair template are automatically -converted to and from Python tuples of two elements.


TQPen

TQPen is fully implemented, including the Python -== and != operators.


TQPicture

const char *data();

Not implemented.

void setData(const char *data, uint size);

size is derived from data and not passed -as a parameter.


TQPlatinumStyle (TQt v2+)

void scrollBarMetrics(const TQTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

This takes only the sb parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. -(TQt v2)


TQPoint

The Python -+, +=, --, -=, unary -, -*, *=, -/, /=, -==, != and __nonzero__ -operators are supported.

TQCOORD &rx();

Not implemented.

TQCOORD &ry();

Not implemented.


TQPointArray

TQPointArray(int nPoints, const TQCOORD *points);

This takes a single parameter which is a list of points.

void point(uint i, int *x, int *y);

This takes the single parameter i and returns the -x and y values as a tuple.

bool putPoints(int index, int nPoints, const TQCOORD *points);

This takes two parameters, index and a list of points.

bool putPoints(int index, int nPoints, int firstx, int firsty, ...);

Not implemented.

bool setPoints(int nPoints, const TQCOORD *points);

This takes a single parameter which is a list of points.

bool setPoints(int nPoints, int firstx, int firsty, ...);

Not implemented.


TQPopupMenu

int exec();

This has been renamed exec_loop in Python.

int exec(const TQPoint &pos, int indexAtPoint = 0);

This has been renamed exec_loop in Python.


TQPrintDialog (X11)

TQPrintDialog is fully implemented.


TQPrinter

TQPrinter is fully implemented.


TQProcess (TQt v3+)

TQProcess is fully implemented.


TQProgressBar

TQProgressBar is fully implemented.


TQProgressDialog

TQProgressDialog is fully implemented. -value.


TQPtrList<type> (TQt v3+)

Types based on the TQPtrList template are automatically -converted to and from Python lists of the type.


TQPushButton

TQPushButton is fully implemented.


TQRadioButton

TQRadioButton is fully implemented.


TQRangeControl

TQRangeControl is fully implemented.


TQRect

The Python -&, &=, -|, |=, -==, !=, in and -__nonzero__ operators are supported.

void coords(int *x1, int *y1, int *x2, int *y2);

This takes no parameters and returns a tuple containing the four values.

void rect(int *x, int *y, int *w, int *h);

This takes no parameters and returns a tuple containing the four values.

TQCOORD &rBottom();

Not implemented. (TQt v2+)

TQCOORD &rLeft();

Not implemented. (TQt v2+)

TQCOORD &rRight();

Not implemented. (TQt v2+)

TQCOORD &rTop();

Not implemented. (TQt v2+)


TQRegExp

The Python == and != operators are -supported.

int match(const char *str, int index = 0, int *len = 0);

This takes str and index parameters and -returns a tuple of the int result and the -len value. (TQt v1.x)

int match(const TQString &str, int index = 0, int *len = 0);

This takes str and index parameters and -returns a tuple of the int result and the -len value. (TQt v2+)


TQRegion

The Python -|, |=, -+, +=, -&, &=, --, -=, -^, ^=, -==, !=, in and -__nonzero__ operators are supported.

TQArray<TQRect> rects();

Not implemented.

void setRects(TQRect *rects, int num);

Not yet implemented. (TQt v2.2+)


TQScrollBar

TQScrollBar is fully implemented.


TQScrollView

void contentsToViewport(int x, int y, int &vx, int &vy);

This takes the x and y parameters and -returns a tuple containing the vx and vy -values. (TQt v2+)

void viewportToContents(int vx, int vy, int &x, int &y);

This takes the vx and vy parameters and -returns a tuple containing the x and y -values. (TQt v2+)


TQSemaphore (TQt v2.2+)

TQSemaphore is fully implemented. The += -and -= operators have also been implemented, but require -Python v2.0 or later.


TQSemiModal (TQt v1, v2)

TQSemiModal is fully implemented.


TQSessionManager (TQt v2+)

TQSessionManager is fully implemented.


TQSettings (TQt v3+)

bool readBoolEntry(const TQString &key, bool def = 0, bool *ok = 0);

The ok is not passed and the returned value is a tuple of -the bool result and the ok flag.

double readDoubleEntry(const TQString &key, double def = 0, bool *ok = 0);

The ok is not passed and the returned value is a tuple of -the double result and the ok flag.

TQString readEntry(const TQString &key, const TQString &def = TQString::null, bool *ok = 0);

The ok is not passed and the returned value is a tuple of -the TQString result and the ok flag.

TQStringList readListEntry(const TQString &key, bool *ok = 0);

The ok is not passed and the returned value is a tuple of -the TQStringList result and the ok flag.

TQStringList readListEntry(const TQString &key, const TQChar &separator, bool *ok = 0);

The ok is not passed and the returned value is a tuple of -the TQStringList result and the ok flag.

int readNumEntry(const TQString &key, int def = 0, bool *ok = 0);

The ok is not passed and the returned value is a tuple of -the int result and the ok flag.

bool writeEntry(const TQString &key, bool value);

Not implemented.


TQSGIStyle (TQt v2.2+)

void scrollBarMetrics(const TQScrollBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

This takes only the sb parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. -(TQt v2)


TQSignalMapper

TQSignalMapper is fully implemented.


TQSimpleRichText (TQt v2+)

TQSimpleRichText is fully implemented.


TQSize

The Python -+, +=, --, -=, -*, *=, -/, /=, -==, != and __nonzero__ -operators are supported.

TQCOORD &rheight();

Not implemented.

TQCOORD &rwidth();

Not implemented.


TQSizeGrip (TQt v2+)

TQSizeGrip is fully implemented.


TQSizePolicy (TQt v2+)

TQSizePolicy is fully implemented.


TQSlider

TQSlider is fully implemented.


TQSocketNotifier

TQSocketNotifier is fully implemented.


TQSound (TQt v2.2+)

TQSound is fully implemented.


TQSpinBox

virtual int mapTextToValue(bool *ok);

This returns a tuple of the int result and the modified -ok value.


TQSplashScreen (TQt v3.2.0+)

TQSplashScreen is fully implemented.


TQSplitter

void getRange(int id, int *min, int *max);

This takes the id parameter and returns the -min and max values as a tuple. (TQt v2+)


TQStatusBar

TQStatusBar is fully implemented.


TQChar (TQt v2+)

uchar &cell const();

Not implemented.

uchar &row const();

Not implemented.


TQString

A Python string object (or Unicode object) can be used whenever a -TQString can be used. A TQString can be -converted to a Python string object using the Python str() -function, and to a Python Unicode object using the Python -unicode() function.

The Python +=, len, [] -(for reading slices and individual characters), in and -comparison operators are supported.

TQCharRef at(uint i);

Not yet implemented. (TQt v2+)

TQChar constref const(uint i);

Not yet implemented. (TQt v2+)

TQChar &ref(uint i);

Not yet implemented. (TQt v2+)

TQString &setUnicodeCodes(const ushort *unicode_as_shorts, uint len);

Not yet implemented. (TQt v2.1+)

TQString &sprintf(const char *format, ...);

Not implemented.

short toShort(bool *ok = 0);

This returns a tuple of the short result and the -ok value.

ushort toUShort(bool *ok = 0);

This returns a tuple of the ushort result and the -ok value.

int toInt(bool *ok = 0);

This returns a tuple of the int result and the -ok value.

uint toUInt(bool *ok = 0);

This returns a tuple of the uint result and the -ok value.

long toLong(bool *ok = 0);

This returns a tuple of the long result and the -ok value.

ulong toULong(bool *ok = 0);

This returns a tuple of the ulong result and the -ok value.

float toFloat(bool *ok = 0);

This returns a tuple of the float result and the -ok value.

double toDouble(bool *ok = 0);

This returns a tuple of the double result and the -ok value.


TQStringList (TQt v2+)

The Python len, [] (for both reading and -writing slices and individual elements), del (for deleting -slices and individual elements), +, +=, -*, *=, ==, -!= and in operators are supported.

Iterator append(const TQString &x);

This does not return a value.

Iterator prepend(const TQString &x);

This does not return a value.


TQStrList

This class isn't implemented. Whenever a TQStrList is the -return type of a function or the type of an argument, a Python list of strings -is used instead.


TQStyle (TQt v2+)

virtual void getButtonShift(int &x, int &y);

This takes no parameters and returns a tuple of the x and -y values. (TQt v2)

virtual void scrollBarMetrics(const TQScrollBar *b, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

Thus takes only the b parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. -(TQt v2)

virtual void tabbarMetrics(const TQTabBar *t, int &hframe, int &vframe, int &overlap);

This takes only the t parameter and returns a tuple of the -hframe, vframe and -overlap values. (TQt v2)


TQStyleOption (TQt v3+)

TQStyleOption is fully implemented.


TQStyleSheet (TQt v2+)

TQStyleSheet is fully implemented.


TQStyleSheetItem (TQt v2+)

TQStyleSheetItem is fully implemented.


TQSyntaxHighlighter (TQt v3.1+)

TQSyntaxHighlighter is fully implemented.


TQTab

TQTab is fully implemented.


TQTabBar

TQPtrList<TQTab> tabList();

This returns a list of TQTab instances.


TQTabDialog

TQTabDialog is fully implemented.


TQTableView (TQt 1.x, TQt 2.x)

bool colXPos(int col, int *xPos);

This takes the col parameter and returns a tuple containing -the bool result and xPos.

bool rowYPos(int row, int *yPos);

This takes the row parameter and returns a tuple containing -the bool result and yPos.


TQTabWidget (TQt v2+)

TQTabWidget is fully implemented.


TQTextBrowser (TQt v2+)

TQTextBrowser is fully implemented.


TQTextCodec (TQt v2+)

virtual TQCString fromUnicode(const TQString &uc, int &lenInOut);

The returned value is a tuple of the TQCString result and the -updated lenInOut.


TQTextDecoder (TQt v2+)

TQTextDecoder is fully implemented.


TQTextEncoder (TQt v2+)

virtual TQCString fromUnicode = 0(const TQString &uc, int &lenInOut);

The returned value is a tuple of the TQCString result and the -updated lenInOut.


TQTextEdit (TQt v3+)

int charAt(const TQPoint &pos, int *para = 0);

This takes only the pos parameter and returns a tuple of the -value returned via the para pointer and the int result.

void del();

This has been renamed delChar in Python.

virtual bool find(const TQString &expr, bool cs, bool wo, bool forward = TRUE, int *para = 0, int *index = 0);

If the para and index 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 -para and index is returned.

void getCursorPosition(int *para, int *index);

This takes no parameters and returns a tuple of the values returned via the -para and index pointers.

void getSelection(int *paraFrom, int *indexFrom, int *paraTo, int *indexTo, int selNum = 0);

This takes only the selNum parameter and returns a tuple of -the paraFrom, indexFrom, -paraTo and indexTo values.


TQTextStream

TQTextStream(FILE *fp, int mode);

Not implemented.

TQTextStream &readRawBytes(char *buf, uint len);

Not yet implemented.

TQTextStream &writeRawBytes(const char *buf, uint len);

Not yet implemented.


TQTextIStream (TQt v2+)

TQTextIStream(FILE *fp, int mode);

Not implemented.


TQTextOStream (TQt v2+)

TQTextOStream(FILE *fp, int mode);

Not implemented.


TQTextView (TQt v2+)

TQTextView is fully implemented.


TQThread (TQt v2.2+)

TQThread is fully implemented.


TQTimer

TQTimer is fully implemented.


TQToolBar

TQToolBar is fully implemented.


TQToolBox (TQt v3.2.0+)

TQToolBox is fully implemented.


TQToolButton

TQToolButton is fully implemented.


TQToolTip

TQToolTip is fully implemented.


TQToolTipGroup

TQToolTipGroup is fully implemented.


TQTranslator (TQt v2+)

TQTranslator is fully implemented.


TQTranslatorMessage (TQt v2.2+)

TQTranslatorMessage is fully implemented.


TQUrl (TQt v2.1+)

TQUrl is fully implemented, including the -TQString(), == and != -operators.


TQUrlInfo (TQt v2.1+)

TQUrlInfo is fully implemented.


TQUrlOperator (TQt v2.1+)

virtual bool isDir(bool *ok);

This returns a tuple of the bool result and the -ok value.


TQUuid (TQt v3.0+)

TQUuid is fully implemented.


TQValidator

virtual State validate(TQString& input, int& pos);

The returned value is a tuple of the State result and the -updated pos.


TQDoubleValidator

State validate(TQString& input, int& pos);

The returned value is a tuple of the State result and the -updated pos.


TQIntValidator

State validate(TQString& input, int& pos);

The returned value is a tuple of the State result and the -updated pos.


TQRegExpValidator (TQt v3+)

virtual State validate(TQString& input, int& pos);

The returned value is a tuple of the State result and the -updated pos.


TQValueList<type> (TQt v2+)

Types based on the TQValueList template are automatically -converted to and from Python lists of the type.


TQVariant (TQt v2.1+)

TQVariant(const char *val);

Not implemented.

TQVariant(const TQBitArray &val);

Not yet implemented. (TQt v3+)

TQVariant(const TQValueList<TQVariant> &val);

Not yet implemented.

TQVariant(const TQMap<TQString,TQVariant> &val);

Not yet implemented.

TQBitArray &asBitArray();

Not yet implemented. (TQt v3+)

bool &asBool();

Not implemented.

double &asDouble();

Not implemented.

int &asInt();

Not implemented.

TQValueList<TQVariant> &asList();

Not implemented.

TQMap<TQString,TQVariant> &asMap();

Not implemented.

uint &asUInt();

Not implemented.

TQValueListConstIterator<TQVariant>listBegin const();

Not implemented.

TQValueListConstIterator<TQVariant>listEnd const();

Not implemented.

TQMapConstIterator<TQString,TQVariant>mapBegin const();

Not implemented.

TQMapConstIterator<TQString,TQVariant>mapEnd const();

Not implemented.

TQMapConstIterator<TQString,TQVariant>mapFind const(const TQString &key);

Not implemented.

TQValueListConstIterator<TQString>stringListBegin const();

Not implemented.

TQValueListConstIterator<TQString>stringListEnd const();

Not implemented.

const TQBitArray toBitArray const();

Not yet implemented. (TQt v3+)

const TQValueList<TQVariant>toList const();

Not yet implemented.

const TQMap<TQString,TQVariant>toMap const();

Not yet implemented.


TQVBox (TQt v2+)

TQVBox is fully implemented.


TQVButtonGroup (TQt v2+)

TQVButtonGroup is fully implemented.


TQVGroupBox (TQt v2+)

TQVGroupBox is fully implemented.


TQWaitCondition (TQt v2.2+)

TQWaitCondition is fully implemented.


TQWhatsThis

TQWhatsThis is fully implemented.


TQWidget

TQWExtra *extraData();

Not implemented.

TQFocusData *focusData();

Not implemented.

void lower();

This has been renamed to lowerW in Python.

void raise();

This has been renamed to raiseW in Python.


TQWidgetList

This class isn't implemented. Whenever a TQWidgetList is the -return type of a function or the type of an argument, a Python list of -instances is used instead.


TQWidgetStack

TQWidgetStack is fully implemented.


TQWindow

TQWindow is fully implemented (TQt v1.x).


TQWindowsStyle (TQt v2+)

void getButtonShift(int &x, int &y);

This takes no parameters and returns a tuple of the x and -y values. (TQt v2)

void scrollBarMetrics(const TQTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

This takes only the sb parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. -(TQt v2)

void tabbarMetrics(const TQTabBar *t, int &hframe, int &vframe, int &overlap);

This takes only the t parameter and returns a tuple of the -hframe, vframe and -overlap values. (TQt v2)


TQWindowsXPStyle (TQt v3.0.1+, Windows)

TQWindowsXPStyle is fully implemented.


TQWizard (TQt v2+)

TQWizard is fully implemented.


TQWMatrix

The Python ==, != and -*= operators are supported.

TQWMatrix invert const(bool *invertible = 0);

This takes no parameters and returns a tuple of the TQWMatrix -result and the invertible value.

void map const(int x, int y, int *tx, int *ty);

This takes the x and y parameters and -returns a tuple containing the tx and ty -values.

void map const(float x, float y, float *tx, float *ty);

This takes the x and y parameters and -returns a tuple containing the tx and ty -values. (TQt v1.x)

void map const(double x, double y, double *tx, double *ty);

This takes the x and y parameters and -returns a tuple containing the tx and ty -values. (TQt v2+)


TQWorkspace (TQt v2.1+)

TQWorkspace is fully implemented.


qtaxcontainer Module Reference

TQAxBase (Windows, TQt v3+)

TQAxObject(IUnknown *iface = 0);

Not implemented.

long queryInterface(const TQUuid &uuid, void **iface);

Not implemented.

PropertyBag propertyBag const();

Not implemented.

void setPropertyBag(const PropertyBag &bag);

Not implemented.

unsigned long registerWeakActiveObject(const TQString &guid);

This is a utility method provided by PyTQt to make it easier to use -Mark Hammond's win32com module to manipulate objects -created by the qtaxcontainer module.

The RegisterActiveObject() COM function is called to -register the TQAxBase instance as a weak object with the -guid GUID. The revoke handle is returned.

static void revokeActiveObject(unsigned long rhandle);

This is a wrapper around the RevokeActiveObject() COM -function and is called to revoke the object registered using -registerWeakActiveObject(). rhandle is -the revoke handle returned by registerWeakActiveObject().


TQAxObject (Windows, TQt v3+)

TQAxObject(IUnknown *iface, TQObject *parent = 0, const char *name = 0);

Not implemented.


TQAxWidget (Windows, TQt v3+)

TQAxWidget(IUnknown *iface, TQWidget *parent = 0, const char *name = 0);

Not implemented.


qtcanvas Module Reference

TQCanvas (TQt v2.2+)

TQCanvas is fully implemented.


TQCanvasEllipse (TQt v2.2+)

TQCanvasEllipse is fully implemented.


TQCanvasItem (TQt v2.2+)

TQCanvasItem is fully implemented.


TQCanvasItemList (TQt v2.2+)

This class isn't implemented. Whenever a TQCanvasItemList is -the return type of a function or the type of an argument, a Python list of -TQCanvasItem instances is used instead.


TQCanvasLine (TQt v2.2+)

TQCanvasLine is fully implemented.


TQCanvasPixmap (TQt v2.2+)

TQCanvasPixmap is fully implemented.


TQCanvasPixmapArray (TQt v2.2+)

TQPixmapArray(TQPtrList<TQPixmap> pixmaps, TQPtrList<TQPoint> hotspots);

The pixmaps argument is a Python list of TQPixmap instances, -and the hotspots argument is a Python list of TQPoint -instances. (TQt v2.2.0 - TQt v2.3.1)

TQPixmapArray(TQValueList<TQPixmap> pixmaps, TQPointArray hotspots = TQPointArray());

The pixmaps argument is a Python list of TQPixmap instances. -(TQt v3+)


TQCanvasPolygon (TQt v2.2+)

TQCanvasPolygon is fully implemented.


TQCanvasPolygonalItem (TQt v2.2+)

TQCanvasPolygonalItem is fully implemented.


TQCanvasRectangle (TQt v2.2+)

TQCanvasRectangle is fully implemented.


TQCanvasSpline (TQt v3.0+)

TQCanvasSpline is fully implemented.


TQCanvasSprite (TQt v2.2+)

TQCanvasSprite is fully implemented.


TQCanvasText (TQt v2.2+)

TQCanvasText is fully implemented.


TQCanvasView (TQt v2.2+)

TQCanvasView is fully implemented.


qtext Module Reference

TQextScintilla

void getCursorPosition(int *line, int *index);

This takes no parameters and returns a tuple of the values returned by the -line and index pointers.

void getSelection(int *lineFrom, int *indexFrom, int *lineTo, int *indexTo);

This takes no parameters and returns a tuple of the values returned by the -lineFrom, indexFrom, -lineTo and indexTo pointers.


TQextScintillaAPIs

TQextScintillaAPIs is fully implemented.


TQextScintillaBase

TQextScintillaBase is fully implemented.


TQextScintillaCommand

TQextScintillaCommand is fully implemented.


TQextScintillaCommandSet

TQextScintillaCommandSet is fully implemented.


TQextScintillaDocument

TQextScintillaDocument is fully implemented.


TQextScintillaLexer

TQextScintillaLexer is fully implemented.


TQextScintillaLexerBash (TQScintilla v1.4+)

TQextScintillaLexerBash is fully implemented.


TQextScintillaLexerBatch (TQScintilla v1.6+)

TQextScintillaLexerBatch is fully implemented.


TQextScintillaLexerCPP

TQextScintillaLexerCPP is fully implemented.


TQextScintillaLexerCSharp

TQextScintillaLexerCSharp is fully implemented.


TQextScintillaLexerCSS (TQScintilla v1.6+)

TQextScintillaLexerCSS is fully implemented.


TQextScintillaLexerDiff (TQScintilla v1.6+)

TQextScintillaLexerDiff is fully implemented.


TQextScintillaLexerHTML (TQScintilla v1.1+)

TQextScintillaLexerHTML is fully implemented.


TQextScintillaLexerIDL

TQextScintillaLexerIDL is fully implemented.


TQextScintillaLexerJava

TQextScintillaLexerJava is fully implemented.


TQextScintillaLexerJavaScript

TQextScintillaLexerJavaScript is fully implemented.


TQextScintillaLexerLua (TQScintilla v1.5+)

TQextScintillaLexerLua is fully implemented.


TQextScintillaLexerMakefile (TQScintilla v1.6+)

TQextScintillaLexerMakefile is fully implemented.


TQextScintillaLexerPerl

TQextScintillaLexerPerl is fully implemented.


TQextScintillaLexerPOV (TQScintilla v1.6+)

TQextScintillaLexerPOV is fully implemented.


TQextScintillaLexerProperties (TQScintilla v1.6+)

TQextScintillaLexerProperties is fully implemented.


TQextScintillaLexerPython

TQextScintillaLexerPython is fully implemented.


TQextScintillaLexerRuby (TQScintilla v1.5+)

TQextScintillaLexerRuby is fully implemented.


TQextScintillaLexerSQL (TQScintilla v1.1+)

TQextScintillaLexerSQL is fully implemented.


TQextScintillaLexerTeX (TQScintilla v1.6+)

TQextScintillaLexerTeX is fully implemented.


TQextScintillaMacro

TQextScintillaMacro is fully implemented.


TQextScintillaPrinter

TQextScintillaPrinter is fully implemented.


qtgl Module Reference

TQGL

TQGL is fully implemented.


TQGLContext

TQGLContext is fully implemented.


TQGLFormat

TQGLFormat is fully implemented.


TQGLWidget

TQGLWidget is fully implemented.


TQGLColormap (TQt v3.0+)

void setEntries(int count, const TQRgb *colors, int base = 0);

Not yet implemented.


qtnetwork Module Reference

TQDns (TQt v2.2+)

TQDns is fully implemented.


TQFtp (TQt v2.2+)

TQ_LONG readBlock(char *data, TQ_ULONG maxlen);

This takes a single maxlen parameter. The -data is returned if there was no error, otherwise -None is returned.


TQHostAddress (TQt v2.2+)

TQHostAddress(TQ_UINT8 *ip6Addr);

Not yet implemented.

TQHostAddress(const Q_IPV6ADDR &ip6Addr);

Not yet implemented.

void setAddress(TQ_UINT8 *ip6Addr);

Not yet implemented.

Q_IPV6ADDR toIPv6Address const();

Not yet implemented.


TQHttp (TQt v3+)

TQ_LONG readBlock(char *data, TQ_ULONG maxlen);

This takes a single maxlen parameter. The -data is returned if there was no error, otherwise -None is returned.


TQHttpHeader (TQt v3.1+)

TQHttpHeader is fully implemented.


TQHttpRequestHeader (TQt v3.1+)

TQHttpRequestHeader is fully implemented.


TQHttpResponseHeader (TQt v3.1+)

TQHttpResponseHeader is fully implemented.


TQLocalFs (TQt v2.1+)

TQLocalFs is fully implemented.


TQServerSocket (TQt v2.2+)

TQServerSocket is fully implemented.


TQSocket (TQt v2.2+)

TQ_LONG readBlock(char *data, TQ_ULONG len);

This takes a single len parameter. The -data is returned if there was no error, otherwise -Py_None is returned.

TQ_LONG readLine(char *data, TQ_ULONG maxlen);

This takes a single maxlen parameter. The -data is returned if there was no error, otherwise -Py_None is returned.

TQ_LONG writeBlock(const char *data, TQ_ULONG len);

len is derived from data and not passed -as a parameter.


TQSocketDevice (TQt v2.2+)

TQ_LONG readBlock(char *data, TQ_ULONG len);

This takes a single len parameter. The -data is returned if there was no error, otherwise -None is returned.

TQ_LONG writeBlock(const char *data, TQ_ULONG len);

len is derived from data and not passed -as a parameter.


qtpe Module Reference

TQPEApplication

TQApplication(int& argc, char **argv, Type type);

This takes two parameters, the first of which is a list of argument strings. -Arguments used by TQt are removed from the list.

int exec();

This has been renamed to exec_loop in Python.


AppLnk

virtual TQString exec const();

This has been renamed to exec_property in Python.


AppLnkSet

AppLnkSet is fully implemented.


Config

Config is fully implemented.


DateFormat

DateFormat is fully implemented.


DocLnk

TQString exec const();

This has been renamed to exec_property in Python.


DocLnkSet

DocLnkSet is fully implemented.


FileManager

FileManager is fully implemented.


FileSelector

FileSelector is fully implemented.


FileSelectorItem

FileSelectorItem is fully implemented.


FontDatabase

FontDatabase is fully implemented.


Global

static void setBuiltinCommands(Command *);

Not implemented.


MenuButton

MenuButton is fully implemented.


TQCopEnvelope

TQCopEnvelope is fully implemented.


TQDawg

TQDawg is fully implemented.


TQPEMenuBar

TQPEMenuBar is fully implemented.


TQPEToolBar

TQPEToolBar is fully implemented.


Resource

Resource is fully implemented.


qtsql Module Reference

TQDataBrowser (TQt v3+)

virtual void del();

This has been renamed delOnCursor in Python.


TQDataTable (TQt v3+)

TQDataTable is fully implemented.


TQDataView (TQt v3+)

TQDataView is fully implemented.


TQEditorFactory (TQt v3+)

TQEditorFactory is fully implemented.


TQSql (TQt v3+)

TQSql is fully implemented.


TQSqlCursor (TQt v3+)

virtual int del(bool invalidate = TRUE);

This has been renamed delRecords in Python.

virtual int del(const TQString &filter, bool invalidate = TRUE);

This has been renamed delRecords in Python.

bool exec(const TQString &query);

This has been renamed execQuery in Python.


TQSqlDatabase (TQt v3+)

TQSqlQuery exec(const TQString &query = TQString::null);

This has been renamed execStatement in Python.


TQSqlDriver (TQt v3+)

TQSqlDriver is fully implemented.


TQSqlEditorFactory (TQt v3+)

TQSqlEditorFactory is fully implemented.


TQSqlError (TQt v3+)

TQSqlError is fully implemented.


TQSqlField (TQt v3+)

TQSqlField is fully implemented.


TQSqlFieldInfo (TQt v3+)

TQSqlFieldInfo is fully implemented.


TQSqlForm (TQt v3+)

TQSqlForm is fully implemented.


TQSqlIndex (TQt v3+)

TQSqlIndex is fully implemented.


TQSqlPropertyMap (TQt v3+)

TQSqlPropertyMap is fully implemented. However, because PyTQt -does not allow new properties to be defined, it is not possible to implement -custom editor widgets in Python and add them to a property map. This will -simple be ignored.

This problem may be addressed in a future release of PyTQt.


TQSqlQuery (TQt v3+)

TQMap<TQString,TQVariant> boundValues const();

Not yet implemented. (TQt v3.2.0+)

virtual bool exec(const TQString &query);

This has been renamed execQuery in Python.

bool exec();

This has been renamed execQuery in Python. (TQt v3.1+)


TQSqlRecord (TQt v3+)

TQSqlRecord is fully implemented.


TQSqlRecordInfo (TQt v3+)

TQSqlRecordInfo is implemented as a Python list of -TQSqlFieldInfo instances.


TQSqlResult (TQt v3+)

TQSqlResult is fully implemented.


TQSqlSelectCursor (TQt v3.2.0+)

int del(bool invalidate = TRUE);

This has been renamed delRecords in Python.

bool exec(const TQString &query);

This has been renamed execQuery in Python.


qttable Module Reference

TQTable (TQt v2.2+)

TQTable is fully implemented.


TQTableItem (TQt v2.2+)

TQTableItem is fully implemented.


TQCheckTableItem (TQt v3+)

TQCheckTableItem is fully implemented.


TQComboTableItem (TQt v3+)

TQComboTableItem is fully implemented.


TQTableSelection (TQt v2.2+)

TQTableSelection is fully implemented.


qtui Module Reference

TQWidgetFactory (TQt v3+)

TQWidgetFactory is fully implemented.


qtxml Module Reference

TQDomImplementation (TQt v2.2+)

TQDomImplementation is fully implemented.


TQDomNode (TQt v2.2+)

TQDomNode is fully implemented, including the Python -== and != operators.


TQDomNodeList (TQt v2.2+)

TQDomNodeList is fully implemented.


TQDomDocument (TQt v2.2+)

bool setContent(const TQCString &buffer, bool namespaceProcessing, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

This takes the buffer and -namespaceProcessing parameters and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+)

bool setContent(const TQByteArray &buffer, bool namespaceProcessing, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

This takes the buffer and -namespaceProcessing parameters and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+)

bool setContent(const TQString &text, bool namespaceProcessing, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

This takes the text and -namespaceProcessing parameters and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+)

bool setContent(const TQIODevice *dev, bool namespaceProcessing, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

This takes the dev and -namespaceProcessing parameters and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+)

bool setContent(const TQCString &buffer, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

This takes the buffer parameter only and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+)

bool setContent(const TQByteArray &buffer, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

This takes the buffer parameter only and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+)

bool setContent(const TQString &text, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

This takes the text parameter only and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+)

bool setContent(const TQIODevice *dev, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

This takes the dev parameter only and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+)

bool setContent(TQXmlInputSource *source, TQXmlReader *reader, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

Not yet implemented. (TQt v3.2.0+)


TQDomDocumentFragment (TQt v2.2+)

TQDomDocumentFragment is fully implemented.


TQDomDocumentType (TQt v2.2+)

TQDomDocumentType is fully implemented.


TQDomNamedNodeMap (TQt v2.2+)

TQDomNamedNodeMap is fully implemented.


TQDomCharacterData (TQt v2.2+)

TQDomCharacterData is fully implemented.


TQDomAttr (TQt v2.2+)

TQDomAttr is fully implemented.


TQDomElement (TQt v2.2+)

TQDomElement is fully implemented.


TQDomText (TQt v2.2+)

TQDomText is fully implemented.


TQDomComment (TQt v2.2+)

TQDomComment is fully implemented.


TQDomCDATASection (TQt v2.2+)

TQDomCDATASection is fully implemented.


TQDomNotation (TQt v2.2+)

TQDomNotation is fully implemented.


TQDomEntity (TQt v2.2+)

TQDomEntity is fully implemented.


TQDomEntityReference (TQt v2.2+)

TQDomEntityReference is fully implemented.


TQDomProcessingInstruction (TQt v2.2+)

TQDomProcessingInstruction is fully implemented.

diff --git a/doc/PyQt.sgml b/doc/PyQt.sgml deleted file mode 100644 index 3eece7e..0000000 --- a/doc/PyQt.sgml +++ /dev/null @@ -1,5807 +0,0 @@ - -
- - Python Bindings for TQt (3.18.1) - - Phil - Thompson - - - - This document describes a set of Python bindings for the TQt widget set. - Contact the author at phil@riverbankcomputing.co.uk. - - - - - -Introduction - -PyTQt is a set of Python bindings for the TQt toolkit and available for all -platforms supported by TQt, including Windows, Linux, UNIX, MacOS/X and embedded -systems such as the Sharp Zaurus and the Compaq iPAQ. They have been tested -against TQt versions 1.43 to 3.3.6, TQt Non-commercial, TQtopia 1.5.0, and Python -versions 1.5 to 2.4.2. TQt/Embedded v3 is not supported. TQt v4 is supported -by PyTQt v4. - - - -PyTQt is available under the GPL license for use with the GPL version of TQt, a -a commercial license for use with the commercial version of TQt, a -non-commercial license for use with the non-commercial version of TQt v2, and an -educational license for use with the educational version of TQt. - - - -There is also an evaluation version of PyTQt for Windows. This must be used -with the corresponding evaluation version of TQt. - - - -PyTQt is built using SIP (a tool for generating Python extension modules for -C++ class libraries). SIP v4.6 or later must be installed in order to build -and run this version of PyTQt. - - - -PyTQt for MacOS/X requires TQt v3.1.0 or later and Python v2.3 or later. - - - -The bindings are implemented as a number of Python modules - - - - - -qt is the main module and contains the core classes and most -user interface widgets. - - - - - -qtaxcontainer contains a sub-set of the classes implemented -in TQt's TQAxContainer module, part of TQt's ActiveTQt framework. - - - - - -qtcanvas contains the classes implemented in TQt's Canvas -module. - - - - - -qtgl contains the classes implemented in TQt's OpenGL module. - - - - - -qtnetwork contains the classes implemented in TQt's Network -module. - - - - - -qtpe contains the classes implemented in TQtopia (originally -called the TQt Palmtop Environment). It is only supported with TQt/Embedded. - - - - - -qtsql contains the classes implemented in TQt's SQL module. - - - - - -qttable contains the classes implemented in TQt's Table -module. - - - - - -qtui contains the classes implemented in TQt's tqui library. -These allow GUIs to be created directly from TQt Designer's -.ui files. - - - - - -qtxml contains the classes implemented in TQt's XML module. - - - - - -qtext contains useful third-party classes that are not part -of TQt. At the moment it contains bindings for TQScintilla, the port to TQt of -the Scintilla programmer's editor class. - - - - - -PyTQt also includes the pyuic and -pylupdate utilities which correspond to the TQt -uic and lupdate utilities. -pyuic converts the GUI designs created with TQt Designer to -executable Python code. pylupdate scans Python code, -extracts all strings that are candidates for internationalisation, and creates -an XML file for use by TQt Linguist. - - -Changes - -The changes visible to the Python programmer in this release are as follows. - - - - - -This version requires SIP v4.4 (or later). - - - - - -Concatenating Python strings and TQStrings is now supported. - - - - - -TQString now supports the * and -*= operators that behave as they do for Python strings. - - - - - -TQString is more interoperable with Python string and unicode -objects. For example they can be passed as arguments to -open() and to most (but not all) string methods. - - - - - -TQPopupMenu (and sub-classes) instances now transfer -ownership of the menu to Python in the call to exec_loop(). -This means the menu's resources are all released when the Python wrapper is -garbage collected without needing to call -TQObject.deleteLater(). - - - - - -TQObject.sender() now handles Python signals. - - - - - -The missing MacintoshVersion enum has been added. - - - - - -PYQT_BUILD has been removed. - - - - - -The convention for converting between a C/C++ null pointer and Python's -None object has now been universally applied. In previous -versions a null pointer to, for example, a TQt list container would often be -converted to an empty list rather than None. - - - - - - - - -Other PyTQt Goodies -Using TQt Designer - -TQt Designer is a GPL'ed GUI design editor provided by Trolltech as part of TQt. -It generates an XML description of a GUI design. TQt includes -uic which generates C++ code from that XML. - - - -PyTQt includes pyuic which generates Python code from the -same XML. The Python code is self contained and can be executed immediately. - - - -It is sometimes useful to be able to include some specific Python code in the -output generated by pyuic. For example, if you are using -custom widgets, pyuic has no way of knowing the name of the -Python module containing the widget and so cannot generate the required -import statement. To help get around this, -pyuic will extract any lines entered in the -Comment field of TQt Designer's -Form Settings dialog that begin with -Python: and copies them to the generated output. - - - -Here's a simple example showing the contents of the Comment -field. - - - -This comment will be ignored by pyuic. -Python: -Python:# Import our custom widget. -Python:from foo import bar - - - -Here's the corresponding output from pyuic. - - - -from PyTQt.qt import * - -# Import our custom widget. -from foo import bar - - - -Thanks to Christian Bird, pyuic will extract Python code -entered using TQt Designer to implement slots. In TQt Designer, when you need to -edit a slot and the source editor appears, enter Python code between the curly -braces. Don't worry about the correct starting indent level, each line is -prepended with a correct indentation. - - - -Make sure that the ui.h file is in the same directory as the -.ui file when using pyuic. The -.ui file implies the name of the .ui.h -file so there is no need to specify it on the command line. - - - -Here's an example of a simple slot. - - - -void DebMainWindowFrm::browsePushButtonClicked() -{ -if self.debugging: - TQMessageBox.critical(self, "Event", "browse pushbutton was clicked!") -} - - - -Here is the resulting code when pyuic is run. - - - -class DebMainWindowFrm(TQMainWindow): - ...stuff... - def browsePushButtonClicked(self): - if self.debugging: - TQMessageBox.critical(self, "Event", "browse pushbutton was clicked!") - - - -Note that indenting is as normal and that self and all other -parameters passed to the slot are available. - - - -If you use this, you will need to turn off all of the fancy options for the C++ -editor in Designer as it tries to force C++ syntax and that's naturally -annoying when trying to code in Python. - - - -Using TQt Linguist - -TQt includes the lupdate program which parses C++ source -files converting calls to the QT_TR_NOOP() and -QT_TRANSLATE_NOOP() macros to .ts -language source files. The lrelease program is then used to -generate .qm binary language files that are distributed with -your application. - - - -Thanks to Detlev Offenbach, PyTQt includes the pylupdate -program. This generates the same .ts language source files -from your PyTQt source files. - - - - - -Deploying Commercial PyTQt Applications - -When deploying commercial PyTQt applications it is necessary to discourage users -from accessing the underlying PyTQt modules for themselves. A user that used -the modules shipped with your application to develop new applications would -themselves be considered a developer and would need their own commercial TQt and -PyTQt licenses. - - - -One solution to this problem is the -VendorID -package. This allows you to build Python extension modules that can only be -imported by a digitally signed custom interpreter. The package enables you to -create such an interpreter with your application embedded within it. The -result is an interpreter that can only run your application, and PyTQt modules -that can only be imported by that interpreter. You can use the package to -similarly restrict access to any extension module. - - - -In order to build PyTQt with support for the VendorID package, pass the --i command line flag to configure.py. - - - -<Literal>pyqtconfig</Literal> and Build System Support - -The SIP build system (ie. the sipconfig module) is described -in the SIP documentation. PyTQt includes the pyqtconfig -module that can be used by configuration scripts of other bindings that are -built on top of PyTQt. - - - -The pyqtconfig module contains the following classes: - - - - -Configuration(sipconfig.Configuration) - - -This class encapsulates additional configuration values, specific to PyTQt, that -can be accessed as instance variables. - - - -The following configuration values are provided (in addition to those provided -by the sipconfig.Configuration class): - - - - -pyqt_bin_dir - - -The name of the directory containing the pyuic and -pylupdate executables. - - - - - - -pyqt_config_args - - -The command line passed to configure.py when PyTQt was -configured. - - - - - - -pyqt_mod_dir - - -The name of the directory containing the PyTQt modules. - - - - - - -pyqt_modules - - -A string containing the names of the PyTQt modules that were installed. - - - - - - -pyqt_qt_sip_flags - - -A string of the SIP flags used to generate the code for the -qt module and which should be added to those needed by any -module that imports the qt module. - - - - - - -pyqt_qtaxcontainer_sip_flags - - -A string of the SIP flags used to generate the code for the -qtaxcontainer module and which should be added to those -needed by any module that imports the qtaxcontainer module. - - - - - - -pyqt_qtcanvas_sip_flags - - -A string of the SIP flags used to generate the code for the -qtcanvas module and which should be added to those needed by -any module that imports the qtcanvas module. - - - - - - -pyqt_qtext_sip_flags - - -A string of the SIP flags used to generate the code for the -qtext module and which should be added to those needed by -any module that imports the qtext module. - - - - - - -pyqt_qtgl_sip_flags - - -A string of the SIP flags used to generate the code for the -qtgl module and which should be added to those needed by any -module that imports the qtgl module. - - - - - - -pyqt_qtnetwork_sip_flags - - -A string of the SIP flags used to generate the code for the -qtnetwork module and which should be added to those needed -by any module that imports the qtnetwork module. - - - - - - -pyqt_qtsql_sip_flags - - -A string of the SIP flags used to generate the code for the -qtsql module and which should be added to those needed by -any module that imports the qtsql module. - - - - - - -pyqt_qttable_sip_flags - - -A string of the SIP flags used to generate the code for the -qttable module and which should be added to those needed by -any module that imports the qttable module. - - - - - - -pyqt_qtui_sip_flags - - -A string of the SIP flags used to generate the code for the -qtui module and which should be added to those needed by any -module that imports the qtui module. - - - - - - -pyqt_qtxml_sip_flags - - -A string of the SIP flags used to generate the code for the -qtxml module and which should be added to those needed by -any module that imports the qtxml module. - - - - - - -pyqt_sip_dir - - -The name of the base directory where the .sip files for each -of the PyTQt modules is installed. A sub-directory exists with the same name as -the module. - - - - - - -pyqt_version - - -The PyTQt version as a 3 part hexadecimal number (eg. v3.10 is represented as -0x030a00). - - - - - - -pyqt_version_str - - -The PyTQt version as a string. For development snapshots it will start with -snapshot-. - - - - - - - - - - -TQtModuleMakefile(sipconfig.SIPModuleMakefile) - - -The Makefile class for modules that import the qt module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - -TQtAxContainerModuleMakefile(TQtModuleMakefile) - - -The Makefile class for modules that import the qtaxcontainer -module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - -TQtCanvasModuleMakefile(TQtModuleMakefile) - - -The Makefile class for modules that import the qtcanvas -module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - -TQtExtModuleMakefile(TQtModuleMakefile) - - -The Makefile class for modules that import the qtext module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - -TQtGLModuleMakefile(TQtModuleMakefile) - - -The Makefile class for modules that import the qtgl module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - -TQtNetworkModuleMakefile(TQtModuleMakefile) - - -The Makefile class for modules that import the qtnetwork -module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - -TQtTableModuleMakefile(TQtModuleMakefile) - - -The Makefile class for modules that import the qttable -module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - -TQtSQLModuleMakefile(TQtTableModuleMakefile) - - -The Makefile class for modules that import the qtsql module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - -TQtUIModuleMakefile(TQtModuleMakefile) - - -The Makefile class for modules that import the qtui module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - -TQtXMLModuleMakefile(TQtModuleMakefile) - - -The Makefile class for modules that import the qtxml module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - - -Things to be Aware Of -super and Wrapped Classes - -Internally PyTQt implements a lazy technique for attribute lookup where -attributes are only placed in type and instance dictionaries when they are -first referenced. This technique is needed to reduce the time taken to import -large modules such as PyTQt. - - - -In most circumstances this technique is transparent to an application. The -exception is when super is used with a PyTQt class. The way -that super is currently implemented means that the lazy -lookup is bypassed resulting in AttributeError exceptions -unless the attribute has been previously referenced. - - - -Note that this restriction applies to any class wrapped by SIP and not just -PyTQt. - - - - -Python Strings, TQt Strings and Unicode - -Unicode support was added to TQt in v2.0 and to Python in v1.6. In TQt, Unicode -support is implemented using the TQString class. It is -important to understand that TQStrings, Python string objects -and Python Unicode objects are all different but conversions between them are -automatic in almost all cases and easy to achieve manually when needed. - - - -Whenever PyTQt expects a TQString as a function argument, a -Python string object or a Python Unicode object can be provided instead, and -PyTQt will do the necessary conversion automatically. - - - -You may also manually convert Python string and Unicode objects to -TQStrings by using the TQString constructor -as demonstrated in the following code fragment. - - - -qs1 = TQString('Converted Python string object') -qs2 = TQString(u'Converted Python Unicode object') - - - -In order to convert a TQString to a Python string object use -the Python str() function. Applying -str() to a null TQString and an empty -TQString both result in an empty Python string object. - - - -In order to convert a TQString to a Python Unicode object use -the Python unicode() function. Applying -unicode() to a null TQString and an empty -TQString both result in an empty Python Unicode object. - - - -Access to Protected Member Functions - -When an instance of a C++ class is not created from Python it is not possible -to access the protected member functions, or emit the signals, of that -instance. Attempts to do so will raise a Python exception. Also, any Python -methods corresponding to the instance's virtual member functions will never be -called. - - - -<Literal>None</Literal> and <Literal>NULL</Literal> - -Throughout the bindings, the None value can be specified -wherever NULL is acceptable to the underlying C++ code. - - - -Equally, NULL is converted to None -whenever it is returned by the underlying C++ code. - - - - -Support for C++ <Literal>void *</Literal> Data Types - -PyTQt represents void * values as objects of type -sip.voidptr. Such values are often used to pass the -addresses of external objects between different Python modules. To make this -easier, a Python integer (or anything that Python can convert to an integer) -can be used whenever a sip.voidptr is expected. - - -A sip.voidptr may be converted to a Python integer by using -the int() builtin function. - - -A sip.voidptr may be converted to a Python string by using -its asstring() method. The asstring() -method takes an integer argument which is the length of the data in bytes. - - - - -Support for Threads - -PyTQt implements the full set of TQt's thread classes. Python, of course, also -has its own thread extension modules. If you are using SIP v4 (or later) and -Python v2.3.5 (or later) then PyTQt does not impose any additional restrictions. -(Read the relevant part of the TQt documentation to understand the restrictions -imposed by the TQt API.) - - -If you are using earlier versions of either SIP or Python then it is possible -to use either of the APIs so long as you follow some simple rules. - - - - -If you use the TQt API then the very first import of one of -the PyTQt modules must be done from the main thread. - - - - -If you use the Python API then all calls to PyTQt (including any -imports) must be done from one thread only. Therefore, if -you want to make calls to PyTQt from several threads then you must use the TQt -API. - - - - -If you want to use both APIs in the same application then all calls to PyTQt -must be done from threads created using the TQt API. - - - - -The above comments actually apply to any SIP generated module, not just PyTQt. - - - -Garbage Collection - -C++ does not garbage collect unreferenced class instances, whereas Python does. -In the following C++ fragment both colours exist even though the first can no -longer be referenced from within the program: - - - -c = new TQColor(); -c = new TQColor(); - - - -In the corresponding Python fragment, the first colour is destroyed when -the second is assigned to c: - - - -c = TQColor() -c = TQColor() - - - -In Python, each colour must be assigned to different names. Typically this -is done within class definitions, so the code fragment would be something like: - - - -self.c1 = TQColor() -self.c2 = TQColor() - - - -Sometimes a TQt class instance will maintain a pointer to another instance and -will eventually call the destructor of that second instance. The most common -example is that a TQObject (and any of its sub-classes) keeps -pointers to its children and will automatically call their destructors. In -these cases, the corresponding Python object will also keep a reference to the -corresponding child objects. - - - -So, in the following Python fragment, the first TQLabel is -not destroyed when the second is assigned to l because the -parent TQWidget still has a reference to it. - - - -p = TQWidget() -l = TQLabel('First label',p) -l = TQLabel('Second label',p) - - - -C++ Variables - -Access to C++ variables is supported. They are accessed as Python instance -variables. For example: - - - -tab = TQTab() -tab.label = "First Tab" -tab.r = TQRect(10,10,75,30) - - - -Global variables and static class variables are effectively read-only. They -can be assigned to, but the underlying C++ variable will not be changed. This -may change in the future. - - - -Access to protected C++ class variables is not supported. This may change in -the future. - - - -Multiple Inheritance - -It is not possible to define a new Python class that sub-classes from more than -one TQt class. - - - -i18n Support - -TQt implements i18n support through the TQt Linguist application, the -TQTranslator class, and the -TQApplication::translate(), TQObject::tr() -and TQObject::trUtf8() methods. Usually the -tr() method is used to obtain the correct translation of a -message. The translation process uses a message context to allow the same -message to be translated differently. tr() is actually -generated by moc and uses the hardcoded class name as the -context. On the other hand, TQApplication::translate() -allows to context to be explicitly stated. - - - -Unfortunately, because of the way TQt implents tr() (and -trUtf8()) it is not possible for PyTQt to exactly reproduce -its behavour. The PyTQt implementation of tr() (and -trUtf8()) uses the class name of the instance as the -context. The key difference, and the source of potential problems, is that the -context is determined dynamically in PyTQt, but is hardcoded in TQt. In other -words, the context of a translation may change depending on an instance's class -hierarchy. - - - -class A(TQObject): - def __init__(self): - TQObject.__init__(self) - - def hello(self): - return self.tr("Hello") - -class B(A): - def __init__(self): - A.__init__(self) - -a = A() -a.hello() - -b = B() -b.hello() - - - -In the above the message is translated by a.hello() using a -context of A, and by b.hello() using a -context of B. In the equivalent C++ version the context -would be A in both cases. - - - -The PyTQt behaviour is unsatisfactory and may be changed in the future. It is -recommended that TQApplication.translate() be used in -preference to tr() (and trUtf8()). This -is guaranteed to work with current and future versions of PyTQt and makes it -much easier to share message files between Python and C++ code. Below is the -alternative implementation of A that uses -TQApplication.translate(). - - - -class A(TQObject): - def __init__(self): - TQObject.__init__(self) - - def hello(self): - return tqApp.translate("A","Hello") - - - -Note that the code generated by pyuic uses -TQApplication.translate(). - - - - - -Signal and Slot Support - -A signal may be either a TQt signal (specified using -SIGNAL()) or a Python signal (specified using -PYSIGNAL()). - - - -A slot can be either a Python callable object, a TQt signal (specified using -SIGNAL()), a Python signal (specified using -PYSIGNAL()), or a TQt slot (specified using -SLOT()). - - - -You connect signals to slots (and other signals) as you would from C++. For -example: - - - -TQObject.connect(a,SIGNAL("TQtSig()"),pyFunction) -TQObject.connect(a,SIGNAL("TQtSig()"),pyClass.pyMethod) -TQObject.connect(a,SIGNAL("TQtSig()"),PYSIGNAL("PySig")) -TQObject.connect(a,SIGNAL("TQtSig()"),SLOT("TQtSlot()")) -TQObject.connect(a,PYSIGNAL("PySig"),pyFunction) -TQObject.connect(a,PYSIGNAL("PySig"),pyClass.pyMethod) -TQObject.connect(a,PYSIGNAL("PySig"),SIGNAL("TQtSig()")) -TQObject.connect(a,PYSIGNAL("PySig"),SLOT("TQtSlot()")) - - - -When a slot is a Python method that corresponds to a TQt slot then a signal can -be connected to either the Python method or the TQt slot. The following -connections achieve the same effect. - - - -sbar = TQScrollBar() -lcd = TQLCDNumber() - -TQObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd.display) -TQObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd,SLOT("display(int)")) - - - -The difference is that the second connection is made at the C++ level and is -more efficient. - - - -Disconnecting signals works in exactly the same way. - - - -Any instance of a class that is derived from the TQObject -class can emit a signal using the emit method. This takes -two arguments. The first is the Python or TQt signal, the second is a Python -tuple which are the arguments to the signal. For example: - - - -a.emit(SIGNAL("clicked()"),()) -a.emit(PYSIGNAL("pySig"),("Hello","World")) - - - -Note that when a slot is a Python callable object its reference count is not -increased. This means that a class instance can be deleted without having to -explicitly disconnect any signals connected to its methods. However, it also -means that using lambda expressions as slots will not work unless you keep a -separate reference to the expression to prevent it from being immediately -garbage collected. - - - -TQt allows a signal to be connected to a slot that requires fewer arguments than -the signal passes. The extra arguments are quietly discarded. Python slots -can be used in the same way. - - - - -Static Member Functions - -Static member functions are implemented as Python class functions. -For example the C++ static member function -TQObject::connect() is called from Python as -TQObject.connect() or self.connect() if -called from a sub-class of TQObject. - - - - -Enumerated Types - -Enumerated types are implemented as a set of simple variables corresponding to -the separate enumerated values. - - - -When using an enumerated value the name of the class (or a sub-class) in which -the enumerated type was defined in must be included. For example: - - - -TQt.SolidPattern -TQWidget.TabFocus -TQFrame.TabFocus - - - - -Module Reference Documentation - -The following sections should be used in conjunction with the normal class -documentation - only the differences specific to the Python bindings are -documented here. - - - -In these sections, Not yet implemented -implies that the feature can be easily implemented if needed. Not -implemented implies that the feature will not be implemented, either -because it cannot be or because it is not appropriate. - - - -If a class is described as being fully implemented then -all non-private member functions and all public class variables have been -implemented. - - - -If an operator has been implemented then it is stated explicitly. - - - -Classes that are not mentioned have not yet been implemented. - - - - -<Literal>qt</Literal> Module Reference -TQt Constants - -All constant values defined by TQt have equivalent constants defined to Python. - - -TQt (TQt v2+) - -TQt is fully implemented. - - -TQAccel - -TQAccel is fully implemented. - - -TQAction (TQt v2.2+) - -TQAction is fully implemented. - - - -TQActionGroup (TQt v2.2+) - -TQActionGroup is fully implemented. - - -TQApplication - - TQApplication - int &argc - char **argv - - -This takes one parameter which is a list of argument strings. Arguments -used by TQt are removed from the list. - - - - TQApplication - int &argc - char **argv - bool GUIenabled - - -This takes two parameters, the first of which is a list of argument strings. -Arguments used by TQt are removed from the list. - - - - TQApplication - int &argc - char **argv - Type type - - -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+) - - - - int exec - - - -This has been renamed to exec_loop in Python. - - -TQAssistantClient (TQt v3.1+) - -TQAssistantClient is fully implemented. - - -TQBitmap - -TQBitmap is fully implemented. - - -TQBrush - -TQBrush is fully implemented, including the Python -== and != operators. - - -TQButton - -TQButton is fully implemented. - - -TQButtonGroup - -TQButtonGroup is fully implemented. - - -TQByteArray - -A Python string can be used whenever a TQByteArray can be -used. A TQByteArray can be converted to a Python string -using the Python str() function. - - - - TQByteArray &assign - const char *data - uint size - - -Not implemented. - - - - char &at - uint i - - -Not yet implemented. - - - - int contains - const char &d - - -Not yet implemented. - - - - bool fill - const char &d - int size = -1 - - -Not yet implemented. - - - - int find - const char &d - uint i = 0 - - -Not yet implemented. - - - - void resetRawData - const char *data - uintsize - - -Not implemented. - - - - TQByteArray &setRawData - const char *data - uintsize - - -Not implemented. - - -TQCDEStyle (TQt v2+) - -TQCDEStyle is fully implemented. - - -TQCheckBox - -TQCheckBox is fully implemented. - - -TQClipboard - - void *data const - const char *format - - -Not yet implemented (TQt v1.x). - - - - void setData - const char *format - void * - - -Not yet implemented (TQt v1.x). - - -TQColor - -The Python == and != operators are -supported. - - - - void getHsv - int *h - int *s - int *v - - -This takes no parameters and returns the h, -s and v values as a tuple. - - - - void getRgb - int *r - int *g - int *b - - -This takes no parameters and returns the r, -g and b values as a tuple. - - - - void hsv - int *h - int *s - int *v - - -This takes no parameters and returns the h, -s and v values as a tuple. - - - - void rgb - int *r - int *g - int *b - - -This takes no parameters and returns the r, -g and b values as a tuple. - - -TQColorDialog (TQt v2+) - - static TQRgb getRgba - TQRgb initial - bool *ok - TQWidget *parent = 0 - const char *name = 0 - - -This takes the initial, parent and -name parameters and returns a tuple containing the -TQRgb result and the ok value. - - -TQColorGroup - -TQColorGroup is fully implemented. - - -TQComboBox - -TQComboBox is fully implemented. - - -TQCommonStyle (TQt v2+) - - virtual void getButtonShift - int &x - int &y - - -This takes no parameters and returns a tuple of the x and -y values. (TQt v2) - - - - virtual void tabbarMetrics - const TQTabBar *t - int &hframe - int &vframe - int &overlap - - -This takes only the t parameter and returns a tuple of the -hframe, vframe and -overlap values. (TQt v2) - - -TQCString (TQt v2+) - -A Python string can be used whenever a TQCString can be used. -A TQCString can be converted to a Python string using the -Python str() function. - - - - TQCString &sprintf - const char *format - ... - - -Not implemented. - - - - short toShort - bool *ok = 0 - - -This returns a tuple of the short result and the -ok value. - - - - ushort toUShort - bool *ok = 0 - - -This returns a tuple of the ushort result and the -ok value. - - - - int toInt - bool *ok = 0 - - -This returns a tuple of the int result and the -ok value. - - - - uint toUInt - bool *ok = 0 - - -This returns a tuple of the uint result and the -ok value. - - - - long toLong - bool *ok = 0 - - -This returns a tuple of the long result and the -ok value. - - - - ulong toULong - bool *ok = 0 - - -This returns a tuple of the ulong result and the -ok value. - - - - float toFloat - bool *ok = 0 - - -This returns a tuple of the float result and the -ok value. - - - - double toDouble - bool *ok = 0 - - -This returns a tuple of the double result and the -ok value. - - -TQCursor - -TQCursor is fully implemented. - - -TQDataStream - - TQDataStream &readBytes - const char *&s - uint &l - - -This takes no parameters. The TQDataStream result and the -data read are returned as a tuple. - - - - TQDataStream &readRawBytes - const char *s - uint l - - -This takes only the l parameter. The -TQDataStream result and the data read are returned as a -tuple. - - - - TQDataStream &writeBytes - const char *s - uint len - - -len is derived from s and not passed as a -parameter. - - - - TQDataStream &writeRawBytes - const char *s - uint len - - -len is derived from s and not passed as a -parameter. - - -TQDate - -The Python -==, !=, -<, <=, ->, >= -and __nonzero__ -operators are supported. - - - - int weekNumber - int *yearNum = 0 - - -This takes no parameters and returns the week number and the year number as a -tuple. (TQt v3.1+) - - - -TQDateTime - -TQDateTime is fully implemented, including the Python -==, !=, -<, <=, ->, >= -and __nonzero__ -operators. - - - -TQTime - -TQTime is fully implemented, including the Python -==, !=, -<, <=, ->, >= -and __nonzero__ -operators. - - -TQDateEdit (TQt v3+) - -TQDateEdit is fully implemented. - - - -TQTimeEdit (TQt v3+) - -TQTimeEdit is fully implemented. - - - -TQDateTimeEdit (TQt v3+) - -TQDateTimeEdit is fully implemented. - - -TQDesktopWidget (TQt v3+) - -TQDesktopWidget is fully implemented. - - -TQDial (TQt v2.2+) - -TQDial is fully implemented. - - -TQDialog - - int exec - - - -This has been renamed to exec_loop in Python. - - -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 -TQObject.deleteLater() or other techniques. - - -TQDir - -TQDir is fully implemented, including the Python -len, [] (for reading slices and -individual elements), ==, != and -in operators - - - -TQFileInfoList - -This class isn't implemented. Whenever a TQFileInfoList is -the return type of a function or the type of an argument, a Python list of -TQFileInfo instances is used instead. - - -TQDockArea (TQt v3+) - - bool hasDockWindow const - TQDockWindow *w - int *index = 0 - - -This takes the w parameter and returns the index of the -TQDockWIndow or -1 if the TQDockArea does not contain the TQDockWindow. - - -TQDockWindow (TQt v3+) - -TQDockWindow is fully implemented. - - -TQColorDrag (TQt v2.1+) - -TQColorDrag is fully implemented. - - - -TQDragObject - -TQDragObject is fully implemented. - - - -TQImageDrag - -TQImageDrag is fully implemented. - - - -TQStoredDrag - -TQStoredDrag is fully implemented. - - - -TQTextDrag - -TQTextDrag is fully implemented. - - - -TQUriDrag (TQt v2+) - -TQUriDrag is fully implemented. - - - -TQUrlDrag (TQt v1.x) - -TQUrlDrag is fully implemented. - - -TQDropSite - -TQDropSite is fully implemented. - - -TQErrorMessage (TQt v3+) - -TQErrorMessage is fully implemented. - - -TQEvent - -TQEvent is fully implemented. - - -Instances of TQEvents are automatically converted to the -correct sub-class. - - - -TQChildEvent - -TQChildEvent is fully implemented. - - - -TQCloseEvent - -TQCloseEvent is fully implemented. - - - -TQIconDragEvent (TQt v3.3+) - -TQIconDragEvent is fully implemented. - - - -TQContextMenuEvent (TQt v3+) - -TQContextMenuEvent is fully implemented. - - - -TQCustomEvent - -TQCustomEvent is fully implemented. Any Python object can be -passed as the event data and its reference count is increased. - - - -TQDragEnterEvent - -TQDragEnterEvent is fully implemented. - - - -TQDragLeaveEvent - -TQDragLeaveEvent is fully implemented. - - - -TQDragMoveEvent - -TQDragMoveEvent is fully implemented. - - - -TQDropEvent - -TQDropEvent is fully implemented. - - - -TQFocusEvent - -TQFocusEvent is fully implemented. - - - -TQHideEvent - -TQHideEvent is fully implemented. - - - -TQIMComposeEvent (TQt v3.1+) - -TQIMComposeEvent is fully implemented. - - - -TQIMEvent (TQt v3+) - -TQIMEvent is fully implemented. - - - -TQKeyEvent - -TQKeyEvent is fully implemented. - - - -TQMouseEvent - -TQMouseEvent is fully implemented. - - - -TQMoveEvent - -TQMoveEvent is fully implemented. - - - -TQPaintEvent - -TQPaintEvent is fully implemented. - - - -TQResizeEvent - -TQResizeEvent is fully implemented. - - - -TQShowEvent - -TQShowEvent is fully implemented. - - - -TQTabletEvent (TQt v3+) - -TQTabletEvent is fully implemented. - - - -TQTimerEvent - -TQTimerEvent is fully implemented. - - - -TQWheelEvent (TQt v2+) - -TQWheelEvent is fully implemented. - - -TQEventLoop (TQt v3.1+) - - virtual int exec - - - -This has been renamed to exec_loop in Python. - - -TQFile - - bool open - int m - FILE *f - - -Not implemented. - - - - TQ_LONG readBlock - char *data - TQ_ULONG len - - -This takes a single len parameter. The -data is returned if there was no error, otherwise -None is returned. - - - - TQ_LONG readLine - char *data - TQ_ULONG maxlen - - -This takes a single maxlen parameter. The -data is returned if there was no error, otherwise -None is returned. - - - - static void setDecodingFunction - EncoderFn f - - -Not yet implemented. (TQt v2+) - - - - static void setEncodingFunction - EncoderFn f - - -Not yet implemented. (TQt v2+) - - - - TQ_LONG writeBlock - const char *data - TQ_ULONG len - - -len is derived from data and not passed -as a parameter. - - -TQFileDialog - -TQFileDialog is fully implemented. - - - -TQFileIconProvider - -TQFileIconProvider is fully implemented. - - - -TQFilePreview - -TQFilePreview 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. - - -class FilePreview(TQFilePreview): - pass - -class Preview(TQLabel): - def __init__(self, parent=None): - TQLabel.__init__(self, parent) - self.preview = FilePreview() - self.preview.previewUrl = self.previewUrl - - -Note that TQFilePreview cannot be instantiated directly because it is abstract. -Thanks to Hans-Peter Jansen for this trick. - - -TQFileInfo - -TQFileInfo is fully implemented. - - -TQFont - -TQFont is fully implemented, including the Python -== and != operators. - - -TQFontDatabase (TQt v2.1+) - -TQFontDatabase is fully implemented. - - -TQFontDialog (TQt v2+) - - static TQFont getFont - bool *ok - const TQFont &def - TQWidget *parent = 0 - const char *name = 0 - - -This takes the def, parent and -name parameters and returns a tuple containing the -TQFont result and the ok value. - - - - static TQFont getFont - bool *ok - TQWidget *parent = 0 - const char *name = 0 - - -This takes the parent and name parameters -and returns a tuple containing the TQFont result and the -ok value. - - -TQFontInfo - -TQFontInfo is fully implemented. - - -TQFontMetrics - - TQRect boundingRect - int x - int y - int w - int h - int flags - const TQString &str - int len = -1 - int tabstops = 0 - int *tabarray = 0 - - -The tabarray parameter is a Python list of integers. - - - - TQSize size - int flags - const TQString &str - int len = -1 - int tabstops = 0 - int *tabarray = 0 - - -The tabarray parameter is a Python list of integers. - - -TQFrame - -TQFrame is fully implemented. - - -TQGManager (TQt v1.x) - -TQGManager is fully implemented. - - - -TQChain (TQt v1.x) - -TQChain is implemented as an opaque class. - - -TQGrid (TQt v2+) - -TQGrid is fully implemented. - - -TQGridView (TQt v3+) - -TQGridView is fully implemented. - - -TQGroupBox - -TQGroupBox is fully implemented. - - -TQHBox (TQt v2+) - -TQHBox is fully implemented. - - -TQHButtonGroup (TQt v2+) - -TQHButtonGroup is fully implemented. - - -TQHeader - -TQHeader is fully implemented. - - -TQHGroupBox (TQt v2+) - -TQHGroupBox is fully implemented. - - -TQIconSet - -TQIconSet is fully implemented. - - - -TQIconFactory (TQt v3.1+) - -TQIconFactory is fully implemented. - - -TQIconView (TQt v2.1+) - - TQIconViewItem *makeRowLayout - TQIconViewItem *begin - int &y - - -Not yet implemented. - - - -TQIconViewItem (TQt v2.1+) - -TQIconViewItem is fully implemented. - - - -TQIconDrag (TQt v2.1+) - -TQIconDrag is fully implemented. - - - -TQIconDragItem (TQt v2.1+) - -TQIconDragItem is fully implemented. - - -TQImage - -The Python == and != operators are -supported. - - - - TQImage - const char *xpm[] - - -This takes a list of strings as its parameter. - - - - TQImage - uchar *data - int w - int h - int depth - TQRgb *colorTable - int numColors - Endian bitOrder - - -The colorTable parameter is a list of TQRgb instances or -None. (TQt v2.1+) - - - - uchar *bits - - - -The return value is a sip.voidptr object which is only -useful if passed to another Python module. - - - - TQRgb *colorTable - - - -The return value is a sip.voidptr object which is only -useful if passed to another Python module. - - - - TQImage convertDepthWithPalette - int - TQRgb *p - int pc - int cf = 0 - - -Not implemented. - - - - uchar **jumpTable - - - -The return value is a sip.voidptr object which is only -useful if passed to another Python module. - - - - bool loadFromData - const uchar *buf - uint len - const char *format = 0 - ColorMode mode = Auto - - -len is derived from buf and not passed as -a parameter. - - - - uchar *scanLine - int i - - -The return value is a sip.voidptr object which is only -useful if passed to another Python module. - - - -TQImageIO - - static void defineIOHandler - const char *format - const char *header - const char *flags - image_io_handler read_image - image_io_handler write_image - - -Not implemented. - - - -TQImageTextKeyLang - -TQImageTextKeyLang is fully implemented. - - -TQInputDialog (TQt v2.1+) - - static TQString getText - const TQString &caption - const TQString &label - const TQString &text = TQString::null - bool *ok = 0 - TQWidget *parent = 0 - const char *name = 0 - - -The ok is not passed and the returned value is a tuple of -the TQString result and the ok flag. -(TQt v2.1 - v2.3.1) - - - - static TQString getText - const TQString &caption - const TQString &label - TQLineEdit::EchoModeecho - const TQString &text = TQString::null - bool *ok = 0 - TQWidget *parent = 0 - const char *name = 0 - - -The ok is not passed and the returned value is a tuple of -the TQString result and the ok flag. -(TQt v2.2 - v2.3.1) - - - - static TQString getText - const TQString &caption - const TQString &label - TQLineEdit::EchoModeecho = TQLineEdit::Normal - const TQString &text = TQString::null - bool *ok = 0 - TQWidget *parent = 0 - const char *name = 0 - - -The ok is not passed and the returned value is a tuple of -the TQString result and the ok flag. -(TQt v3+) - - - - static int getInteger - const TQString &caption - const TQString &label - int num = 0 - int from = -2147483647 - int to = 2147483647 - int step = 1 - bool *ok = 0 - TQWidget *parent = 0 - const char *name = 0 - - -The ok is not passed and the returned value is a tuple of -the int result and the ok flag. - - - - static double getDouble - const TQString &caption - const TQString &label - double num = 0 - double from = -2147483647 - double to = 2147483647 - int step = 1 - bool *ok = 0 - TQWidget *parent = 0 - const char *name = 0 - - -The ok is not passed and the returned value is a tuple of -the double result and the ok flag. - - - - static TQString getItem - const TQString &caption - const TQString &label - const TQStringList &list - int current = 0 - bool editable = TRUE - bool *ok = 0 - TQWidget *parent = 0 - const char *name = 0 - - -The ok is not passed and the returned value is a tuple of -the TQString result and the ok flag. - - -TQInterlaceStyle (TQt v2.3.1+) - - void scrollBarMetrics - const TQTabBar *sb - int &sliderMin - int &sliderMax - int &sliderLength - int &buttonDim - - -This takes only the sb parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. - - -TQIODevice - -TQIODevice is fully implemented. - - -TQKeySequence (TQt v3+) - -TQKeySequence is fully implemented including the operators -==, !=, TQString() and -int(). A TQString instance or a Python -integer may be used whenever a TQKeySequence can be used. - - -TQLabel - -TQLabel is fully implemented. - - -TQLayout - -TQLayout is fully implemented. - - - -TQBoxLayout - -TQBoxLayout is fully implemented. - - - -TQGLayoutIterator (TQt v2+) - -TQGLayoutIterator is fully implemented. - - - -TQGridLayout - - bool findWidget - TQWidget *w - int *row - int *col - - -This takes the w parameter and returns a tuple containing -the bool result, row and -col. (TQt v2+) - - - -TQHBoxLayout - -TQHBoxLayout is fully implemented. - - - -TQLayoutItem (TQt v2+) - -TQLayoutItem is fully implemented. - - - -TQLayoutIterator (TQt v2+) - - TQLayoutItem *next - - - -This is a wrapper around the TQLayoutIterator -++ operator. - - - -TQSpacerItem (TQt v2+) - -TQSpacerItem is fully implemented. - - - -TQVBoxLayout - -TQVBoxLayout is fully implemented. - - - -TQWidgetItem (TQt v2+) - -TQWidgetItem is fully implemented. - - -TQLCDNumber - -TQLCDNumber is fully implemented. - - -TQLibrary (TQt v3+) - -TQLibrary is fully implemented. - - -TQLineEdit - - int characterAt - int xpos - TQChar *chr - - -This takes only the xpos parameter and returns the int -result and the chr value as a tuple. (TQt v3+) - - - - void del - - - -This has been renamed delChar in Python. (TQt v2+) - - - - bool getSelection - int *start - int *end - - -This takes no parameters and returns the bool result and the -start and end values as a tuple. -(TQt v3+) - - -TQPtrList<type> (TQt v2) - -Types based on the TQPtrList template are automatically -converted to and from Python lists of the type. - - -TQListBox - - bool itemYPos - int index - int *yPos - - -This takes the index parameter and returns a tuple -containing the bool result and yPos. -(TQt v1.x) - - - -TQListBoxItem - -TQListBoxItem is fully implemented. - - - -TQListBoxPixmap - -TQListBoxPixmap is fully implemented. - - - -TQListBoxText - -TQListBoxText is fully implemented. - - -TQListView - -TQListView is fully implemented. - - -Note that to remove a child TQListViewItem you must first -call takeItem() and then del(). - - - -TQListViewItem - -TQListViewItem is fully implemented. - - -Note that to remove a child TQListViewItem you must first -call takeItem() and then del(). - - - -TQCheckListItem - -TQCheckListItem is fully implemented. - - - -TQListViewItemIterator (TQt v2+) - -TQListViewItemIterator is fully implemented. - - -TQLocale (TQt v3.3+) - - short toShort - bool *ok = 0 - - -This returns a tuple of the short result and the -ok value. - - - - ushort toUShort - bool *ok = 0 - - -This returns a tuple of the ushort result and the -ok value. - - - - int toInt - bool *ok = 0 - - -This returns a tuple of the int result and the -ok value. - - - - uint toUInt - bool *ok = 0 - - -This returns a tuple of the uint result and the -ok value. - - - - TQ_LONG toLong - bool *ok = 0 - - -This returns a tuple of the long result and the -ok value. - - - - TQ_ULONG toULong - bool *ok = 0 - - -This returns a tuple of the ulong result and the -ok value. - - - - float toFloat - bool *ok = 0 - - -This returns a tuple of the float result and the -ok value. - - - - double toDouble - bool *ok = 0 - - -This returns a tuple of the double result and the -ok value. - - -TQMainWindow - - TQTextStream &operator<< - TQTextStream & - const TQMainWindow & - - -This operator is fully implemented. (TQt v3+) - - - - TQTextStream &operator>> - TQTextStream & - TQMainWindow & - - -This operator is fully implemented. (TQt v3+) - - - - bool getLocation - TQToolBar *tb - ToolBarDock &dock - int &index - bool &nl - int &extraOffset - - -This takes only the tb parameter and returns a tuple of the -result, dock, index, -nl and extraOffset values. (TQt v2.1.0+) - - - - TQPtrList<TQToolBar> toolBars - ToolBarDock dock - - -This returns a list of TQToolBar instances. (TQt v2.1.0+) - - -TQMemArray<type> (TQt v3+) - -Types based on the TQMemArray template are automatically -converted to and from Python lists of the type. - - -TQMenuBar - -TQMenuBar is fully implemented. - - -TQMenuData - - TQMenuItem *findItem - int id - TQMenuData **parent - - -Not implemented. - - - -TQCustomMenuItem (TQt v2.1+) - -TQCustomMenuItem is fully implemented. - - - -TQMenuItem - -TQMenuItem is an internal TQt class. - - -TQMessageBox - -TQMessageBox is fully implemented. - - -TQMetaObject - - int numClassInfo const - bool super = FALSE - - -Not implemented. - - - - const TQClassInfo *classInfo const - bool super = FALSE - - -Not implemented. - - - -TQMetaProperty - -TQMetaProperty is fully implemented. - - -TQMimeSource (TQt v2+) - -TQMimeSource is fully implemented. - - - -TQMimeSourceFactory (TQt v2+) - -TQMimeSourceFactory is fully implemented. - - - -TQWindowsMime (TQt v3+) - -TQWindowsMime is fully implemented. - - -TQMotifPlusStyle (TQt v2.2+) - - void getButtonShift - int &x - int &y - - -This takes no parameters and returns a tuple of the x and -y values. (TQt v2) - - - - void scrollBarMetrics - const TQScrollBar *sb - int &sliderMin - int &sliderMax - int &sliderLength - int &buttonDim - - -This takes only the sb parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. -(TQt v2) - - -TQMotifStyle (TQt v2+) - - void scrollBarMetrics - const TQTabBar *sb - int &sliderMin - int &sliderMax - int &sliderLength - int &buttonDim - - -This takes only the sb parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. -(TQt v2) - - - - void tabbarMetrics - const TQTabBar *t - int &hframe - int &vframe - int &overlap - - -This takes only the t parameter and returns a tuple of the -hframe, vframe and -overlap values. (TQt v2) - - -TQMovie - - TQMovie - TQDataSource *src - int bufsize = 1024 - - -Not implemented. - - - - void pushData - const uchar *data - int length - - -length is derived from data and not -passed as a parameter. (TQt v2.2.0+) - - -TQMultiLineEdit - - void cursorPosition const - int *line - int *col - - -This takes no parameters and returns a tuple of the line and -col values. (TQt v1.x, TQt v2.x) - - - - virtual void del - - - -This has been renamed delChar in Python. (TQt v1.x, TQt v2.x) - - - - void getCursorPosition const - int *line - int *col - - -This takes no parameters and returns a tuple of the line and -col values. (TQt v1.x, TQt v2.x) - - - - bool getMarkedRegion - int *line1 - int *col1 - int *line2 - int *col2 - - -This takes no parameters and returns a tuple of the bool result and the -line1, col1, line2 and -col2 values. - - -TQMutex (TQt v2.2+) - -TQMutex is fully implemented. - - - -TQMutexLocker (TQt v3.1+) - -TQMutexLocker is fully implemented. - - -TQNetworkOperation (TQt v2.1+) - -TQNetworkOperation is fully implemented. - - - -TQNetworkProtocol (TQt v2.1+) - -TQNetworkProtocol is fully implemented. - - - -TQNetworkProtocolFactoryBase (TQt v2.1+) - -TQNetworkProtocolFactoryBase is fully implemented. - - -TQObject - - bool disconnect - const TQObject *receiver - const char *member = 0 - - -Not yet implemented. - - - - bool disconnect - const char *signal = 0 - const TQObject *receiver = 0 - const char *member = 0 - - -Not yet implemented. - - - - static bool disconnect - const TQObject *sender - const char *signal - const TQObject *receiver - const char *member - - -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 -signal and receiver parameters is not yet -supported. - - -TQObjectCleanupHandler (TQt v3+) - -TQObjectCleanupHandler is fully implemented. - - -TQObjectList - -This class isn't implemented. Whenever a TQObjectList is the -return type of a function or the type of an argument, a Python list of -TQObject instances is used instead. - - -TQPaintDeviceMetrics - -TQPaintDeviceMetrics is fully implemented. - - -TQPaintDevice - - virtual bool cmd - int - TQPainter * - TQPDevCmdParam * - - -Not implemented. - - -TQPainter - - TQRect boundingRect - int x - int y - int w - int h - int flags - const char *str - int len = -1 - char **intern = 0 - - -The intern parameter is not supported. - - - - TQRect boundingRect - const TQRect& - int flags - const char *str - int len = -1 - char **intern = 0 - - -The intern parameter is not supported. - - - - void drawText - int x - int y - int w - int h - int flags - const char *str - int len = -1 - TQRect *br = 0 - char **intern = 0 - - -The intern parameter is not supported. - - - - void drawText - const TQRect& - int flags - const char *str - int len = -1 - TQRect *br = 0 - char **intern = 0 - - -The intern parameter is not supported. - - - - void setTabArray - int *ta - - -This takes a single parameter which is a list of tab stops. - - - - int *tabArray - - - -This returns a list of tab stops. - - -TQPalette - -TQPalette is fully implemented, including the Python -== and != operators. - - -TQPixmap - - TQPixmap - const char *xpm[] - - -This takes a list of strings as its parameter. - - - - bool loadFromData - const uchar *buf - uint len - const char *format = 0 - ColorMode mode = Auto - - -len is derived from buf and not passed as -a parameter. - - - - bool loadFromData - const uchar *buf - uint len - const char *format - int conversion_flags - - -Not implemented. - - -TQPixmapCache (TQt v3+) - -TQPixmapCache is fully implemented. - - -TQPair<type,type> (TQt v3+) - -Types based on the TQPair template are automatically -converted to and from Python tuples of two elements. - - -TQPen - -TQPen is fully implemented, including the Python -== and != operators. - - -TQPicture - - const char *data - - - -Not implemented. - - - - void setData - const char *data - uint size - - -size is derived from data and not passed -as a parameter. - - -TQPlatinumStyle (TQt v2+) - - void scrollBarMetrics - const TQTabBar *sb - int &sliderMin - int &sliderMax - int &sliderLength - int &buttonDim - - -This takes only the sb parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. -(TQt v2) - - -TQPoint - -The Python -+, +=, --, -=, unary -, -*, *=, -/, /=, -==, != and __nonzero__ -operators are supported. - - - - TQCOORD &rx - - - -Not implemented. - - - - TQCOORD &ry - - - -Not implemented. - - -TQPointArray - - TQPointArray - int nPoints - const TQCOORD *points - - -This takes a single parameter which is a list of points. - - - - void point - uint i - int *x - int *y - - -This takes the single parameter i and returns the -x and y values as a tuple. - - - - bool putPoints - int index - int nPoints - const TQCOORD *points - - -This takes two parameters, index and a list of points. - - - - bool putPoints - int index - int nPoints - int firstx - int firsty - ... - - -Not implemented. - - - - bool setPoints - int nPoints - const TQCOORD *points - - -This takes a single parameter which is a list of points. - - - - bool setPoints - int nPoints - int firstx - int firsty - ... - - -Not implemented. - - -TQPopupMenu - - int exec - - - -This has been renamed exec_loop in Python. - - -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 -TQObject.deleteLater() or other techniques. - - - - int exec - const TQPoint &pos - int indexAtPoint = 0 - - -This has been renamed exec_loop in Python. - - -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 -TQObject.deleteLater() or other techniques. - - -TQPrintDialog (X11) - -TQPrintDialog is fully implemented. - - -TQPrinter - -TQPrinter is fully implemented. - - -TQProcess (TQt v3+) - -TQProcess is fully implemented. - - -TQProgressBar - -TQProgressBar is fully implemented. - - -TQProgressDialog - -TQProgressDialog is fully implemented. -value. - - -TQPtrList<type> (TQt v2+) - -Types based on the TQPtrList template are automatically -converted to and from Python lists of the type. - - -TQPushButton - -TQPushButton is fully implemented. - - -TQRadioButton - -TQRadioButton is fully implemented. - - -TQRangeControl - -TQRangeControl is fully implemented. - - -TQRect - -The Python -&, &=, -|, |=, -==, !=, in and -__nonzero__ operators are supported. - - - - void coords - int *x1 - int *y1 - int *x2 - int *y2 - - -This takes no parameters and returns a tuple containing the four values. - - - - void rect - int *x - int *y - int *w - int *h - - -This takes no parameters and returns a tuple containing the four values. - - - - TQCOORD &rBottom - - - -Not implemented. (TQt v2+) - - - - TQCOORD &rLeft - - - -Not implemented. (TQt v2+) - - - - TQCOORD &rRight - - - -Not implemented. (TQt v2+) - - - - TQCOORD &rTop - - - -Not implemented. (TQt v2+) - - -TQRegExp - -The Python == and != operators are -supported. - - - - int match - const char *str - int index = 0 - int *len = 0 - - -This takes str and index parameters and -returns a tuple of the int result and the -len value. (TQt v1.x) - - - - int match - const TQString &str - int index = 0 - int *len = 0 - - -This takes str and index parameters and -returns a tuple of the int result and the -len value. (TQt v2+) - - -TQRegion - -The Python -|, |=, -+, +=, -&, &=, --, -=, -^, ^=, -==, !=, in and -__nonzero__ operators are supported. - - - - TQArray<TQRect> rects - - - -Not implemented. - - - - void setRects - TQRect *rects - int num - - -Not yet implemented. (TQt v2.2+) - - -TQScrollBar - -TQScrollBar is fully implemented. - - -TQScrollView - - void contentsToViewport - int x - int y - int &vx - int &vy - - -This takes the x and y parameters and -returns a tuple containing the vx and vy -values. (TQt v2+) - - - - void viewportToContents - int vx - int vy - int &x - int &y - - -This takes the vx and vy parameters and -returns a tuple containing the x and y -values. (TQt v2+) - - -TQSemaphore (TQt v2.2+) - -TQSemaphore is fully implemented. The += -and -= operators have also been implemented, but require -Python v2.0 or later. - - -TQSemiModal (TQt v1, v2) - -TQSemiModal is fully implemented. - - -TQSessionManager (TQt v2+) - -TQSessionManager is fully implemented. - - -TQSettings (TQt v3+) - - bool readBoolEntry - const TQString &key - bool def = 0 - bool *ok = 0 - - -The ok is not passed and the returned value is a tuple of -the bool result and the ok flag. - - - -double readDoubleEntry - const TQString &key - double def = 0 - bool *ok = 0 - - -The ok is not passed and the returned value is a tuple of -the double result and the ok flag. - - - -TQString readEntry - const TQString &key - const TQString &def = TQString::null - bool *ok = 0 - - -The ok is not passed and the returned value is a tuple of -the TQString result and the ok flag. - - - -TQStringList readListEntry - const TQString &key - bool *ok = 0 - - -The ok is not passed and the returned value is a tuple of -the TQStringList result and the ok flag. - - - -TQStringList readListEntry - const TQString &key - const TQChar &separator - bool *ok = 0 - - -The ok is not passed and the returned value is a tuple of -the TQStringList result and the ok flag. - - - -int readNumEntry - const TQString &key - int def = 0 - bool *ok = 0 - - -The ok is not passed and the returned value is a tuple of -the int result and the ok flag. - - - - bool writeEntry - const TQString &key - bool value - - -Not implemented. - - -TQSGIStyle (TQt v2.2+) - - void scrollBarMetrics - const TQScrollBar *sb - int &sliderMin - int &sliderMax - int &sliderLength - int &buttonDim - - -This takes only the sb parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. -(TQt v2) - - -TQSignalMapper - -TQSignalMapper is fully implemented. - - -TQSimpleRichText (TQt v2+) - -TQSimpleRichText is fully implemented. - - -TQSize - -The Python -+, +=, --, -=, -*, *=, -/, /=, -==, != and __nonzero__ -operators are supported. - - - - TQCOORD &rheight - - - -Not implemented. - - - - TQCOORD &rwidth - - - -Not implemented. - - -TQSizeGrip (TQt v2+) - -TQSizeGrip is fully implemented. - - -TQSizePolicy (TQt v2+) - -TQSizePolicy is fully implemented. - - -TQSlider - -TQSlider is fully implemented. - - -TQSocketNotifier - -TQSocketNotifier is fully implemented. - - -TQSound (TQt v2.2+) - -TQSound is fully implemented. - - -TQSpinBox - - virtual int mapTextToValue - bool *ok - - -This returns a tuple of the int result and the modified -ok value. - - -TQSplashScreen (TQt v3.2.0+) - -TQSplashScreen is fully implemented. - - -TQSplitter - - void getRange - int id - int *min - int *max - - -This takes the id parameter and returns the -min and max values as a tuple. (TQt v2+) - - -TQStatusBar - -TQStatusBar is fully implemented. - - -TQChar (TQt v2+) - - uchar &cell const - - - -Not implemented. - - - - uchar &row const - - - -Not implemented. - - - -TQString - -A Python string object (or Unicode object) can be used whenever a -TQString can be used. A TQString can be -converted to a Python string object using the Python str() -function, and to a Python Unicode object using the Python -unicode() function. - - - -The Python +, +=, *, -*=, len, [] -(for reading slices and individual characters), in and -comparison operators are supported. - - - - TQCharRef at - uint i - - -Not yet implemented. (TQt v2+) - - - - TQChar constref const - uint i - - -Not yet implemented. (TQt v2+) - - - - TQChar &ref - uint i - - -Not yet implemented. (TQt v2+) - - - - TQString &setUnicodeCodes - const ushort *unicode_as_shorts - uint len - - -Not yet implemented. (TQt v2.1+) - - - - TQString &sprintf - const char *format - ... - - -Not implemented. - - - - short toShort - bool *ok = 0 - - -This returns a tuple of the short result and the -ok value. - - - - ushort toUShort - bool *ok = 0 - - -This returns a tuple of the ushort result and the -ok value. - - - - int toInt - bool *ok = 0 - - -This returns a tuple of the int result and the -ok value. - - - - uint toUInt - bool *ok = 0 - - -This returns a tuple of the uint result and the -ok value. - - - - long toLong - bool *ok = 0 - - -This returns a tuple of the long result and the -ok value. - - - - ulong toULong - bool *ok = 0 - - -This returns a tuple of the ulong result and the -ok value. - - - - float toFloat - bool *ok = 0 - - -This returns a tuple of the float result and the -ok value. - - - - double toDouble - bool *ok = 0 - - -This returns a tuple of the double result and the -ok value. - - -TQStringList (TQt v2+) - -The Python len, [] (for both reading and -writing slices and individual elements), del (for deleting -slices and individual elements), +, +=, -*, *=, ==, -!= and in operators are supported. - - - - Iterator append - const TQString &x - - -This does not return a value. - - - - Iterator prepend - const TQString &x - - -This does not return a value. - - -TQStrList - -This class isn't implemented. Whenever a TQStrList is the -return type of a function or the type of an argument, a Python list of strings -is used instead. - - -TQStyle (TQt v2+) - - virtual void getButtonShift - int &x - int &y - - -This takes no parameters and returns a tuple of the x and -y values. (TQt v2) - - - - virtual void scrollBarMetrics - const TQScrollBar *b - int &sliderMin - int &sliderMax - int &sliderLength - int &buttonDim - - -Thus takes only the b parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. -(TQt v2) - - - - virtual void tabbarMetrics - const TQTabBar *t - int &hframe - int &vframe - int &overlap - - -This takes only the t parameter and returns a tuple of the -hframe, vframe and -overlap values. (TQt v2) - - - -TQStyleOption (TQt v3+) - -TQStyleOption is fully implemented. - - -TQStyleSheet (TQt v2+) - -TQStyleSheet is fully implemented. - - - -TQStyleSheetItem (TQt v2+) - -TQStyleSheetItem is fully implemented. - - -TQSyntaxHighlighter (TQt v3.1+) - -TQSyntaxHighlighter is fully implemented. - - -TQTab - -TQTab is fully implemented. - - - -TQTabBar - - TQPtrList<TQTab> tabList - - - -This returns a list of TQTab instances. - - -TQTabDialog - -TQTabDialog is fully implemented. - - -TQTableView (TQt 1.x, TQt 2.x) - - bool colXPos - int col - int *xPos - - -This takes the col parameter and returns a tuple containing -the bool result and xPos. - - - - bool rowYPos - int row - int *yPos - - -This takes the row parameter and returns a tuple containing -the bool result and yPos. - - -TQTabWidget (TQt v2+) - -TQTabWidget is fully implemented. - - -TQTextBrowser (TQt v2+) - -TQTextBrowser is fully implemented. - - -TQTextCodec (TQt v2+) - - virtual TQCString fromUnicode - const TQString &uc - int &lenInOut - - -The returned value is a tuple of the TQCString result and the -updated lenInOut. - - - -TQTextDecoder (TQt v2+) - -TQTextDecoder is fully implemented. - - - -TQTextEncoder (TQt v2+) - - virtual TQCString fromUnicode = 0 - const TQString &uc - int &lenInOut - - -The returned value is a tuple of the TQCString result and the -updated lenInOut. - - -TQTextEdit (TQt v3+) - -int charAt - const TQPoint &pos - int *para = 0 - - -This takes only the pos parameter and returns a tuple of the -value returned via the para pointer and the int result. - - - - void del - - - -This has been renamed delChar in Python. - - - -virtual bool find - const TQString &expr - bool cs - bool wo - bool forward = TRUE - int *para = 0 - int *index = 0 - - -If the para and index 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 -para and index is returned. - - - -void getCursorPosition - int *para - int *index - - -This takes no parameters and returns a tuple of the values returned via the -para and index pointers. - - - -void getSelection - int *paraFrom - int *indexFrom - int *paraTo - int *indexTo - int selNum = 0 - - -This takes only the selNum parameter and returns a tuple of -the paraFrom, indexFrom, -paraTo and indexTo values. - - -TQTextStream - - TQTextStream - FILE *fp - int mode - - -Not implemented. - - - - TQTextStream &readRawBytes - char *buf - uint len - - -Not yet implemented. - - - - TQTextStream &writeRawBytes - const char *buf - uint len - - -Not yet implemented. - - - -TQTextIStream (TQt v2+) - - TQTextIStream - FILE *fp - int mode - - -Not implemented. - - - -TQTextOStream (TQt v2+) - - TQTextOStream - FILE *fp - int mode - - -Not implemented. - - -TQTextView (TQt v2+) - -TQTextView is fully implemented. - - -TQThread (TQt v2.2+) - -TQThread is fully implemented. - - -TQTimer - -TQTimer is fully implemented. - - -TQToolBar - -TQToolBar is fully implemented. - - -TQToolBox (TQt v3.2.0+) - -TQToolBox is fully implemented. - - -TQToolButton - -TQToolButton is fully implemented. - - -TQToolTip - -TQToolTip is fully implemented. - - - -TQToolTipGroup - -TQToolTipGroup is fully implemented. - - -TQTranslator (TQt v2+) - -TQTranslator is fully implemented. - - - -TQTranslatorMessage (TQt v2.2+) - -TQTranslatorMessage is fully implemented. - - -TQUrl (TQt v2.1+) - -TQUrl is fully implemented, including the -TQString(), == and != -operators. - - -TQUrlInfo (TQt v2.1+) - -TQUrlInfo is fully implemented. - - -TQUrlOperator (TQt v2.1+) - - virtual bool isDir - bool *ok - - -This returns a tuple of the bool result and the -ok value. - - -TQUuid (TQt v3.0+) - -TQUuid is fully implemented. - - -TQValidator - - virtual State validate - TQString& input - int& pos - - -The returned value is a tuple of the State result and the -updated pos. - - - -TQDoubleValidator - - State validate - TQString& input - int& pos - - -The returned value is a tuple of the State result and the -updated pos. - - - -TQIntValidator - - State validate - TQString& input - int& pos - - -The returned value is a tuple of the State result and the -updated pos. - - - -TQRegExpValidator (TQt v3+) - - virtual State validate - TQString& input - int& pos - - -The returned value is a tuple of the State result and the -updated pos. - - -TQValueList<type> (TQt v2+) - -Types based on the TQValueList template are automatically -converted to and from Python lists of the type. - - -TQVariant (TQt v2.1+) - - TQVariant - const char *val - - -Not implemented. - - - - TQVariant - const TQBitArray &val - - -Not yet implemented. (TQt v3+) - - - - TQVariant - const TQValueList<TQVariant> &val - - -Not yet implemented. - - - - TQVariant - const TQMap<TQString,TQVariant> &val - - -Not yet implemented. - - - - TQBitArray &asBitArray - - - -Not yet implemented. (TQt v3+) - - - - bool &asBool - - - -Not implemented. - - - - double &asDouble - - - -Not implemented. - - - - int &asInt - - - -Not implemented. - - - - TQValueList<TQVariant> &asList - - - -Not implemented. - - - - TQMap<TQString,TQVariant> &asMap - - - -Not implemented. - - - - uint &asUInt - - - -Not implemented. - - - - TQValueListConstIterator<TQVariant>listBegin const - - - -Not implemented. - - - - TQValueListConstIterator<TQVariant>listEnd const - - - -Not implemented. - - - - TQMapConstIterator<TQString,TQVariant>mapBegin const - - - -Not implemented. - - - - TQMapConstIterator<TQString,TQVariant>mapEnd const - - - -Not implemented. - - - - TQMapConstIterator<TQString,TQVariant>mapFind const - const TQString &key - - -Not implemented. - - - - TQValueListConstIterator<TQString>stringListBegin const - - - -Not implemented. - - - - TQValueListConstIterator<TQString>stringListEnd const - - - -Not implemented. - - - - const TQBitArray toBitArray const - - - -Not yet implemented. (TQt v3+) - - - - const TQValueList<TQVariant>toList const - - - -Not yet implemented. - - - - const TQMap<TQString,TQVariant>toMap const - - - -Not yet implemented. - - -TQVBox (TQt v2+) - -TQVBox is fully implemented. - - -TQVButtonGroup (TQt v2+) - -TQVButtonGroup is fully implemented. - - -TQVGroupBox (TQt v2+) - -TQVGroupBox is fully implemented. - - -TQWaitCondition (TQt v2.2+) - -TQWaitCondition is fully implemented. - - -TQWhatsThis - -TQWhatsThis is fully implemented. - - -TQWidget - - TQWExtra *extraData - - - -Not implemented. - - - - TQFocusData *focusData - - - -Not implemented. - - - - void lower - - - -This has been renamed to lowerW in Python. - - - - void raise - - - -This has been renamed to raiseW in Python. - - -TQWidgetList - -This class isn't implemented. Whenever a TQWidgetList is the -return type of a function or the type of an argument, a Python list of -instances is used instead. - - -TQWidgetStack - -TQWidgetStack is fully implemented. - - -TQWindow - -TQWindow is fully implemented (TQt v1.x). - - -TQWindowsStyle (TQt v2+) - - void getButtonShift - int &x - int &y - - -This takes no parameters and returns a tuple of the x and -y values. (TQt v2) - - - - void scrollBarMetrics - const TQTabBar *sb - int &sliderMin - int &sliderMax - int &sliderLength - int &buttonDim - - -This takes only the sb parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. -(TQt v2) - - - - void tabbarMetrics - const TQTabBar *t - int &hframe - int &vframe - int &overlap - - -This takes only the t parameter and returns a tuple of the -hframe, vframe and -overlap values. (TQt v2) - - -TQWindowsXPStyle (TQt v3.0.1+, Windows) - -TQWindowsXPStyle is fully implemented. - - -TQWizard (TQt v2+) - -TQWizard is fully implemented. - - -TQWMatrix - -The Python ==, != and -*= operators are supported. - - - - TQWMatrix invert const - bool *invertible = 0 - - -This takes no parameters and returns a tuple of the TQWMatrix -result and the invertible value. - - - - void map const - int x - int y - int *tx - int *ty - - -This takes the x and y parameters and -returns a tuple containing the tx and ty -values. - - - - void map const - float x - float y - float *tx - float *ty - - -This takes the x and y parameters and -returns a tuple containing the tx and ty -values. (TQt v1.x) - - - - void map const - double x - double y - double *tx - double *ty - - -This takes the x and y parameters and -returns a tuple containing the tx and ty -values. (TQt v2+) - - -TQWorkspace (TQt v2.1+) - -TQWorkspace is fully implemented. - - - -<Literal>qtaxcontainer</Literal> Module Reference -TQAxBase (Windows, TQt v3+) - - TQAxObject - IUnknown *iface = 0 - - -Not implemented. - - - - long queryInterface - const TQUuid &uuid - void **iface - - -Not implemented. - - - - PropertyBag propertyBag const - - - -Not implemented. - - - - void setPropertyBag - const PropertyBag &bag - - -Not implemented. - - - - unsigned long registerWeakActiveObject - const TQString &guid - - -This is a utility method provided by PyTQt to make it easier to use -Mark Hammond's win32com module to manipulate objects -created by the qtaxcontainer module. - - -The RegisterActiveObject() COM function is called to -register the TQAxBase instance as a weak object with the -guid GUID. The revoke handle is returned. - - - - static void revokeActiveObject - unsigned long rhandle - - -This is a wrapper around the RevokeActiveObject() COM -function and is called to revoke the object registered using -registerWeakActiveObject(). rhandle is -the revoke handle returned by registerWeakActiveObject(). - - -TQAxObject (Windows, TQt v3+) - - TQAxObject - IUnknown *iface - TQObject *parent = 0 - const char *name = 0 - - -Not implemented. - - -TQAxWidget (Windows, TQt v3+) - - TQAxWidget - IUnknown *iface - TQWidget *parent = 0 - const char *name = 0 - - -Not implemented. - - - -<Literal>qtcanvas</Literal> Module Reference -TQCanvas (TQt v2.2+) - -TQCanvas is fully implemented. - - - -TQCanvasEllipse (TQt v2.2+) - -TQCanvasEllipse is fully implemented. - - - -TQCanvasItem (TQt v2.2+) - -TQCanvasItem is fully implemented. - - - -TQCanvasItemList (TQt v2.2+) - -This class isn't implemented. Whenever a TQCanvasItemList is -the return type of a function or the type of an argument, a Python list of -TQCanvasItem instances is used instead. - - - -TQCanvasLine (TQt v2.2+) - -TQCanvasLine is fully implemented. - - - -TQCanvasPixmap (TQt v2.2+) - -TQCanvasPixmap is fully implemented. - - - -TQCanvasPixmapArray (TQt v2.2+) - - TQPixmapArray - TQPtrList<TQPixmap> pixmaps - TQPtrList<TQPoint> hotspots - - -The pixmaps argument is a Python list of TQPixmap instances, -and the hotspots argument is a Python list of TQPoint -instances. (TQt v2.2.0 - TQt v2.3.1) - - - - TQPixmapArray - TQValueList<TQPixmap> pixmaps - TQPointArray hotspots = TQPointArray() - - -The pixmaps argument is a Python list of TQPixmap instances. -(TQt v3+) - - - -TQCanvasPolygon (TQt v2.2+) - -TQCanvasPolygon is fully implemented. - - - -TQCanvasPolygonalItem (TQt v2.2+) - -TQCanvasPolygonalItem is fully implemented. - - - -TQCanvasRectangle (TQt v2.2+) - -TQCanvasRectangle is fully implemented. - - - -TQCanvasSpline (TQt v3.0+) - -TQCanvasSpline is fully implemented. - - - -TQCanvasSprite (TQt v2.2+) - -TQCanvasSprite is fully implemented. - - - -TQCanvasText (TQt v2.2+) - -TQCanvasText is fully implemented. - - - -TQCanvasView (TQt v2.2+) - -TQCanvasView is fully implemented. - - - -<Literal>qtext</Literal> Module Reference - -TQextScintilla - - void getCursorPosition - int *line - int *index - - -This takes no parameters and returns a tuple of the values returned by the -line and index pointers. - - - - void getSelection - int *lineFrom - int *indexFrom - int *lineTo - int *indexTo - - -This takes no parameters and returns a tuple of the values returned by the -lineFrom, indexFrom, -lineTo and indexTo pointers. - - - -TQextScintillaAPIs - -TQextScintillaAPIs is fully implemented. - - - -TQextScintillaBase - -TQextScintillaBase is fully implemented. - - - -TQextScintillaCommand - -TQextScintillaCommand is fully implemented. - - - -TQextScintillaCommandSet - -TQextScintillaCommandSet is fully implemented. - - - -TQextScintillaDocument - -TQextScintillaDocument is fully implemented. - - - -TQextScintillaLexer - -TQextScintillaLexer is fully implemented. - - - -TQextScintillaLexerBash (TQScintilla v1.4+) - -TQextScintillaLexerBash is fully implemented. - - - -TQextScintillaLexerBatch (TQScintilla v1.6+) - -TQextScintillaLexerBatch is fully implemented. - - - -TQextScintillaLexerCPP - -TQextScintillaLexerCPP is fully implemented. - - - -TQextScintillaLexerCSharp - -TQextScintillaLexerCSharp is fully implemented. - - - -TQextScintillaLexerCSS (TQScintilla v1.6+) - -TQextScintillaLexerCSS is fully implemented. - - - -TQextScintillaLexerDiff (TQScintilla v1.6+) - -TQextScintillaLexerDiff is fully implemented. - - - -TQextScintillaLexerHTML (TQScintilla v1.1+) - -TQextScintillaLexerHTML is fully implemented. - - - -TQextScintillaLexerIDL - -TQextScintillaLexerIDL is fully implemented. - - - -TQextScintillaLexerJava - -TQextScintillaLexerJava is fully implemented. - - - -TQextScintillaLexerJavaScript - -TQextScintillaLexerJavaScript is fully implemented. - - - -TQextScintillaLexerLua (TQScintilla v1.5+) - -TQextScintillaLexerLua is fully implemented. - - - -TQextScintillaLexerMakefile (TQScintilla v1.6+) - -TQextScintillaLexerMakefile is fully implemented. - - - -TQextScintillaLexerPerl - -TQextScintillaLexerPerl is fully implemented. - - - -TQextScintillaLexerPOV (TQScintilla v1.6+) - -TQextScintillaLexerPOV is fully implemented. - - - -TQextScintillaLexerProperties (TQScintilla v1.6+) - -TQextScintillaLexerProperties is fully implemented. - - - -TQextScintillaLexerPython - -TQextScintillaLexerPython is fully implemented. - - - -TQextScintillaLexerRuby (TQScintilla v1.5+) - -TQextScintillaLexerRuby is fully implemented. - - - -TQextScintillaLexerSQL (TQScintilla v1.1+) - -TQextScintillaLexerSQL is fully implemented. - - - -TQextScintillaLexerTeX (TQScintilla v1.6+) - -TQextScintillaLexerTeX is fully implemented. - - - -TQextScintillaMacro - -TQextScintillaMacro is fully implemented. - - - -TQextScintillaPrinter - -TQextScintillaPrinter is fully implemented. - - - -<Literal>qtgl</Literal> Module Reference -TQGL - -TQGL is fully implemented. - - - -TQGLContext - -TQGLContext is fully implemented. - - - -TQGLFormat - -TQGLFormat is fully implemented. - - - -TQGLWidget - -TQGLWidget is fully implemented. - - -TQGLColormap (TQt v3.0+) - - void setEntries - int count - const TQRgb *colors - int base = 0 - - -Not yet implemented. - - - -<Literal>qtnetwork</Literal> Module Reference -TQDns (TQt v2.2+) - -TQDns is fully implemented. - - -TQFtp (TQt v2.2+) - - TQ_LONG readBlock - char *data - TQ_ULONG maxlen - - -This takes a single maxlen parameter. The -data is returned if there was no error, otherwise -None is returned. - - -TQHostAddress (TQt v2.2+) - - TQHostAddress - TQ_UINT8 *ip6Addr - - -Not yet implemented. - - - - TQHostAddress - const Q_IPV6ADDR &ip6Addr - - -Not yet implemented. - - - - void setAddress - TQ_UINT8 *ip6Addr - - -Not yet implemented. - - - - Q_IPV6ADDR toIPv6Address const - - - -Not yet implemented. - - -TQHttp (TQt v3+) - - TQ_LONG readBlock - char *data - TQ_ULONG maxlen - - -This takes a single maxlen parameter. The -data is returned if there was no error, otherwise -None is returned. - - - -TQHttpHeader (TQt v3.1+) - -TQHttpHeader is fully implemented. - - - -TQHttpRequestHeader (TQt v3.1+) - -TQHttpRequestHeader is fully implemented. - - - -TQHttpResponseHeader (TQt v3.1+) - -TQHttpResponseHeader is fully implemented. - - -TQLocalFs (TQt v2.1+) - -TQLocalFs is fully implemented. - - -TQServerSocket (TQt v2.2+) - -TQServerSocket is fully implemented. - - -TQSocket (TQt v2.2+) - - TQ_LONG readBlock - char *data - TQ_ULONG len - - -This takes a single len parameter. The -data is returned if there was no error, otherwise -Py_None is returned. - - - - TQ_LONG readLine - char *data - TQ_ULONG maxlen - - -This takes a single maxlen parameter. The -data is returned if there was no error, otherwise -Py_None is returned. - - - - TQ_LONG writeBlock - const char *data - TQ_ULONG len - - -len is derived from data and not passed -as a parameter. - - -TQSocketDevice (TQt v2.2+) - - TQ_LONG readBlock - char *data - TQ_ULONG len - - -This takes a single len parameter. The -data is returned if there was no error, otherwise -None is returned. - - - - TQ_LONG writeBlock - const char *data - TQ_ULONG len - - -len is derived from data and not passed -as a parameter. - - - -<Literal>qtpe</Literal> Module Reference - -TQPEApplication - - TQApplication - int& argc - char **argv - Type type - - -This takes two parameters, the first of which is a list of argument strings. -Arguments used by TQt are removed from the list. - - - - int exec - - - -This has been renamed to exec_loop in Python. - - - -AppLnk - - virtual TQString exec const - - - -This has been renamed to exec_property in Python. - - - -AppLnkSet - -AppLnkSet is fully implemented. - - - -Config - -Config is fully implemented. - - - -DateFormat - -DateFormat is fully implemented. - - - -DocLnk - - TQString exec const - - - -This has been renamed to exec_property in Python. - - - -DocLnkSet - -DocLnkSet is fully implemented. - - - -FileManager - -FileManager is fully implemented. - - - -FileSelector - -FileSelector is fully implemented. - - - -FileSelectorItem - -FileSelectorItem is fully implemented. - - - -FontDatabase - -FontDatabase is fully implemented. - - - -Global - - static void setBuiltinCommands - Command * - - -Not implemented. - - - -MenuButton - -MenuButton is fully implemented. - - - -TQCopEnvelope - -TQCopEnvelope is fully implemented. - - - -TQDawg - -TQDawg is fully implemented. - - - -TQPEMenuBar - -TQPEMenuBar is fully implemented. - - - -TQPEToolBar - -TQPEToolBar is fully implemented. - - - -Resource - -Resource is fully implemented. - - - - -<Literal>qtsql</Literal> Module Reference -TQDataBrowser (TQt v3+) - - virtual void del - - - -This has been renamed delOnCursor in Python. - - -TQDataTable (TQt v3+) - -TQDataTable is fully implemented. - - -TQDataView (TQt v3+) - -TQDataView is fully implemented. - - -TQEditorFactory (TQt v3+) - -TQEditorFactory is fully implemented. - - -TQSql (TQt v3+) - -TQSql is fully implemented. - - -TQSqlCursor (TQt v3+) - - virtual int del - bool invalidate = TRUE - - -This has been renamed delRecords in Python. - - - - virtual int del - const TQString &filter - bool invalidate = TRUE - - -This has been renamed delRecords in Python. - - - - bool exec - const TQString &query - - -This has been renamed execQuery in Python. - - -TQSqlDatabase (TQt v3+) - - TQSqlQuery exec - const TQString &query = TQString::null - - -This has been renamed execStatement in Python. - - -TQSqlDriver (TQt v3+) - -TQSqlDriver is fully implemented. - - -TQSqlEditorFactory (TQt v3+) - -TQSqlEditorFactory is fully implemented. - - -TQSqlError (TQt v3+) - -TQSqlError is fully implemented. - - -TQSqlField (TQt v3+) - -TQSqlField is fully implemented. - - - -TQSqlFieldInfo (TQt v3+) - -TQSqlFieldInfo is fully implemented. - - -TQSqlForm (TQt v3+) - -TQSqlForm is fully implemented. - - -TQSqlIndex (TQt v3+) - -TQSqlIndex is fully implemented. - - -TQSqlPropertyMap (TQt v3+) - -TQSqlPropertyMap is fully implemented. However, because PyTQt -does not allow new properties to be defined, it is not possible to implement -custom editor widgets in Python and add them to a property map. These will -simply be ignored. - - - -This problem may be addressed in a future release of PyTQt. - - -TQSqlQuery (TQt v3+) - - TQMap<TQString,TQVariant> boundValues const - - - -Not yet implemented. (TQt v3.2.0+) - - - - virtual bool exec - const TQString &query - - -This has been renamed execQuery in Python. - - - - bool exec - - - -This has been renamed execQuery in Python. (TQt v3.1+) - - -TQSqlRecord (TQt v3+) - -TQSqlRecord is fully implemented. - - - -TQSqlRecordInfo (TQt v3+) - -TQSqlRecordInfo is implemented as a Python list of -TQSqlFieldInfo instances. - - -TQSqlResult (TQt v3+) - -TQSqlResult is fully implemented. - - -TQSqlSelectCursor (TQt v3.2.0+) - - int del - bool invalidate = TRUE - - -This has been renamed delRecords in Python. - - - - bool exec - const TQString &query - - -This has been renamed execQuery in Python. - - - -<Literal>qttable</Literal> Module Reference -TQTable (TQt v2.2+) - -TQTable is fully implemented. - - - -TQTableItem (TQt v2.2+) - -TQTableItem is fully implemented. - - - -TQCheckTableItem (TQt v3+) - -TQCheckTableItem is fully implemented. - - - -TQComboTableItem (TQt v3+) - -TQComboTableItem is fully implemented. - - - -TQTableSelection (TQt v2.2+) - -TQTableSelection is fully implemented. - - - -<Literal>qtui</Literal> Module Reference -TQWidgetFactory (TQt v3+) - -TQWidgetFactory is fully implemented. - - - -<Literal>qtxml</Literal> Module Reference -TQDomImplementation (TQt v2.2+) - -TQDomImplementation is fully implemented. - - - -TQDomNode (TQt v2.2+) - -TQDomNode is fully implemented, including the Python -== and != operators. - - - -TQDomNodeList (TQt v2.2+) - -TQDomNodeList is fully implemented. - - - -TQDomDocument (TQt v2.2+) - - bool setContent - const TQCString &buffer - bool namespaceProcessing - TQString *errorMsg = 0 - int *errorLine = 0 - int *errorColumn = 0 - - -This takes the buffer and -namespaceProcessing parameters and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+) - - - - bool setContent - const TQByteArray &buffer - bool namespaceProcessing - TQString *errorMsg = 0 - int *errorLine = 0 - int *errorColumn = 0 - - -This takes the buffer and -namespaceProcessing parameters and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+) - - - - bool setContent - const TQString &text - bool namespaceProcessing - TQString *errorMsg = 0 - int *errorLine = 0 - int *errorColumn = 0 - - -This takes the text and -namespaceProcessing parameters and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+) - - - - bool setContent - const TQIODevice *dev - bool namespaceProcessing - TQString *errorMsg = 0 - int *errorLine = 0 - int *errorColumn = 0 - - -This takes the dev and -namespaceProcessing parameters and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+) - - - - bool setContent - const TQCString &buffer - TQString *errorMsg = 0 - int *errorLine = 0 - int *errorColumn = 0 - - -This takes the buffer parameter only and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+) - - - - bool setContent - const TQByteArray &buffer - TQString *errorMsg = 0 - int *errorLine = 0 - int *errorColumn = 0 - - -This takes the buffer parameter only and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+) - - - - bool setContent - const TQString &text - TQString *errorMsg = 0 - int *errorLine = 0 - int *errorColumn = 0 - - -This takes the text parameter only and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+) - - - - bool setContent - const TQIODevice *dev - TQString *errorMsg = 0 - int *errorLine = 0 - int *errorColumn = 0 - - -This takes the dev parameter only and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+) - - - - bool setContent - TQXmlInputSource *source - TQXmlReader *reader - TQString *errorMsg = 0 - int *errorLine = 0 - int *errorColumn = 0 - - -Not yet implemented. (TQt v3.2.0+) - - - -TQDomDocumentFragment (TQt v2.2+) - -TQDomDocumentFragment is fully implemented. - - - -TQDomDocumentType (TQt v2.2+) - -TQDomDocumentType is fully implemented. - - - -TQDomNamedNodeMap (TQt v2.2+) - -TQDomNamedNodeMap is fully implemented. - - - -TQDomCharacterData (TQt v2.2+) - -TQDomCharacterData is fully implemented. - - - -TQDomAttr (TQt v2.2+) - -TQDomAttr is fully implemented. - - - -TQDomElement (TQt v2.2+) - -TQDomElement is fully implemented. - - - -TQDomText (TQt v2.2+) - -TQDomText is fully implemented. - - - -TQDomComment (TQt v2.2+) - -TQDomComment is fully implemented. - - - -TQDomCDATASection (TQt v2.2+) - -TQDomCDATASection is fully implemented. - - - -TQDomNotation (TQt v2.2+) - -TQDomNotation is fully implemented. - - - -TQDomEntity (TQt v2.2+) - -TQDomEntity is fully implemented. - - - -TQDomEntityReference (TQt v2.2+) - -TQDomEntityReference is fully implemented. - - - -TQDomProcessingInstruction (TQt v2.2+) - -TQDomProcessingInstruction is fully implemented. - - - -
diff --git a/doc/PyTQt.html b/doc/PyTQt.html new file mode 100644 index 0000000..afde2d4 --- /dev/null +++ b/doc/PyTQt.html @@ -0,0 +1,12845 @@ + +Python Bindings for TQt (3.18.1)

Python Bindings for TQt (3.18.1)

Phil Thompson

This document describes a set of Python bindings for the TQt widget set. + Contact the author at <phil@riverbankcomputing.co.uk>. +


Introduction

PyTQt is a set of Python bindings for the TQt toolkit and available for all +platforms supported by TQt, including Windows, Linux, UNIX, MacOS/X and embedded +systems such as the Sharp Zaurus and the Compaq iPAQ. They have been tested +against TQt versions 1.43 to 3.3.7, TQt Non-commercial, TQtopia 1.5.0, and Python +versions 1.5 to 2.5. TQt/Embedded v3 is not supported. TQt v4 is supported +by PyTQt v4.

PyTQt is available under the GPL license for use with the GPL version of TQt, a +a commercial license for use with the commercial version of TQt, a +non-commercial license for use with the non-commercial version of TQt v2, and an +educational license for use with the educational version of TQt.

PyTQt is built using SIP (a tool for generating Python extension modules for +C++ class libraries). SIP v4.6 or later must be installed in order to build +and run this version of PyTQt.

PyTQt for MacOS/X requires TQt v3.1.0 or later and Python v2.3 or later.

The bindings are implemented as a number of Python modules

  • tqt is the main module and contains the core classes and most +user interface widgets.

  • tqtaxcontainer contains a sub-set of the classes implemented +in TQt's TQAxContainer module, part of TQt's ActiveTQt framework.

  • tqtcanvas contains the classes implemented in TQt's Canvas +module.

  • tqtgl contains the classes implemented in TQt's OpenGL module.

  • tqtnetwork contains the classes implemented in TQt's Network +module.

  • tqtpe contains the classes implemented in TQtopia (originally +called the TQt Palmtop Environment). It is only supported with TQt/Embedded.

  • tqtsql contains the classes implemented in TQt's SQL module.

  • tqttable contains the classes implemented in TQt's Table +module.

  • tqtui contains the classes implemented in TQt's tqui library. +These allow GUIs to be created directly from TQt Designer's +.ui files.

  • tqtxml contains the classes implemented in TQt's XML module.

  • tqtext contains useful third-party classes that are not part +of TQt. At the moment it contains bindings for TQScintilla, the port to TQt of +the Scintilla programmer's editor class.

PyTQt also includes the pytquic and +pytqlupdate utilities which correspond to the TQt +uic and lupdate utilities. +pytquic converts the GUI designs created with TQt Designer to +executable Python code. pytqlupdate scans Python code, +extracts all strings that are candidates for internationalisation, and creates +an XML file for use by TQt Linguist.

+
+

Other PyTQt Goodies

Using TQt Designer

TQt Designer is a GPL'ed GUI design editor provided by Trolltech as part of TQt. +It generates an XML description of a GUI design. TQt includes +uic which generates C++ code from that XML.

PyTQt includes pytquic which generates Python code from the +same XML. The Python code is self contained and can be executed immediately.

It is sometimes useful to be able to include some specific Python code in the +output generated by pytquic. For example, if you are using +custom widgets, pytquic has no way of knowing the name of the +Python module containing the widget and so cannot generate the required +import statement. To help get around this, +pytquic will extract any lines entered in the +Comment field of TQt Designer's +Form Settings dialog that begin with +Python: and copies them to the generated output.

Here's a simple example showing the contents of the Comment +field.

This comment will be ignored by pytquic.
+Python:
+Python:# Import our custom widget.
+Python:from foo import bar

Here's the corresponding output from pytquic.

from PyTQt.tqt import *
+
+# Import our custom widget.
+from foo import bar

Thanks to Christian Bird, pytquic will extract Python code +entered using TQt Designer to implement slots. In TQt Designer, when you need to +edit a slot and the source editor appears, enter Python code between the curly +braces. Don't worry about the correct starting indent level, each line is +prepended with a correct indentation.

Make sure that the ui.h file is in the same directory as the +.ui file when using pytquic. The +.ui file implies the name of the .ui.h +file so there is no need to specify it on the command line.

Here's an example of a simple slot.

void DebMainWindowFrm::browsePushButtonClicked()
+{
+if self.debugging:
+    TQMessageBox.critical(self, "Event", "browse pushbutton was clicked!")
+}

Here is the resulting code when pytquic is run.

class DebMainWindowFrm(TQMainWindow):
+    ...stuff...
+    def browsePushButtonClicked(self):
+        if self.debugging:
+            TQMessageBox.critical(self, "Event", "browse pushbutton was clicked!")

Note that indenting is as normal and that self and all other +parameters passed to the slot are available.

If you use this, you will need to turn off all of the fancy options for the C++ +editor in Designer as it tries to force C++ syntax and that's naturally +annoying when trying to code in Python.


Using TQt Linguist

TQt includes the lupdate program which parses C++ source +files converting calls to the QT_TR_NOOP() and +QT_TRANSLATE_NOOP() macros to .ts +language source files. The lrelease program is then used to +generate .qm binary language files that are distributed with +your application.

Thanks to Detlev Offenbach, PyTQt includes the pytqlupdate +program. This generates the same .ts language source files +from your PyTQt source files.


Deploying Commercial PyTQt Applications

When deploying commercial PyTQt applications it is necessary to discourage users +from accessing the underlying PyTQt modules for themselves. A user that used +the modules shipped with your application to develop new applications would +themselves be considered a developer and would need their own commercial TQt and +PyTQt licenses.

One solution to this problem is the +VendorID +package. This allows you to build Python extension modules that can only be +imported by a digitally signed custom interpreter. The package enables you to +create such an interpreter with your application embedded within it. The +result is an interpreter that can only run your application, and PyTQt modules +that can only be imported by that interpreter. You can use the package to +similarly restrict access to any extension module.

In order to build PyTQt with support for the VendorID package, pass the +-i command line flag to configure.py.


pytqtconfig and Build System Support

The SIP build system (ie. the sipconfig module) is described +in the SIP documentation. PyTQt includes the pytqtconfig +module that can be used by configuration scripts of other bindings that are +built on top of PyTQt.

The pytqtconfig module contains the following classes:

Configuration(sipconfig.Configuration)

This class encapsulates additional configuration values, specific to PyTQt, that +can be accessed as instance variables.

The following configuration values are provided (in addition to those provided +by the sipconfig.Configuration class):

pytqt_bin_dir

The name of the directory containing the pytquic and +pytqlupdate executables.

pytqt_mod_dir

The name of the directory containing the PyTQt modules.

pytqt_modules

A string containing the names of the PyTQt modules that were installed.

pytqt_tqt_sip_flags

A string of the SIP flags used to generate the code for the +tqt module and which should be added to those needed by any +module that imports the tqt module.

pytqt_tqtaxcontainer_sip_flags

A string of the SIP flags used to generate the code for the +tqtaxcontainer module and which should be added to those +needed by any module that imports the tqtaxcontainer module.

pytqt_tqtcanvas_sip_flags

A string of the SIP flags used to generate the code for the +tqtcanvas module and which should be added to those needed by +any module that imports the tqtcanvas module.

pytqt_tqtext_sip_flags

A string of the SIP flags used to generate the code for the +tqtext module and which should be added to those needed by +any module that imports the tqtext module.

pytqt_tqtgl_sip_flags

A string of the SIP flags used to generate the code for the +tqtgl module and which should be added to those needed by any +module that imports the tqtgl module.

pytqt_tqtnetwork_sip_flags

A string of the SIP flags used to generate the code for the +tqtnetwork module and which should be added to those needed +by any module that imports the tqtnetwork module.

pytqt_tqtsql_sip_flags

A string of the SIP flags used to generate the code for the +tqtsql module and which should be added to those needed by +any module that imports the tqtsql module.

pytqt_tqttable_sip_flags

A string of the SIP flags used to generate the code for the +tqttable module and which should be added to those needed by +any module that imports the tqttable module.

pytqt_tqtui_sip_flags

A string of the SIP flags used to generate the code for the +tqtui module and which should be added to those needed by any +module that imports the tqtui module.

pytqt_tqtxml_sip_flags

A string of the SIP flags used to generate the code for the +tqtxml module and which should be added to those needed by +any module that imports the tqtxml module.

pytqt_sip_dir

The name of the base directory where the .sip files for each +of the PyTQt modules is installed. A sub-directory exists with the same name as +the module.

pytqt_version

The PyTQt version as a 3 part hexadecimal number (eg. v3.10 is represented as +0x030a00).

pytqt_version_str

The PyTQt version as a string. For development snapshots it will start with +snapshot-.

TQtModuleMakefile(sipconfig.SIPModuleMakefile)

The Makefile class for modules that import the tqt module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().

TQtAxContainerModuleMakefile(TQtModuleMakefile)

The Makefile class for modules that import the tqtaxcontainer +module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().

TQtCanvasModuleMakefile(TQtModuleMakefile)

The Makefile class for modules that import the tqtcanvas +module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().

TQtExtModuleMakefile(TQtModuleMakefile)

The Makefile class for modules that import the tqtext module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().

TQtGLModuleMakefile(TQtModuleMakefile)

The Makefile class for modules that import the tqtgl module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().

TQtNetworkModuleMakefile(TQtModuleMakefile)

The Makefile class for modules that import the tqtnetwork +module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().

TQtTableModuleMakefile(TQtModuleMakefile)

The Makefile class for modules that import the tqttable +module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().

TQtSQLModuleMakefile(TQtTableModuleMakefile)

The Makefile class for modules that import the tqtsql module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().

TQtUIModuleMakefile(TQtModuleMakefile)

The Makefile class for modules that import the tqtui module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().

TQtXMLModuleMakefile(TQtModuleMakefile)

The Makefile class for modules that import the tqtxml module.

finalise(self)

This is a reimplementation of sipconfig.Makefile.finalise().


Things to be Aware Of

super and Wrapped Classes

Internally PyTQt implements a lazy technique for attribute lookup where +attributes are only placed in type and instance dictionaries when they are +first referenced. This technique is needed to reduce the time taken to import +large modules such as PyTQt.

In most circumstances this technique is transparent to an application. The +exception is when super is used with a PyTQt class. The way +that super is currently implemented means that the lazy +lookup is bypassed resulting in AttributeError exceptions +unless the attribute has been previously referenced.

Note that this restriction applies to any class wrapped by SIP and not just +PyTQt.


Python Strings, TQt Strings and Unicode

Unicode support was added to TQt in v2.0 and to Python in v1.6. In TQt, Unicode +support is implemented using the TQString class. It is +important to understand that TQStrings, Python string objects +and Python Unicode objects are all different but conversions between them are +automatic in many cases and easy to achieve manually when needed.

Whenever PyTQt expects a TQString as a function argument, a +Python string object or a Python Unicode object can be provided instead, and +PyTQt will do the necessary conversion automatically.

You may also manually convert Python string and Unicode objects to +TQStrings by using the TQString constructor +as demonstrated in the following code fragment.

qs1 = TQString('Converted Python string object')
+qs2 = TQString(u'Converted Python Unicode object')

In order to convert a TQString to a Python string object use +the Python str() function. Applying +str() to a null TQString and an empty +TQString both result in an empty Python string object.

In order to convert a TQString to a Python Unicode object use +the Python unicode() function. Applying +unicode() to a null TQString and an empty +TQString both result in an empty Python Unicode object.


Access to Protected Member Functions

When an instance of a C++ class is not created from Python it is not possible +to access the protected member functions, or emit the signals, of that +instance. Attempts to do so will raise a Python exception. Also, any Python +methods corresponding to the instance's virtual member functions will never be +called.


None and NULL

Throughout the bindings, the None value can be specified +wherever NULL is acceptable to the underlying C++ code.

Equally, NULL is converted to None +whenever it is returned by the underlying C++ code.


Support for C++ void * Data Types

PyTQt represents void * values as objects of type +sip.voidptr. Such values are often used to pass the +addresses of external objects between different Python modules. To make this +easier, a Python integer (or anything that Python can convert to an integer) +can be used whenever a sip.voidptr is expected.

A sip.voidptr may be converted to a Python integer by using +the int() builtin function.

A sip.voidptr may be converted to a Python string by using +its asstring() method. The asstring() +method takes an integer argument which is the length of the data in bytes.


Support for Threads

PyTQt implements the full set of TQt's thread classes. Python, of course, also +has its own thread extension modules. If you are using SIP v4 (or later) and +Python v2.3.5 (or later) then PyTQt does not impose any additional restrictions. +(Read the relevant part of the TQt documentation to understand the restrictions +imposed by the TQt API.)

If you are using earlier versions of either SIP or Python then it is possible +to use either of the APIs so long as you follow some simple rules.

  • If you use the TQt API then the very first import of one of +the PyTQt modules must be done from the main thread.

  • If you use the Python API then all calls to PyTQt (including any +imports) must be done from one thread only. Therefore, if +you want to make calls to PyTQt from several threads then you must use the TQt +API.

  • If you want to use both APIs in the same application then all calls to PyTQt +must be done from threads created using the TQt API.

The above comments actually apply to any SIP generated module, not just PyTQt.


Garbage Collection

C++ does not garbage collect unreferenced class instances, whereas Python does. +In the following C++ fragment both colours exist even though the first can no +longer be referenced from within the program:

c = new TQColor();
+c = new TQColor();

In the corresponding Python fragment, the first colour is destroyed when +the second is assigned to c:

c = TQColor()
+c = TQColor()

In Python, each colour must be assigned to different names. Typically this +is done within class definitions, so the code fragment would be something like:

self.c1 = TQColor()
+self.c2 = TQColor()

Sometimes a TQt class instance will maintain a pointer to another instance and +will eventually call the destructor of that second instance. The most common +example is that a TQObject (and any of its sub-classes) keeps +pointers to its children and will automatically call their destructors. In +these cases, the corresponding Python object will also keep a reference to the +corresponding child objects.

So, in the following Python fragment, the first TQLabel is +not destroyed when the second is assigned to l because the +parent TQWidget still has a reference to it.

p = TQWidget()
+l = TQLabel('First label',p)
+l = TQLabel('Second label',p)

C++ Variables

Access to C++ variables is supported. They are accessed as Python instance +variables. For example:

tab = TQTab()
+tab.label = "First Tab"
+tab.r = TQRect(10,10,75,30)

Global variables and static class variables are effectively read-only. They +can be assigned to, but the underlying C++ variable will not be changed. This +may change in the future.

Access to protected C++ class variables is not supported. This may change in +the future.


Multiple Inheritance

It is not possible to define a new Python class that sub-classes from more than +one TQt class.


i18n Support

TQt implements i18n support through the TQt Linguist application, the +TQTranslator class, and the +TQApplication::translate(), TQObject::tr() +and TQObject::trUtf8() methods. Usually the +tr() method is used to obtain the correct translation of a +message. The translation process uses a message context to allow the same +message to be translated differently. tr() is actually +generated by moc and uses the hardcoded class name as the +context. On the other hand, TQApplication::translate() +allows to context to be explicitly stated.

Unfortunately, because of the way TQt implents tr() (and +trUtf8()) it is not possible for PyTQt to exactly reproduce +its behavour. The PyTQt implementation of tr() (and +trUtf8()) uses the class name of the instance as the +context. The key difference, and the source of potential problems, is that the +context is determined dynamically in PyTQt, but is hardcoded in TQt. In other +words, the context of a translation may change depending on an instance's class +hierarchy.

class A(TQObject):
+    def __init__(self):
+        TQObject.__init__(self)
+
+    def hello(self):
+        return self.tr("Hello")
+
+class B(A):
+    def __init__(self):
+        A.__init__(self)
+
+a = A()
+a.hello()
+
+b = B()
+b.hello()

In the above the message is translated by a.hello() using a +context of A, and by b.hello() using a +context of B. In the equivalent C++ version the context +would be A in both cases.

The PyTQt behaviour is unsatisfactory and may be changed in the future. It is +recommended that TQApplication.translate() be used in +preference to tr() (and trUtf8()). This +is guaranteed to work with current and future versions of PyTQt and makes it +much easier to share message files between Python and C++ code. Below is the +alternative implementation of A that uses +TQApplication.translate().

class A(TQObject):
+    def __init__(self):
+        TQObject.__init__(self)
+
+    def hello(self):
+        return tqApp.translate("A","Hello")

Note that the code generated by pytquic uses +TQApplication.translate().


Signal and Slot Support

A signal may be either a TQt signal (specified using +SIGNAL()) or a Python signal (specified using +PYSIGNAL()).

A slot can be either a Python callable object, a TQt signal (specified using +SIGNAL()), a Python signal (specified using +PYSIGNAL()), or a TQt slot (specified using +SLOT()).

You connect signals to slots (and other signals) as you would from C++. For +example:

TQObject.connect(a,SIGNAL("TQtSig()"),pyFunction)
+TQObject.connect(a,SIGNAL("TQtSig()"),pyClass.pyMethod)
+TQObject.connect(a,SIGNAL("TQtSig()"),PYSIGNAL("PySig"))
+TQObject.connect(a,SIGNAL("TQtSig()"),SLOT("TQtSlot()"))
+TQObject.connect(a,PYSIGNAL("PySig"),pyFunction)
+TQObject.connect(a,PYSIGNAL("PySig"),pyClass.pyMethod)
+TQObject.connect(a,PYSIGNAL("PySig"),SIGNAL("TQtSig()"))
+TQObject.connect(a,PYSIGNAL("PySig"),SLOT("TQtSlot()"))

When a slot is a Python method that corresponds to a TQt slot then a signal can +be connected to either the Python method or the TQt slot. The following +connections achieve the same effect.

sbar = TQScrollBar()
+lcd = TQLCDNumber()
+
+TQObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd.display)
+TQObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd,SLOT("display(int)"))

The difference is that the second connection is made at the C++ level and is +more efficient.

Disconnecting signals works in exactly the same way.

Any instance of a class that is derived from the TQObject +class can emit a signal using the emit method. This takes +two arguments. The first is the Python or TQt signal, the second is a Python +tuple which are the arguments to the signal. For example:

a.emit(SIGNAL("clicked()"),())
+a.emit(PYSIGNAL("pySig"),("Hello","World"))

Note that when a slot is a Python callable object its reference count is not +increased. This means that a class instance can be deleted without having to +explicitly disconnect any signals connected to its methods. However, it also +means that using lambda expressions as slots will not work unless you keep a +separate reference to the expression to prevent it from being immediately +garbage collected.

TQt allows a signal to be connected to a slot that requires fewer arguments than +the signal passes. The extra arguments are quietly discarded. Python slots +can be used in the same way.


Static Member Functions

Static member functions are implemented as Python class functions. +For example the C++ static member function +TQObject::connect() is called from Python as +TQObject.connect() or self.connect() if +called from a sub-class of TQObject.


Enumerated Types

Enumerated types are implemented as a set of simple variables corresponding to +the separate enumerated values.

When using an enumerated value the name of the class (or a sub-class) in which +the enumerated type was defined in must be included. For example:

TQt.SolidPattern
+TQWidget.TabFocus
+TQFrame.TabFocus

Module Reference Documentation

The following sections should be used in conjunction with the normal class +documentation - only the differences specific to the Python bindings are +documented here.

In these sections, Not yet implemented +implies that the feature can be easily implemented if needed. Not +implemented implies that the feature will not be implemented, either +because it cannot be or because it is not appropriate.

If a class is described as being fully implemented then +all non-private member functions and all public class variables have been +implemented.

If an operator has been implemented then it is stated explicitly.

Classes that are not mentioned have not yet been implemented.


tqt Module Reference

TQt Constants

All constant values defined by TQt have equivalent constants defined to Python.


TQt (TQt v2+)

TQt is fully implemented.


TQAccel

TQAccel is fully implemented.


TQAction (TQt v2.2+)

TQAction is fully implemented.


TQActionGroup (TQt v2.2+)

TQActionGroup is fully implemented.


TQApplication

TQApplication(int &argc, char **argv);

This takes one parameter which is a list of argument strings. Arguments +used by TQt are removed from the list.

TQApplication(int &argc, char **argv, bool GUIenabled);

This takes two parameters, the first of which is a list of argument strings. +Arguments used by TQt are removed from the list.

TQApplication(int &argc, char **argv, Type type);

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+)

int exec();

This has been renamed to exec_loop in Python.


TQAssistantClient (TQt v3.1+)

TQAssistantClient is fully implemented.


TQBitmap

TQBitmap is fully implemented.


TQBrush

TQBrush is fully implemented, including the Python +== and != operators.


TQButton

TQButton is fully implemented.


TQButtonGroup

TQButtonGroup is fully implemented.


TQByteArray

A Python string can be used whenever a TQByteArray can be +used. A TQByteArray can be converted to a Python string +using the Python str() function.

TQByteArray &assign(const char *data, uint size);

Not implemented.

char &at(uint i);

Not yet implemented.

int contains(const char &d);

Not yet implemented.

bool fill(const char &d, int size = -1);

Not yet implemented.

int find(const char &d, uint i = 0);

Not yet implemented.

void resetRawData(const char *data, uintsize);

Not implemented.

TQByteArray &setRawData(const char *data, uintsize);

Not implemented.


TQCDEStyle (TQt v2+)

TQCDEStyle is fully implemented.


TQCheckBox

TQCheckBox is fully implemented.


TQClipboard

void *data const(const char *format);

Not yet implemented (TQt v1.x).

void setData(const char *format, void *);

Not yet implemented (TQt v1.x).


TQColor

The Python == and != operators are +supported.

void getHsv(int *h, int *s, int *v);

This takes no parameters and returns the h, +s and v values as a tuple.

void getRgb(int *r, int *g, int *b);

This takes no parameters and returns the r, +g and b values as a tuple.

void hsv(int *h, int *s, int *v);

This takes no parameters and returns the h, +s and v values as a tuple.

void rgb(int *r, int *g, int *b);

This takes no parameters and returns the r, +g and b values as a tuple.


TQColorDialog (TQt v2+)

static TQRgb getRgba(TQRgb initial, bool *ok, TQWidget *parent = 0, const char *name = 0);

This takes the initial, parent and +name parameters and returns a tuple containing the +TQRgb result and the ok value.


TQColorGroup

TQColorGroup is fully implemented.


TQComboBox

TQComboBox is fully implemented.


TQCommonStyle (TQt v2+)

virtual void getButtonShift(int &x, int &y);

This takes no parameters and returns a tuple of the x and +y values. (TQt v2)

virtual void tabbarMetrics(const TQTabBar *t, int &hframe, int &vframe, int &overlap);

This takes only the t parameter and returns a tuple of the +hframe, vframe and +overlap values. (TQt v2)


TQCString (TQt v2+)

A Python string can be used whenever a TQCString can be used. +A TQCString can be converted to a Python string using the +Python str() function.

TQCString &sprintf(const char *format, ...);

Not implemented.

short toShort(bool *ok = 0);

This returns a tuple of the short result and the +ok value.

ushort toUShort(bool *ok = 0);

This returns a tuple of the ushort result and the +ok value.

int toInt(bool *ok = 0);

This returns a tuple of the int result and the +ok value.

uint toUInt(bool *ok = 0);

This returns a tuple of the uint result and the +ok value.

long toLong(bool *ok = 0);

This returns a tuple of the long result and the +ok value.

ulong toULong(bool *ok = 0);

This returns a tuple of the ulong result and the +ok value.

float toFloat(bool *ok = 0);

This returns a tuple of the float result and the +ok value.

double toDouble(bool *ok = 0);

This returns a tuple of the double result and the +ok value.


TQCursor

TQCursor is fully implemented.


TQDataStream

TQDataStream &readBytes(const char *&s, uint &l);

This takes no parameters. The TQDataStream result and the +data read are returned as a tuple.

TQDataStream &readRawBytes(const char *s, uint l);

This takes only the l parameter. The +TQDataStream result and the data read are returned as a +tuple.

TQDataStream &writeBytes(const char *s, uint len);

len is derived from s and not passed as a +parameter.

TQDataStream &writeRawBytes(const char *s, uint len);

len is derived from s and not passed as a +parameter.


TQDate

The Python +==, !=, +<, <=, +>, >= +and __nonzero__ +operators are supported.

int weekNumber(int *yearNum = 0);

This takes no parameters and returns the week number and the year number as a +tuple. (TQt v3.1+)


TQDateTime

TQDateTime is fully implemented, including the Python +==, !=, +<, <=, +>, >= +and __nonzero__ +operators.


TQTime

TQTime is fully implemented, including the Python +==, !=, +<, <=, +>, >= +and __nonzero__ +operators.


TQDateEdit (TQt v3+)

TQDateEdit is fully implemented.


TQTimeEdit (TQt v3+)

TQTimeEdit is fully implemented.


TQDateTimeEdit (TQt v3+)

TQDateTimeEdit is fully implemented.


TQDesktopWidget (TQt v3+)

TQDesktopWidget is fully implemented.


TQDial (TQt v2.2+)

TQDial is fully implemented.


TQDialog

int exec();

This has been renamed to exec_loop in Python.

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 TQObject.deleteLater() or other techniques.


TQDir

TQDir is fully implemented, including the Python +len, [] (for reading slices and +individual elements), ==, != and +in operators


TQFileInfoList

This class isn't implemented. Whenever a TQFileInfoList is +the return type of a function or the type of an argument, a Python list of +TQFileInfo instances is used instead.


TQDockArea (TQt v3+)

bool hasDockWindow const(TQDockWindow *w, int *index = 0);

This takes the w parameter and returns the index of the +TQDockWIndow or -1 if the TQDockArea does not contain the TQDockWindow.


TQDockWindow (TQt v3+)

TQDockWindow is fully implemented.


TQColorDrag (TQt v2.1+)

TQColorDrag is fully implemented.


TQDragObject

TQDragObject is fully implemented.


TQImageDrag

TQImageDrag is fully implemented.


TQStoredDrag

TQStoredDrag is fully implemented.


TQTextDrag

TQTextDrag is fully implemented.


TQUriDrag (TQt v2+)

TQUriDrag is fully implemented.


TQUrlDrag (TQt v1.x)

TQUrlDrag is fully implemented.


TQDropSite

TQDropSite is fully implemented.


TQErrorMessage (TQt v3+)

TQErrorMessage is fully implemented.


TQEvent

TQEvent is fully implemented.

Instances of TQEvents are automatically converted to the +correct sub-class.


TQChildEvent

TQChildEvent is fully implemented.


TQCloseEvent

TQCloseEvent is fully implemented.


TQIconDragEvent (TQt v3.3+)

TQIconDragEvent is fully implemented.


TQContextMenuEvent (TQt v3+)

TQContextMenuEvent is fully implemented.


TQCustomEvent

TQCustomEvent is fully implemented. Any Python object can be +passed as the event data and its reference count is increased.


TQDragEnterEvent

TQDragEnterEvent is fully implemented.


TQDragLeaveEvent

TQDragLeaveEvent is fully implemented.


TQDragMoveEvent

TQDragMoveEvent is fully implemented.


TQDropEvent

TQDropEvent is fully implemented.


TQFocusEvent

TQFocusEvent is fully implemented.


TQHideEvent

TQHideEvent is fully implemented.


TQIMComposeEvent (TQt v3.1+)

TQIMComposeEvent is fully implemented.


TQIMEvent (TQt v3+)

TQIMEvent is fully implemented.


TQKeyEvent

TQKeyEvent is fully implemented.


TQMouseEvent

TQMouseEvent is fully implemented.


TQMoveEvent

TQMoveEvent is fully implemented.


TQPaintEvent

TQPaintEvent is fully implemented.


TQResizeEvent

TQResizeEvent is fully implemented.


TQShowEvent

TQShowEvent is fully implemented.


TQTabletEvent (TQt v3+)

TQTabletEvent is fully implemented.


TQTimerEvent

TQTimerEvent is fully implemented.


TQWheelEvent (TQt v2+)

TQWheelEvent is fully implemented.


TQEventLoop (TQt v3.1+)

virtual int exec();

This has been renamed to exec_loop in Python.


TQFile

bool open(int m, FILE *f);

Not implemented.

TQ_LONG readBlock(char *data, TQ_ULONG len);

This takes a single len parameter. The +data is returned if there was no error, otherwise +None is returned.

TQ_LONG readLine(char *data, TQ_ULONG maxlen);

This takes a single maxlen parameter. The +data is returned if there was no error, otherwise +None is returned.

static void setDecodingFunction(EncoderFn f);

Not yet implemented. (TQt v2+)

static void setEncodingFunction(EncoderFn f);

Not yet implemented. (TQt v2+)

TQ_LONG writeBlock(const char *data, TQ_ULONG len);

len is derived from data and not passed +as a parameter.


TQFileDialog

TQFileDialog is fully implemented.


TQFileIconProvider

TQFileIconProvider is fully implemented.


TQFilePreview

TQFilePreview 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.

class FilePreview(TQFilePreview):
+    pass
+
+class Preview(TQLabel):
+    def __init__(self, parent=None):
+        TQLabel.__init__(self, parent)
+        self.preview = FilePreview()
+        self.preview.previewUrl = self.previewUrl

Note that TQFilePreview cannot be instantiated directly because it is abstract. +Thanks to Hans-Peter Jansen for this trick.


TQFileInfo

TQFileInfo is fully implemented.


TQFont

TQFont is fully implemented, including the Python +== and != operators.


TQFontDatabase (TQt v2.1+)

TQFontDatabase is fully implemented.


TQFontDialog (TQt v2+)

static TQFont getFont(bool *ok, const TQFont &def, TQWidget *parent = 0, const char *name = 0);

This takes the def, parent and +name parameters and returns a tuple containing the +TQFont result and the ok value.

static TQFont getFont(bool *ok, TQWidget *parent = 0, const char *name = 0);

This takes the parent and name parameters +and returns a tuple containing the TQFont result and the +ok value.


TQFontInfo

TQFontInfo is fully implemented.


TQFontMetrics

TQRect boundingRect(int x, int y, int w, int h, int flags, const TQString &str, int len = -1, int tabstops = 0, int *tabarray = 0);

The tabarray parameter is a Python list of integers.

TQSize size(int flags, const TQString &str, int len = -1, int tabstops = 0, int *tabarray = 0);

The tabarray parameter is a Python list of integers.


TQFrame

TQFrame is fully implemented.


TQGManager (TQt v1.x)

TQGManager is fully implemented.


TQChain (TQt v1.x)

TQChain is implemented as an opaque class.


TQGrid (TQt v2+)

TQGrid is fully implemented.


TQGridView (TQt v3+)

TQGridView is fully implemented.


TQGroupBox

TQGroupBox is fully implemented.


TQHBox (TQt v2+)

TQHBox is fully implemented.


TQHButtonGroup (TQt v2+)

TQHButtonGroup is fully implemented.


TQHeader

TQHeader is fully implemented.


TQHGroupBox (TQt v2+)

TQHGroupBox is fully implemented.


TQIconSet

TQIconSet is fully implemented.


TQIconFactory (TQt v3.1+)

TQIconFactory is fully implemented.


TQIconView (TQt v2.1+)

TQIconViewItem *makeRowLayout(TQIconViewItem *begin, int &y);

Not yet implemented.


TQIconViewItem (TQt v2.1+)

TQIconViewItem is fully implemented.


TQIconDrag (TQt v2.1+)

TQIconDrag is fully implemented.


TQIconDragItem (TQt v2.1+)

TQIconDragItem is fully implemented.


TQImage

The Python == and != operators are +supported.

TQImage(const char *xpm[]);

This takes a list of strings as its parameter.

TQImage(uchar *data, int w, int h, int depth, TQRgb *colorTable, int numColors, Endian bitOrder);

The colorTable parameter is a list of TQRgb instances or +None. (TQt v2.1+)

uchar *bits();

The return value is a sip.voidptr object which is only +useful if passed to another Python module.

TQRgb *colorTable();

The return value is a sip.voidptr object which is only +useful if passed to another Python module.

TQImage convertDepthWithPalette(int, TQRgb *p, int pc, int cf = 0);

Not implemented.

uchar **jumpTable();

The return value is a sip.voidptr object which is only +useful if passed to another Python module.

bool loadFromData(const uchar *buf, uint len, const char *format = 0, ColorMode mode = Auto);

len is derived from buf and not passed as +a parameter.

uchar *scanLine(int i);

The return value is a sip.voidptr object which is only +useful if passed to another Python module.


TQImageIO

static void defineIOHandler(const char *format, const char *header, const char *flags, image_io_handler read_image, image_io_handler write_image);

Not implemented.


TQImageTextKeyLang

TQImageTextKeyLang is fully implemented.


TQInputDialog (TQt v2.1+)

static TQString getText(const TQString &caption, const TQString &label, const TQString &text = TQString::null, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);

The ok is not passed and the returned value is a tuple of +the TQString result and the ok flag. +(TQt v2.1 - v2.3.1)

static TQString getText(const TQString &caption, const TQString &label, TQLineEdit::EchoModeecho, const TQString &text = TQString::null, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);

The ok is not passed and the returned value is a tuple of +the TQString result and the ok flag. +(TQt v2.2 - v2.3.1)

static TQString getText(const TQString &caption, const TQString &label, TQLineEdit::EchoModeecho = TQLineEdit::Normal, const TQString &text = TQString::null, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);

The ok is not passed and the returned value is a tuple of +the TQString result and the ok flag. +(TQt v3+)

static int getInteger(const TQString &caption, const TQString &label, int num = 0, int from = -2147483647, int to = 2147483647, int step = 1, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);

The ok is not passed and the returned value is a tuple of +the int result and the ok flag.

static double getDouble(const TQString &caption, const TQString &label, double num = 0, double from = -2147483647, double to = 2147483647, int step = 1, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);

The ok is not passed and the returned value is a tuple of +the double result and the ok flag.

static TQString getItem(const TQString &caption, const TQString &label, const TQStringList &list, int current = 0, bool editable = TRUE, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);

The ok is not passed and the returned value is a tuple of +the TQString result and the ok flag.


TQInterlaceStyle (TQt v2.3.1+)

void scrollBarMetrics(const TQTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

This takes only the sb parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values.


TQIODevice

TQIODevice is fully implemented.


TQKeySequence (TQt v3+)

TQKeySequence is fully implemented including the operators +==, !=, TQString() and +int(). A TQString instance or a Python +integer may be used whenever a TQKeySequence can be used.


TQLabel

TQLabel is fully implemented.


TQLayout

TQLayout is fully implemented.


TQBoxLayout

TQBoxLayout is fully implemented.


TQGLayoutIterator (TQt v2+)

TQGLayoutIterator is fully implemented.


TQGridLayout

bool findWidget(TQWidget *w, int *row, int *col);

This takes the w parameter and returns a tuple containing +the bool result, row and +col. (TQt v2+)


TQHBoxLayout

TQHBoxLayout is fully implemented.


TQLayoutItem (TQt v2+)

TQLayoutItem is fully implemented.


TQLayoutIterator (TQt v2+)

TQLayoutItem *next();

This is a wrapper around the TQLayoutIterator +++ operator.


TQSpacerItem (TQt v2+)

TQSpacerItem is fully implemented.


TQVBoxLayout

TQVBoxLayout is fully implemented.


TQWidgetItem (TQt v2+)

TQWidgetItem is fully implemented.


TQLCDNumber

TQLCDNumber is fully implemented.


TQLibrary (TQt v3+)

TQLibrary is fully implemented.


TQLineEdit

int characterAt(int xpos, TQChar *chr);

This takes only the xpos parameter and returns the int +result and the chr value as a tuple. (TQt v3+)

void del();

This has been renamed delChar in Python. (TQt v2+)

bool getSelection(int *start, int *end);

This takes no parameters and returns the bool result and the +start and end values as a tuple. +(TQt v3+)


TQPtrList<type> (TQt v2)

Types based on the TQPtrList template are automatically +converted to and from Python lists of the type.


TQListBox

bool itemYPos(int index, int *yPos);

This takes the index parameter and returns a tuple +containing the bool result and yPos. +(TQt v1.x)


TQListBoxItem

TQListBoxItem is fully implemented.


TQListBoxPixmap

TQListBoxPixmap is fully implemented.


TQListBoxText

TQListBoxText is fully implemented.


TQListView

TQListView is fully implemented.

Note that to remove a child TQListViewItem you must first +call takeItem() and then del().


TQListViewItem

TQListViewItem is fully implemented.

Note that to remove a child TQListViewItem you must first +call takeItem() and then del().


TQCheckListItem

TQCheckListItem is fully implemented.


TQListViewItemIterator (TQt v2+)

TQListViewItemIterator is fully implemented.


TQLocale (TQt v3.3+)

short toShort(bool *ok = 0);

This returns a tuple of the short result and the +ok value.

ushort toUShort(bool *ok = 0);

This returns a tuple of the ushort result and the +ok value.

int toInt(bool *ok = 0);

This returns a tuple of the int result and the +ok value.

uint toUInt(bool *ok = 0);

This returns a tuple of the uint result and the +ok value.

TQ_LONG toLong(bool *ok = 0);

This returns a tuple of the long result and the +ok value.

TQ_ULONG toULong(bool *ok = 0);

This returns a tuple of the ulong result and the +ok value.

float toFloat(bool *ok = 0);

This returns a tuple of the float result and the +ok value.

double toDouble(bool *ok = 0);

This returns a tuple of the double result and the +ok value.


TQMainWindow

TQTextStream &operator<<(TQTextStream &, const TQMainWindow &);

This operator is fully implemented. (TQt v3+)

TQTextStream &operator>>(TQTextStream &, TQMainWindow &);

This operator is fully implemented. (TQt v3+)

bool getLocation(TQToolBar *tb, ToolBarDock &dock, int &index, bool &nl, int &extraOffset);

This takes only the tb parameter and returns a tuple of the +result, dock, index, +nl and extraOffset values. (TQt v2.1.0+)

TQPtrList<TQToolBar> toolBars(ToolBarDock dock);

This returns a list of TQToolBar instances. (TQt v2.1.0+)


TQMemArray<type> (TQt v3+)

Types based on the TQMemArray template are automatically +converted to and from Python lists of the type.


TQMenuBar

TQMenuBar is fully implemented.


TQMenuData

TQMenuItem *findItem(int id, TQMenuData **parent);

Not implemented.


TQCustomMenuItem (TQt v2.1+)

TQCustomMenuItem is fully implemented.


TQMenuItem

TQMenuItem is an internal TQt class.


TQMessageBox

TQMessageBox is fully implemented.


TQMetaObject

int numClassInfo const(bool super = FALSE);

Not implemented.

const TQClassInfo *classInfo const(bool super = FALSE);

Not implemented.


TQMetaProperty

TQMetaProperty is fully implemented.


TQMimeSource (TQt v2+)

TQMimeSource is fully implemented.


TQMimeSourceFactory (TQt v2+)

TQMimeSourceFactory is fully implemented.


TQWindowsMime (TQt v3+)

TQWindowsMime is fully implemented.


TQMotifPlusStyle (TQt v2.2+)

void getButtonShift(int &x, int &y);

This takes no parameters and returns a tuple of the x and +y values. (TQt v2)

void scrollBarMetrics(const TQScrollBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

This takes only the sb parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. +(TQt v2)


TQMotifStyle (TQt v2+)

void scrollBarMetrics(const TQTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

This takes only the sb parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. +(TQt v2)

void tabbarMetrics(const TQTabBar *t, int &hframe, int &vframe, int &overlap);

This takes only the t parameter and returns a tuple of the +hframe, vframe and +overlap values. (TQt v2)


TQMovie

TQMovie(TQDataSource *src, int bufsize = 1024);

Not implemented.

void pushData(const uchar *data, int length);

length is derived from data and not +passed as a parameter. (TQt v2.2.0+)


TQMultiLineEdit

void cursorPosition const(int *line, int *col);

This takes no parameters and returns a tuple of the line and +col values. (TQt v1.x, TQt v2.x)

virtual void del();

This has been renamed delChar in Python. (TQt v1.x, TQt v2.x)

void getCursorPosition const(int *line, int *col);

This takes no parameters and returns a tuple of the line and +col values. (TQt v1.x, TQt v2.x)

bool getMarkedRegion(int *line1, int *col1, int *line2, int *col2);

This takes no parameters and returns a tuple of the bool result and the +line1, col1, line2 and +col2 values.


TQMutex (TQt v2.2+)

TQMutex is fully implemented.


TQMutexLocker (TQt v3.1+)

TQMutexLocker is fully implemented.


TQNetworkOperation (TQt v2.1+)

TQNetworkOperation is fully implemented.


TQNetworkProtocol (TQt v2.1+)

TQNetworkProtocol is fully implemented.


TQNetworkProtocolFactoryBase (TQt v2.1+)

TQNetworkProtocolFactoryBase is fully implemented.


TQObject

bool disconnect(const TQObject *receiver, const char *member = 0);

Not yet implemented.

bool disconnect(const char *signal = 0, const TQObject *receiver = 0, const char *member = 0);

Not yet implemented.

static bool disconnect(const TQObject *sender, const char *signal, const TQObject *receiver, const char *member);

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 +signal and receiver parameters is not yet +supported.


TQObjectCleanupHandler (TQt v3+)

TQObjectCleanupHandler is fully implemented.


TQObjectList

This class isn't implemented. Whenever a TQObjectList is the +return type of a function or the type of an argument, a Python list of +TQObject instances is used instead.


TQPaintDeviceMetrics

TQPaintDeviceMetrics is fully implemented.


TQPaintDevice

virtual bool cmd(int, TQPainter *, TQPDevCmdParam *);

Not implemented.


TQPainter

TQRect boundingRect(int x, int y, int w, int h, int flags, const char *str, int len = -1, char **intern = 0);

The intern parameter is not supported.

TQRect boundingRect(const TQRect&, int flags, const char *str, int len = -1, char **intern = 0);

The intern parameter is not supported.

void drawText(int x, int y, int w, int h, int flags, const char *str, int len = -1, TQRect *br = 0, char **intern = 0);

The intern parameter is not supported.

void drawText(const TQRect&, int flags, const char *str, int len = -1, TQRect *br = 0, char **intern = 0);

The intern parameter is not supported.

void setTabArray(int *ta);

This takes a single parameter which is a list of tab stops.

int *tabArray();

This returns a list of tab stops.


TQPalette

TQPalette is fully implemented, including the Python +== and != operators.


TQPixmap

TQPixmap(const char *xpm[]);

This takes a list of strings as its parameter.

bool loadFromData(const uchar *buf, uint len, const char *format = 0, ColorMode mode = Auto);

len is derived from buf and not passed as +a parameter.

bool loadFromData(const uchar *buf, uint len, const char *format, int conversion_flags);

Not implemented.


TQPixmapCache (TQt v3+)

TQPixmapCache is fully implemented.


TQPair<type,type> (TQt v3+)

Types based on the TQPair template are automatically +converted to and from Python tuples of two elements.


TQPen

TQPen is fully implemented, including the Python +== and != operators.


TQPicture

const char *data();

Not implemented.

void setData(const char *data, uint size);

size is derived from data and not passed +as a parameter.


TQPlatinumStyle (TQt v2+)

void scrollBarMetrics(const TQTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

This takes only the sb parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. +(TQt v2)


TQPoint

The Python ++, +=, +-, -=, unary -, +*, *=, +/, /=, +==, != and __nonzero__ +operators are supported.

TQCOORD &rx();

Not implemented.

TQCOORD &ry();

Not implemented.


TQPointArray

TQPointArray(int nPoints, const TQCOORD *points);

This takes a single parameter which is a list of points.

void point(uint i, int *x, int *y);

This takes the single parameter i and returns the +x and y values as a tuple.

bool putPoints(int index, int nPoints, const TQCOORD *points);

This takes two parameters, index and a list of points.

bool putPoints(int index, int nPoints, int firstx, int firsty, ...);

Not implemented.

bool setPoints(int nPoints, const TQCOORD *points);

This takes a single parameter which is a list of points.

bool setPoints(int nPoints, int firstx, int firsty, ...);

Not implemented.


TQPopupMenu

int exec();

This has been renamed exec_loop in Python.

int exec(const TQPoint &pos, int indexAtPoint = 0);

This has been renamed exec_loop in Python.


TQPrintDialog (X11)

TQPrintDialog is fully implemented.


TQPrinter

TQPrinter is fully implemented.


TQProcess (TQt v3+)

TQProcess is fully implemented.


TQProgressBar

TQProgressBar is fully implemented.


TQProgressDialog

TQProgressDialog is fully implemented. +value.


TQPtrList<type> (TQt v3+)

Types based on the TQPtrList template are automatically +converted to and from Python lists of the type.


TQPushButton

TQPushButton is fully implemented.


TQRadioButton

TQRadioButton is fully implemented.


TQRangeControl

TQRangeControl is fully implemented.


TQRect

The Python +&, &=, +|, |=, +==, !=, in and +__nonzero__ operators are supported.

void coords(int *x1, int *y1, int *x2, int *y2);

This takes no parameters and returns a tuple containing the four values.

void rect(int *x, int *y, int *w, int *h);

This takes no parameters and returns a tuple containing the four values.

TQCOORD &rBottom();

Not implemented. (TQt v2+)

TQCOORD &rLeft();

Not implemented. (TQt v2+)

TQCOORD &rRight();

Not implemented. (TQt v2+)

TQCOORD &rTop();

Not implemented. (TQt v2+)


TQRegExp

The Python == and != operators are +supported.

int match(const char *str, int index = 0, int *len = 0);

This takes str and index parameters and +returns a tuple of the int result and the +len value. (TQt v1.x)

int match(const TQString &str, int index = 0, int *len = 0);

This takes str and index parameters and +returns a tuple of the int result and the +len value. (TQt v2+)


TQRegion

The Python +|, |=, ++, +=, +&, &=, +-, -=, +^, ^=, +==, !=, in and +__nonzero__ operators are supported.

TQArray<TQRect> rects();

Not implemented.

void setRects(TQRect *rects, int num);

Not yet implemented. (TQt v2.2+)


TQScrollBar

TQScrollBar is fully implemented.


TQScrollView

void contentsToViewport(int x, int y, int &vx, int &vy);

This takes the x and y parameters and +returns a tuple containing the vx and vy +values. (TQt v2+)

void viewportToContents(int vx, int vy, int &x, int &y);

This takes the vx and vy parameters and +returns a tuple containing the x and y +values. (TQt v2+)


TQSemaphore (TQt v2.2+)

TQSemaphore is fully implemented. The += +and -= operators have also been implemented, but require +Python v2.0 or later.


TQSemiModal (TQt v1, v2)

TQSemiModal is fully implemented.


TQSessionManager (TQt v2+)

TQSessionManager is fully implemented.


TQSettings (TQt v3+)

bool readBoolEntry(const TQString &key, bool def = 0, bool *ok = 0);

The ok is not passed and the returned value is a tuple of +the bool result and the ok flag.

double readDoubleEntry(const TQString &key, double def = 0, bool *ok = 0);

The ok is not passed and the returned value is a tuple of +the double result and the ok flag.

TQString readEntry(const TQString &key, const TQString &def = TQString::null, bool *ok = 0);

The ok is not passed and the returned value is a tuple of +the TQString result and the ok flag.

TQStringList readListEntry(const TQString &key, bool *ok = 0);

The ok is not passed and the returned value is a tuple of +the TQStringList result and the ok flag.

TQStringList readListEntry(const TQString &key, const TQChar &separator, bool *ok = 0);

The ok is not passed and the returned value is a tuple of +the TQStringList result and the ok flag.

int readNumEntry(const TQString &key, int def = 0, bool *ok = 0);

The ok is not passed and the returned value is a tuple of +the int result and the ok flag.

bool writeEntry(const TQString &key, bool value);

Not implemented.


TQSGIStyle (TQt v2.2+)

void scrollBarMetrics(const TQScrollBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

This takes only the sb parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. +(TQt v2)


TQSignalMapper

TQSignalMapper is fully implemented.


TQSimpleRichText (TQt v2+)

TQSimpleRichText is fully implemented.


TQSize

The Python ++, +=, +-, -=, +*, *=, +/, /=, +==, != and __nonzero__ +operators are supported.

TQCOORD &rheight();

Not implemented.

TQCOORD &rwidth();

Not implemented.


TQSizeGrip (TQt v2+)

TQSizeGrip is fully implemented.


TQSizePolicy (TQt v2+)

TQSizePolicy is fully implemented.


TQSlider

TQSlider is fully implemented.


TQSocketNotifier

TQSocketNotifier is fully implemented.


TQSound (TQt v2.2+)

TQSound is fully implemented.


TQSpinBox

virtual int mapTextToValue(bool *ok);

This returns a tuple of the int result and the modified +ok value.


TQSplashScreen (TQt v3.2.0+)

TQSplashScreen is fully implemented.


TQSplitter

void getRange(int id, int *min, int *max);

This takes the id parameter and returns the +min and max values as a tuple. (TQt v2+)


TQStatusBar

TQStatusBar is fully implemented.


TQChar (TQt v2+)

uchar &cell const();

Not implemented.

uchar &row const();

Not implemented.


TQString

A Python string object (or Unicode object) can be used whenever a +TQString can be used. A TQString can be +converted to a Python string object using the Python str() +function, and to a Python Unicode object using the Python +unicode() function.

The Python +=, len, [] +(for reading slices and individual characters), in and +comparison operators are supported.

TQCharRef at(uint i);

Not yet implemented. (TQt v2+)

TQChar constref const(uint i);

Not yet implemented. (TQt v2+)

TQChar &ref(uint i);

Not yet implemented. (TQt v2+)

TQString &setUnicodeCodes(const ushort *unicode_as_shorts, uint len);

Not yet implemented. (TQt v2.1+)

TQString &sprintf(const char *format, ...);

Not implemented.

short toShort(bool *ok = 0);

This returns a tuple of the short result and the +ok value.

ushort toUShort(bool *ok = 0);

This returns a tuple of the ushort result and the +ok value.

int toInt(bool *ok = 0);

This returns a tuple of the int result and the +ok value.

uint toUInt(bool *ok = 0);

This returns a tuple of the uint result and the +ok value.

long toLong(bool *ok = 0);

This returns a tuple of the long result and the +ok value.

ulong toULong(bool *ok = 0);

This returns a tuple of the ulong result and the +ok value.

float toFloat(bool *ok = 0);

This returns a tuple of the float result and the +ok value.

double toDouble(bool *ok = 0);

This returns a tuple of the double result and the +ok value.


TQStringList (TQt v2+)

The Python len, [] (for both reading and +writing slices and individual elements), del (for deleting +slices and individual elements), +, +=, +*, *=, ==, +!= and in operators are supported.

Iterator append(const TQString &x);

This does not return a value.

Iterator prepend(const TQString &x);

This does not return a value.


TQStrList

This class isn't implemented. Whenever a TQStrList is the +return type of a function or the type of an argument, a Python list of strings +is used instead.


TQStyle (TQt v2+)

virtual void getButtonShift(int &x, int &y);

This takes no parameters and returns a tuple of the x and +y values. (TQt v2)

virtual void scrollBarMetrics(const TQScrollBar *b, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

Thus takes only the b parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. +(TQt v2)

virtual void tabbarMetrics(const TQTabBar *t, int &hframe, int &vframe, int &overlap);

This takes only the t parameter and returns a tuple of the +hframe, vframe and +overlap values. (TQt v2)


TQStyleOption (TQt v3+)

TQStyleOption is fully implemented.


TQStyleSheet (TQt v2+)

TQStyleSheet is fully implemented.


TQStyleSheetItem (TQt v2+)

TQStyleSheetItem is fully implemented.


TQSyntaxHighlighter (TQt v3.1+)

TQSyntaxHighlighter is fully implemented.


TQTab

TQTab is fully implemented.


TQTabBar

TQPtrList<TQTab> tabList();

This returns a list of TQTab instances.


TQTabDialog

TQTabDialog is fully implemented.


TQTableView (TQt 1.x, TQt 2.x)

bool colXPos(int col, int *xPos);

This takes the col parameter and returns a tuple containing +the bool result and xPos.

bool rowYPos(int row, int *yPos);

This takes the row parameter and returns a tuple containing +the bool result and yPos.


TQTabWidget (TQt v2+)

TQTabWidget is fully implemented.


TQTextBrowser (TQt v2+)

TQTextBrowser is fully implemented.


TQTextCodec (TQt v2+)

virtual TQCString fromUnicode(const TQString &uc, int &lenInOut);

The returned value is a tuple of the TQCString result and the +updated lenInOut.


TQTextDecoder (TQt v2+)

TQTextDecoder is fully implemented.


TQTextEncoder (TQt v2+)

virtual TQCString fromUnicode = 0(const TQString &uc, int &lenInOut);

The returned value is a tuple of the TQCString result and the +updated lenInOut.


TQTextEdit (TQt v3+)

int charAt(const TQPoint &pos, int *para = 0);

This takes only the pos parameter and returns a tuple of the +value returned via the para pointer and the int result.

void del();

This has been renamed delChar in Python.

virtual bool find(const TQString &expr, bool cs, bool wo, bool forward = TRUE, int *para = 0, int *index = 0);

If the para and index 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 +para and index is returned.

void getCursorPosition(int *para, int *index);

This takes no parameters and returns a tuple of the values returned via the +para and index pointers.

void getSelection(int *paraFrom, int *indexFrom, int *paraTo, int *indexTo, int selNum = 0);

This takes only the selNum parameter and returns a tuple of +the paraFrom, indexFrom, +paraTo and indexTo values.


TQTextStream

TQTextStream(FILE *fp, int mode);

Not implemented.

TQTextStream &readRawBytes(char *buf, uint len);

Not yet implemented.

TQTextStream &writeRawBytes(const char *buf, uint len);

Not yet implemented.


TQTextIStream (TQt v2+)

TQTextIStream(FILE *fp, int mode);

Not implemented.


TQTextOStream (TQt v2+)

TQTextOStream(FILE *fp, int mode);

Not implemented.


TQTextView (TQt v2+)

TQTextView is fully implemented.


TQThread (TQt v2.2+)

TQThread is fully implemented.


TQTimer

TQTimer is fully implemented.


TQToolBar

TQToolBar is fully implemented.


TQToolBox (TQt v3.2.0+)

TQToolBox is fully implemented.


TQToolButton

TQToolButton is fully implemented.


TQToolTip

TQToolTip is fully implemented.


TQToolTipGroup

TQToolTipGroup is fully implemented.


TQTranslator (TQt v2+)

TQTranslator is fully implemented.


TQTranslatorMessage (TQt v2.2+)

TQTranslatorMessage is fully implemented.


TQUrl (TQt v2.1+)

TQUrl is fully implemented, including the +TQString(), == and != +operators.


TQUrlInfo (TQt v2.1+)

TQUrlInfo is fully implemented.


TQUrlOperator (TQt v2.1+)

virtual bool isDir(bool *ok);

This returns a tuple of the bool result and the +ok value.


TQUuid (TQt v3.0+)

TQUuid is fully implemented.


TQValidator

virtual State validate(TQString& input, int& pos);

The returned value is a tuple of the State result and the +updated pos.


TQDoubleValidator

State validate(TQString& input, int& pos);

The returned value is a tuple of the State result and the +updated pos.


TQIntValidator

State validate(TQString& input, int& pos);

The returned value is a tuple of the State result and the +updated pos.


TQRegExpValidator (TQt v3+)

virtual State validate(TQString& input, int& pos);

The returned value is a tuple of the State result and the +updated pos.


TQValueList<type> (TQt v2+)

Types based on the TQValueList template are automatically +converted to and from Python lists of the type.


TQVariant (TQt v2.1+)

TQVariant(const char *val);

Not implemented.

TQVariant(const TQBitArray &val);

Not yet implemented. (TQt v3+)

TQVariant(const TQValueList<TQVariant> &val);

Not yet implemented.

TQVariant(const TQMap<TQString,TQVariant> &val);

Not yet implemented.

TQBitArray &asBitArray();

Not yet implemented. (TQt v3+)

bool &asBool();

Not implemented.

double &asDouble();

Not implemented.

int &asInt();

Not implemented.

TQValueList<TQVariant> &asList();

Not implemented.

TQMap<TQString,TQVariant> &asMap();

Not implemented.

uint &asUInt();

Not implemented.

TQValueListConstIterator<TQVariant>listBegin const();

Not implemented.

TQValueListConstIterator<TQVariant>listEnd const();

Not implemented.

TQMapConstIterator<TQString,TQVariant>mapBegin const();

Not implemented.

TQMapConstIterator<TQString,TQVariant>mapEnd const();

Not implemented.

TQMapConstIterator<TQString,TQVariant>mapFind const(const TQString &key);

Not implemented.

TQValueListConstIterator<TQString>stringListBegin const();

Not implemented.

TQValueListConstIterator<TQString>stringListEnd const();

Not implemented.

const TQBitArray toBitArray const();

Not yet implemented. (TQt v3+)

const TQValueList<TQVariant>toList const();

Not yet implemented.

const TQMap<TQString,TQVariant>toMap const();

Not yet implemented.


TQVBox (TQt v2+)

TQVBox is fully implemented.


TQVButtonGroup (TQt v2+)

TQVButtonGroup is fully implemented.


TQVGroupBox (TQt v2+)

TQVGroupBox is fully implemented.


TQWaitCondition (TQt v2.2+)

TQWaitCondition is fully implemented.


TQWhatsThis

TQWhatsThis is fully implemented.


TQWidget

TQWExtra *extraData();

Not implemented.

TQFocusData *focusData();

Not implemented.

void lower();

This has been renamed to lowerW in Python.

void raise();

This has been renamed to raiseW in Python.


TQWidgetList

This class isn't implemented. Whenever a TQWidgetList is the +return type of a function or the type of an argument, a Python list of +instances is used instead.


TQWidgetStack

TQWidgetStack is fully implemented.


TQWindow

TQWindow is fully implemented (TQt v1.x).


TQWindowsStyle (TQt v2+)

void getButtonShift(int &x, int &y);

This takes no parameters and returns a tuple of the x and +y values. (TQt v2)

void scrollBarMetrics(const TQTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);

This takes only the sb parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. +(TQt v2)

void tabbarMetrics(const TQTabBar *t, int &hframe, int &vframe, int &overlap);

This takes only the t parameter and returns a tuple of the +hframe, vframe and +overlap values. (TQt v2)


TQWindowsXPStyle (TQt v3.0.1+, Windows)

TQWindowsXPStyle is fully implemented.


TQWizard (TQt v2+)

TQWizard is fully implemented.


TQWMatrix

The Python ==, != and +*= operators are supported.

TQWMatrix invert const(bool *invertible = 0);

This takes no parameters and returns a tuple of the TQWMatrix +result and the invertible value.

void map const(int x, int y, int *tx, int *ty);

This takes the x and y parameters and +returns a tuple containing the tx and ty +values.

void map const(float x, float y, float *tx, float *ty);

This takes the x and y parameters and +returns a tuple containing the tx and ty +values. (TQt v1.x)

void map const(double x, double y, double *tx, double *ty);

This takes the x and y parameters and +returns a tuple containing the tx and ty +values. (TQt v2+)


TQWorkspace (TQt v2.1+)

TQWorkspace is fully implemented.


tqtaxcontainer Module Reference

TQAxBase (Windows, TQt v3+)

TQAxObject(IUnknown *iface = 0);

Not implemented.

long queryInterface(const TQUuid &uuid, void **iface);

Not implemented.

PropertyBag propertyBag const();

Not implemented.

void setPropertyBag(const PropertyBag &bag);

Not implemented.

unsigned long registerWeakActiveObject(const TQString &guid);

This is a utility method provided by PyTQt to make it easier to use +Mark Hammond's win32com module to manipulate objects +created by the tqtaxcontainer module.

The RegisterActiveObject() COM function is called to +register the TQAxBase instance as a weak object with the +guid GUID. The revoke handle is returned.

static void revokeActiveObject(unsigned long rhandle);

This is a wrapper around the RevokeActiveObject() COM +function and is called to revoke the object registered using +registerWeakActiveObject(). rhandle is +the revoke handle returned by registerWeakActiveObject().


TQAxObject (Windows, TQt v3+)

TQAxObject(IUnknown *iface, TQObject *parent = 0, const char *name = 0);

Not implemented.


TQAxWidget (Windows, TQt v3+)

TQAxWidget(IUnknown *iface, TQWidget *parent = 0, const char *name = 0);

Not implemented.


tqtcanvas Module Reference

TQCanvas (TQt v2.2+)

TQCanvas is fully implemented.


TQCanvasEllipse (TQt v2.2+)

TQCanvasEllipse is fully implemented.


TQCanvasItem (TQt v2.2+)

TQCanvasItem is fully implemented.


TQCanvasItemList (TQt v2.2+)

This class isn't implemented. Whenever a TQCanvasItemList is +the return type of a function or the type of an argument, a Python list of +TQCanvasItem instances is used instead.


TQCanvasLine (TQt v2.2+)

TQCanvasLine is fully implemented.


TQCanvasPixmap (TQt v2.2+)

TQCanvasPixmap is fully implemented.


TQCanvasPixmapArray (TQt v2.2+)

TQPixmapArray(TQPtrList<TQPixmap> pixmaps, TQPtrList<TQPoint> hotspots);

The pixmaps argument is a Python list of TQPixmap instances, +and the hotspots argument is a Python list of TQPoint +instances. (TQt v2.2.0 - TQt v2.3.1)

TQPixmapArray(TQValueList<TQPixmap> pixmaps, TQPointArray hotspots = TQPointArray());

The pixmaps argument is a Python list of TQPixmap instances. +(TQt v3+)


TQCanvasPolygon (TQt v2.2+)

TQCanvasPolygon is fully implemented.


TQCanvasPolygonalItem (TQt v2.2+)

TQCanvasPolygonalItem is fully implemented.


TQCanvasRectangle (TQt v2.2+)

TQCanvasRectangle is fully implemented.


TQCanvasSpline (TQt v3.0+)

TQCanvasSpline is fully implemented.


TQCanvasSprite (TQt v2.2+)

TQCanvasSprite is fully implemented.


TQCanvasText (TQt v2.2+)

TQCanvasText is fully implemented.


TQCanvasView (TQt v2.2+)

TQCanvasView is fully implemented.


tqtext Module Reference

TQextScintilla

void getCursorPosition(int *line, int *index);

This takes no parameters and returns a tuple of the values returned by the +line and index pointers.

void getSelection(int *lineFrom, int *indexFrom, int *lineTo, int *indexTo);

This takes no parameters and returns a tuple of the values returned by the +lineFrom, indexFrom, +lineTo and indexTo pointers.


TQextScintillaAPIs

TQextScintillaAPIs is fully implemented.


TQextScintillaBase

TQextScintillaBase is fully implemented.


TQextScintillaCommand

TQextScintillaCommand is fully implemented.


TQextScintillaCommandSet

TQextScintillaCommandSet is fully implemented.


TQextScintillaDocument

TQextScintillaDocument is fully implemented.


TQextScintillaLexer

TQextScintillaLexer is fully implemented.


TQextScintillaLexerBash (TQScintilla v1.4+)

TQextScintillaLexerBash is fully implemented.


TQextScintillaLexerBatch (TQScintilla v1.6+)

TQextScintillaLexerBatch is fully implemented.


TQextScintillaLexerCPP

TQextScintillaLexerCPP is fully implemented.


TQextScintillaLexerCSharp

TQextScintillaLexerCSharp is fully implemented.


TQextScintillaLexerCSS (TQScintilla v1.6+)

TQextScintillaLexerCSS is fully implemented.


TQextScintillaLexerDiff (TQScintilla v1.6+)

TQextScintillaLexerDiff is fully implemented.


TQextScintillaLexerHTML (TQScintilla v1.1+)

TQextScintillaLexerHTML is fully implemented.


TQextScintillaLexerIDL

TQextScintillaLexerIDL is fully implemented.


TQextScintillaLexerJava

TQextScintillaLexerJava is fully implemented.


TQextScintillaLexerJavaScript

TQextScintillaLexerJavaScript is fully implemented.


TQextScintillaLexerLua (TQScintilla v1.5+)

TQextScintillaLexerLua is fully implemented.


TQextScintillaLexerMakefile (TQScintilla v1.6+)

TQextScintillaLexerMakefile is fully implemented.


TQextScintillaLexerPerl

TQextScintillaLexerPerl is fully implemented.


TQextScintillaLexerPOV (TQScintilla v1.6+)

TQextScintillaLexerPOV is fully implemented.


TQextScintillaLexerProperties (TQScintilla v1.6+)

TQextScintillaLexerProperties is fully implemented.


TQextScintillaLexerPython

TQextScintillaLexerPython is fully implemented.


TQextScintillaLexerRuby (TQScintilla v1.5+)

TQextScintillaLexerRuby is fully implemented.


TQextScintillaLexerSQL (TQScintilla v1.1+)

TQextScintillaLexerSQL is fully implemented.


TQextScintillaLexerTeX (TQScintilla v1.6+)

TQextScintillaLexerTeX is fully implemented.


TQextScintillaMacro

TQextScintillaMacro is fully implemented.


TQextScintillaPrinter

TQextScintillaPrinter is fully implemented.


tqtgl Module Reference

TQGL

TQGL is fully implemented.


TQGLContext

TQGLContext is fully implemented.


TQGLFormat

TQGLFormat is fully implemented.


TQGLWidget

TQGLWidget is fully implemented.


TQGLColormap (TQt v3.0+)

void setEntries(int count, const TQRgb *colors, int base = 0);

Not yet implemented.


tqtnetwork Module Reference

TQDns (TQt v2.2+)

TQDns is fully implemented.


TQFtp (TQt v2.2+)

TQ_LONG readBlock(char *data, TQ_ULONG maxlen);

This takes a single maxlen parameter. The +data is returned if there was no error, otherwise +None is returned.


TQHostAddress (TQt v2.2+)

TQHostAddress(TQ_UINT8 *ip6Addr);

Not yet implemented.

TQHostAddress(const Q_IPV6ADDR &ip6Addr);

Not yet implemented.

void setAddress(TQ_UINT8 *ip6Addr);

Not yet implemented.

Q_IPV6ADDR toIPv6Address const();

Not yet implemented.


TQHttp (TQt v3+)

TQ_LONG readBlock(char *data, TQ_ULONG maxlen);

This takes a single maxlen parameter. The +data is returned if there was no error, otherwise +None is returned.


TQHttpHeader (TQt v3.1+)

TQHttpHeader is fully implemented.


TQHttpRequestHeader (TQt v3.1+)

TQHttpRequestHeader is fully implemented.


TQHttpResponseHeader (TQt v3.1+)

TQHttpResponseHeader is fully implemented.


TQLocalFs (TQt v2.1+)

TQLocalFs is fully implemented.


TQServerSocket (TQt v2.2+)

TQServerSocket is fully implemented.


TQSocket (TQt v2.2+)

TQ_LONG readBlock(char *data, TQ_ULONG len);

This takes a single len parameter. The +data is returned if there was no error, otherwise +Py_None is returned.

TQ_LONG readLine(char *data, TQ_ULONG maxlen);

This takes a single maxlen parameter. The +data is returned if there was no error, otherwise +Py_None is returned.

TQ_LONG writeBlock(const char *data, TQ_ULONG len);

len is derived from data and not passed +as a parameter.


TQSocketDevice (TQt v2.2+)

TQ_LONG readBlock(char *data, TQ_ULONG len);

This takes a single len parameter. The +data is returned if there was no error, otherwise +None is returned.

TQ_LONG writeBlock(const char *data, TQ_ULONG len);

len is derived from data and not passed +as a parameter.


tqtpe Module Reference

TQPEApplication

TQApplication(int& argc, char **argv, Type type);

This takes two parameters, the first of which is a list of argument strings. +Arguments used by TQt are removed from the list.

int exec();

This has been renamed to exec_loop in Python.


AppLnk

virtual TQString exec const();

This has been renamed to exec_property in Python.


AppLnkSet

AppLnkSet is fully implemented.


Config

Config is fully implemented.


DateFormat

DateFormat is fully implemented.


DocLnk

TQString exec const();

This has been renamed to exec_property in Python.


DocLnkSet

DocLnkSet is fully implemented.


FileManager

FileManager is fully implemented.


FileSelector

FileSelector is fully implemented.


FileSelectorItem

FileSelectorItem is fully implemented.


FontDatabase

FontDatabase is fully implemented.


Global

static void setBuiltinCommands(Command *);

Not implemented.


MenuButton

MenuButton is fully implemented.


TQCopEnvelope

TQCopEnvelope is fully implemented.


TQDawg

TQDawg is fully implemented.


TQPEMenuBar

TQPEMenuBar is fully implemented.


TQPEToolBar

TQPEToolBar is fully implemented.


Resource

Resource is fully implemented.


tqtsql Module Reference

TQDataBrowser (TQt v3+)

virtual void del();

This has been renamed delOnCursor in Python.


TQDataTable (TQt v3+)

TQDataTable is fully implemented.


TQDataView (TQt v3+)

TQDataView is fully implemented.


TQEditorFactory (TQt v3+)

TQEditorFactory is fully implemented.


TQSql (TQt v3+)

TQSql is fully implemented.


TQSqlCursor (TQt v3+)

virtual int del(bool invalidate = TRUE);

This has been renamed delRecords in Python.

virtual int del(const TQString &filter, bool invalidate = TRUE);

This has been renamed delRecords in Python.

bool exec(const TQString &query);

This has been renamed execQuery in Python.


TQSqlDatabase (TQt v3+)

TQSqlQuery exec(const TQString &query = TQString::null);

This has been renamed execStatement in Python.


TQSqlDriver (TQt v3+)

TQSqlDriver is fully implemented.


TQSqlEditorFactory (TQt v3+)

TQSqlEditorFactory is fully implemented.


TQSqlError (TQt v3+)

TQSqlError is fully implemented.


TQSqlField (TQt v3+)

TQSqlField is fully implemented.


TQSqlFieldInfo (TQt v3+)

TQSqlFieldInfo is fully implemented.


TQSqlForm (TQt v3+)

TQSqlForm is fully implemented.


TQSqlIndex (TQt v3+)

TQSqlIndex is fully implemented.


TQSqlPropertyMap (TQt v3+)

TQSqlPropertyMap is fully implemented. However, because PyTQt +does not allow new properties to be defined, it is not possible to implement +custom editor widgets in Python and add them to a property map. This will +simple be ignored.

This problem may be addressed in a future release of PyTQt.


TQSqlQuery (TQt v3+)

TQMap<TQString,TQVariant> boundValues const();

Not yet implemented. (TQt v3.2.0+)

virtual bool exec(const TQString &query);

This has been renamed execQuery in Python.

bool exec();

This has been renamed execQuery in Python. (TQt v3.1+)


TQSqlRecord (TQt v3+)

TQSqlRecord is fully implemented.


TQSqlRecordInfo (TQt v3+)

TQSqlRecordInfo is implemented as a Python list of +TQSqlFieldInfo instances.


TQSqlResult (TQt v3+)

TQSqlResult is fully implemented.


TQSqlSelectCursor (TQt v3.2.0+)

int del(bool invalidate = TRUE);

This has been renamed delRecords in Python.

bool exec(const TQString &query);

This has been renamed execQuery in Python.


tqttable Module Reference

TQTable (TQt v2.2+)

TQTable is fully implemented.


TQTableItem (TQt v2.2+)

TQTableItem is fully implemented.


TQCheckTableItem (TQt v3+)

TQCheckTableItem is fully implemented.


TQComboTableItem (TQt v3+)

TQComboTableItem is fully implemented.


TQTableSelection (TQt v2.2+)

TQTableSelection is fully implemented.


tqtui Module Reference

TQWidgetFactory (TQt v3+)

TQWidgetFactory is fully implemented.


tqtxml Module Reference

TQDomImplementation (TQt v2.2+)

TQDomImplementation is fully implemented.


TQDomNode (TQt v2.2+)

TQDomNode is fully implemented, including the Python +== and != operators.


TQDomNodeList (TQt v2.2+)

TQDomNodeList is fully implemented.


TQDomDocument (TQt v2.2+)

bool setContent(const TQCString &buffer, bool namespaceProcessing, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

This takes the buffer and +namespaceProcessing parameters and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+)

bool setContent(const TQByteArray &buffer, bool namespaceProcessing, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

This takes the buffer and +namespaceProcessing parameters and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+)

bool setContent(const TQString &text, bool namespaceProcessing, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

This takes the text and +namespaceProcessing parameters and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+)

bool setContent(const TQIODevice *dev, bool namespaceProcessing, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

This takes the dev and +namespaceProcessing parameters and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+)

bool setContent(const TQCString &buffer, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

This takes the buffer parameter only and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+)

bool setContent(const TQByteArray &buffer, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

This takes the buffer parameter only and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+)

bool setContent(const TQString &text, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

This takes the text parameter only and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+)

bool setContent(const TQIODevice *dev, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

This takes the dev parameter only and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+)

bool setContent(TQXmlInputSource *source, TQXmlReader *reader, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);

Not yet implemented. (TQt v3.2.0+)


TQDomDocumentFragment (TQt v2.2+)

TQDomDocumentFragment is fully implemented.


TQDomDocumentType (TQt v2.2+)

TQDomDocumentType is fully implemented.


TQDomNamedNodeMap (TQt v2.2+)

TQDomNamedNodeMap is fully implemented.


TQDomCharacterData (TQt v2.2+)

TQDomCharacterData is fully implemented.


TQDomAttr (TQt v2.2+)

TQDomAttr is fully implemented.


TQDomElement (TQt v2.2+)

TQDomElement is fully implemented.


TQDomText (TQt v2.2+)

TQDomText is fully implemented.


TQDomComment (TQt v2.2+)

TQDomComment is fully implemented.


TQDomCDATASection (TQt v2.2+)

TQDomCDATASection is fully implemented.


TQDomNotation (TQt v2.2+)

TQDomNotation is fully implemented.


TQDomEntity (TQt v2.2+)

TQDomEntity is fully implemented.


TQDomEntityReference (TQt v2.2+)

TQDomEntityReference is fully implemented.


TQDomProcessingInstruction (TQt v2.2+)

TQDomProcessingInstruction is fully implemented.

diff --git a/doc/PyTQt.sgml b/doc/PyTQt.sgml new file mode 100644 index 0000000..2e26209 --- /dev/null +++ b/doc/PyTQt.sgml @@ -0,0 +1,5807 @@ + +
+ + Python Bindings for TQt (3.18.1) + + Phil + Thompson + + + + This document describes a set of Python bindings for the TQt widget set. + Contact the author at phil@riverbankcomputing.co.uk. + + + + + +Introduction + +PyTQt is a set of Python bindings for the TQt toolkit and available for all +platforms supported by TQt, including Windows, Linux, UNIX, MacOS/X and embedded +systems such as the Sharp Zaurus and the Compaq iPAQ. They have been tested +against TQt versions 1.43 to 3.3.6, TQt Non-commercial, TQtopia 1.5.0, and Python +versions 1.5 to 2.4.2. TQt/Embedded v3 is not supported. TQt v4 is supported +by PyTQt v4. + + + +PyTQt is available under the GPL license for use with the GPL version of TQt, a +a commercial license for use with the commercial version of TQt, a +non-commercial license for use with the non-commercial version of TQt v2, and an +educational license for use with the educational version of TQt. + + + +There is also an evaluation version of PyTQt for Windows. This must be used +with the corresponding evaluation version of TQt. + + + +PyTQt is built using SIP (a tool for generating Python extension modules for +C++ class libraries). SIP v4.6 or later must be installed in order to build +and run this version of PyTQt. + + + +PyTQt for MacOS/X requires TQt v3.1.0 or later and Python v2.3 or later. + + + +The bindings are implemented as a number of Python modules + + + + + +tqt is the main module and contains the core classes and most +user interface widgets. + + + + + +tqtaxcontainer contains a sub-set of the classes implemented +in TQt's TQAxContainer module, part of TQt's ActiveTQt framework. + + + + + +tqtcanvas contains the classes implemented in TQt's Canvas +module. + + + + + +tqtgl contains the classes implemented in TQt's OpenGL module. + + + + + +tqtnetwork contains the classes implemented in TQt's Network +module. + + + + + +tqtpe contains the classes implemented in TQtopia (originally +called the TQt Palmtop Environment). It is only supported with TQt/Embedded. + + + + + +tqtsql contains the classes implemented in TQt's SQL module. + + + + + +tqttable contains the classes implemented in TQt's Table +module. + + + + + +tqtui contains the classes implemented in TQt's tqui library. +These allow GUIs to be created directly from TQt Designer's +.ui files. + + + + + +tqtxml contains the classes implemented in TQt's XML module. + + + + + +tqtext contains useful third-party classes that are not part +of TQt. At the moment it contains bindings for TQScintilla, the port to TQt of +the Scintilla programmer's editor class. + + + + + +PyTQt also includes the pytquic and +pytqlupdate utilities which correspond to the TQt +uic and lupdate utilities. +pytquic converts the GUI designs created with TQt Designer to +executable Python code. pytqlupdate scans Python code, +extracts all strings that are candidates for internationalisation, and creates +an XML file for use by TQt Linguist. + + +Changes + +The changes visible to the Python programmer in this release are as follows. + + + + + +This version requires SIP v4.4 (or later). + + + + + +Concatenating Python strings and TQStrings is now supported. + + + + + +TQString now supports the * and +*= operators that behave as they do for Python strings. + + + + + +TQString is more interoperable with Python string and unicode +objects. For example they can be passed as arguments to +open() and to most (but not all) string methods. + + + + + +TQPopupMenu (and sub-classes) instances now transfer +ownership of the menu to Python in the call to exec_loop(). +This means the menu's resources are all released when the Python wrapper is +garbage collected without needing to call +TQObject.deleteLater(). + + + + + +TQObject.sender() now handles Python signals. + + + + + +The missing MacintoshVersion enum has been added. + + + + + +PYTQT_BUILD has been removed. + + + + + +The convention for converting between a C/C++ null pointer and Python's +None object has now been universally applied. In previous +versions a null pointer to, for example, a TQt list container would often be +converted to an empty list rather than None. + + + + + + + + +Other PyTQt Goodies +Using TQt Designer + +TQt Designer is a GPL'ed GUI design editor provided by Trolltech as part of TQt. +It generates an XML description of a GUI design. TQt includes +uic which generates C++ code from that XML. + + + +PyTQt includes pytquic which generates Python code from the +same XML. The Python code is self contained and can be executed immediately. + + + +It is sometimes useful to be able to include some specific Python code in the +output generated by pytquic. For example, if you are using +custom widgets, pytquic has no way of knowing the name of the +Python module containing the widget and so cannot generate the required +import statement. To help get around this, +pytquic will extract any lines entered in the +Comment field of TQt Designer's +Form Settings dialog that begin with +Python: and copies them to the generated output. + + + +Here's a simple example showing the contents of the Comment +field. + + + +This comment will be ignored by pytquic. +Python: +Python:# Import our custom widget. +Python:from foo import bar + + + +Here's the corresponding output from pytquic. + + + +from PyTQt.tqt import * + +# Import our custom widget. +from foo import bar + + + +Thanks to Christian Bird, pytquic will extract Python code +entered using TQt Designer to implement slots. In TQt Designer, when you need to +edit a slot and the source editor appears, enter Python code between the curly +braces. Don't worry about the correct starting indent level, each line is +prepended with a correct indentation. + + + +Make sure that the ui.h file is in the same directory as the +.ui file when using pytquic. The +.ui file implies the name of the .ui.h +file so there is no need to specify it on the command line. + + + +Here's an example of a simple slot. + + + +void DebMainWindowFrm::browsePushButtonClicked() +{ +if self.debugging: + TQMessageBox.critical(self, "Event", "browse pushbutton was clicked!") +} + + + +Here is the resulting code when pytquic is run. + + + +class DebMainWindowFrm(TQMainWindow): + ...stuff... + def browsePushButtonClicked(self): + if self.debugging: + TQMessageBox.critical(self, "Event", "browse pushbutton was clicked!") + + + +Note that indenting is as normal and that self and all other +parameters passed to the slot are available. + + + +If you use this, you will need to turn off all of the fancy options for the C++ +editor in Designer as it tries to force C++ syntax and that's naturally +annoying when trying to code in Python. + + + +Using TQt Linguist + +TQt includes the lupdate program which parses C++ source +files converting calls to the QT_TR_NOOP() and +QT_TRANSLATE_NOOP() macros to .ts +language source files. The lrelease program is then used to +generate .qm binary language files that are distributed with +your application. + + + +Thanks to Detlev Offenbach, PyTQt includes the pytqlupdate +program. This generates the same .ts language source files +from your PyTQt source files. + + + + + +Deploying Commercial PyTQt Applications + +When deploying commercial PyTQt applications it is necessary to discourage users +from accessing the underlying PyTQt modules for themselves. A user that used +the modules shipped with your application to develop new applications would +themselves be considered a developer and would need their own commercial TQt and +PyTQt licenses. + + + +One solution to this problem is the +VendorID +package. This allows you to build Python extension modules that can only be +imported by a digitally signed custom interpreter. The package enables you to +create such an interpreter with your application embedded within it. The +result is an interpreter that can only run your application, and PyTQt modules +that can only be imported by that interpreter. You can use the package to +similarly restrict access to any extension module. + + + +In order to build PyTQt with support for the VendorID package, pass the +-i command line flag to configure.py. + + + +<Literal>pytqtconfig</Literal> and Build System Support + +The SIP build system (ie. the sipconfig module) is described +in the SIP documentation. PyTQt includes the pytqtconfig +module that can be used by configuration scripts of other bindings that are +built on top of PyTQt. + + + +The pytqtconfig module contains the following classes: + + + + +Configuration(sipconfig.Configuration) + + +This class encapsulates additional configuration values, specific to PyTQt, that +can be accessed as instance variables. + + + +The following configuration values are provided (in addition to those provided +by the sipconfig.Configuration class): + + + + +pytqt_bin_dir + + +The name of the directory containing the pytquic and +pytqlupdate executables. + + + + + + +pytqt_config_args + + +The command line passed to configure.py when PyTQt was +configured. + + + + + + +pytqt_mod_dir + + +The name of the directory containing the PyTQt modules. + + + + + + +pytqt_modules + + +A string containing the names of the PyTQt modules that were installed. + + + + + + +pytqt_tqt_sip_flags + + +A string of the SIP flags used to generate the code for the +tqt module and which should be added to those needed by any +module that imports the tqt module. + + + + + + +pytqt_tqtaxcontainer_sip_flags + + +A string of the SIP flags used to generate the code for the +tqtaxcontainer module and which should be added to those +needed by any module that imports the tqtaxcontainer module. + + + + + + +pytqt_tqtcanvas_sip_flags + + +A string of the SIP flags used to generate the code for the +tqtcanvas module and which should be added to those needed by +any module that imports the tqtcanvas module. + + + + + + +pytqt_tqtext_sip_flags + + +A string of the SIP flags used to generate the code for the +tqtext module and which should be added to those needed by +any module that imports the tqtext module. + + + + + + +pytqt_tqtgl_sip_flags + + +A string of the SIP flags used to generate the code for the +tqtgl module and which should be added to those needed by any +module that imports the tqtgl module. + + + + + + +pytqt_tqtnetwork_sip_flags + + +A string of the SIP flags used to generate the code for the +tqtnetwork module and which should be added to those needed +by any module that imports the tqtnetwork module. + + + + + + +pytqt_tqtsql_sip_flags + + +A string of the SIP flags used to generate the code for the +tqtsql module and which should be added to those needed by +any module that imports the tqtsql module. + + + + + + +pytqt_tqttable_sip_flags + + +A string of the SIP flags used to generate the code for the +tqttable module and which should be added to those needed by +any module that imports the tqttable module. + + + + + + +pytqt_tqtui_sip_flags + + +A string of the SIP flags used to generate the code for the +tqtui module and which should be added to those needed by any +module that imports the tqtui module. + + + + + + +pytqt_tqtxml_sip_flags + + +A string of the SIP flags used to generate the code for the +tqtxml module and which should be added to those needed by +any module that imports the tqtxml module. + + + + + + +pytqt_sip_dir + + +The name of the base directory where the .sip files for each +of the PyTQt modules is installed. A sub-directory exists with the same name as +the module. + + + + + + +pytqt_version + + +The PyTQt version as a 3 part hexadecimal number (eg. v3.10 is represented as +0x030a00). + + + + + + +pytqt_version_str + + +The PyTQt version as a string. For development snapshots it will start with +snapshot-. + + + + + + + + + + +TQtModuleMakefile(sipconfig.SIPModuleMakefile) + + +The Makefile class for modules that import the tqt module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + +TQtAxContainerModuleMakefile(TQtModuleMakefile) + + +The Makefile class for modules that import the tqtaxcontainer +module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + +TQtCanvasModuleMakefile(TQtModuleMakefile) + + +The Makefile class for modules that import the tqtcanvas +module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + +TQtExtModuleMakefile(TQtModuleMakefile) + + +The Makefile class for modules that import the tqtext module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + +TQtGLModuleMakefile(TQtModuleMakefile) + + +The Makefile class for modules that import the tqtgl module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + +TQtNetworkModuleMakefile(TQtModuleMakefile) + + +The Makefile class for modules that import the tqtnetwork +module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + +TQtTableModuleMakefile(TQtModuleMakefile) + + +The Makefile class for modules that import the tqttable +module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + +TQtSQLModuleMakefile(TQtTableModuleMakefile) + + +The Makefile class for modules that import the tqtsql module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + +TQtUIModuleMakefile(TQtModuleMakefile) + + +The Makefile class for modules that import the tqtui module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + +TQtXMLModuleMakefile(TQtModuleMakefile) + + +The Makefile class for modules that import the tqtxml module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + + +Things to be Aware Of +super and Wrapped Classes + +Internally PyTQt implements a lazy technique for attribute lookup where +attributes are only placed in type and instance dictionaries when they are +first referenced. This technique is needed to reduce the time taken to import +large modules such as PyTQt. + + + +In most circumstances this technique is transparent to an application. The +exception is when super is used with a PyTQt class. The way +that super is currently implemented means that the lazy +lookup is bypassed resulting in AttributeError exceptions +unless the attribute has been previously referenced. + + + +Note that this restriction applies to any class wrapped by SIP and not just +PyTQt. + + + + +Python Strings, TQt Strings and Unicode + +Unicode support was added to TQt in v2.0 and to Python in v1.6. In TQt, Unicode +support is implemented using the TQString class. It is +important to understand that TQStrings, Python string objects +and Python Unicode objects are all different but conversions between them are +automatic in almost all cases and easy to achieve manually when needed. + + + +Whenever PyTQt expects a TQString as a function argument, a +Python string object or a Python Unicode object can be provided instead, and +PyTQt will do the necessary conversion automatically. + + + +You may also manually convert Python string and Unicode objects to +TQStrings by using the TQString constructor +as demonstrated in the following code fragment. + + + +qs1 = TQString('Converted Python string object') +qs2 = TQString(u'Converted Python Unicode object') + + + +In order to convert a TQString to a Python string object use +the Python str() function. Applying +str() to a null TQString and an empty +TQString both result in an empty Python string object. + + + +In order to convert a TQString to a Python Unicode object use +the Python unicode() function. Applying +unicode() to a null TQString and an empty +TQString both result in an empty Python Unicode object. + + + +Access to Protected Member Functions + +When an instance of a C++ class is not created from Python it is not possible +to access the protected member functions, or emit the signals, of that +instance. Attempts to do so will raise a Python exception. Also, any Python +methods corresponding to the instance's virtual member functions will never be +called. + + + +<Literal>None</Literal> and <Literal>NULL</Literal> + +Throughout the bindings, the None value can be specified +wherever NULL is acceptable to the underlying C++ code. + + + +Equally, NULL is converted to None +whenever it is returned by the underlying C++ code. + + + + +Support for C++ <Literal>void *</Literal> Data Types + +PyTQt represents void * values as objects of type +sip.voidptr. Such values are often used to pass the +addresses of external objects between different Python modules. To make this +easier, a Python integer (or anything that Python can convert to an integer) +can be used whenever a sip.voidptr is expected. + + +A sip.voidptr may be converted to a Python integer by using +the int() builtin function. + + +A sip.voidptr may be converted to a Python string by using +its asstring() method. The asstring() +method takes an integer argument which is the length of the data in bytes. + + + + +Support for Threads + +PyTQt implements the full set of TQt's thread classes. Python, of course, also +has its own thread extension modules. If you are using SIP v4 (or later) and +Python v2.3.5 (or later) then PyTQt does not impose any additional restrictions. +(Read the relevant part of the TQt documentation to understand the restrictions +imposed by the TQt API.) + + +If you are using earlier versions of either SIP or Python then it is possible +to use either of the APIs so long as you follow some simple rules. + + + + +If you use the TQt API then the very first import of one of +the PyTQt modules must be done from the main thread. + + + + +If you use the Python API then all calls to PyTQt (including any +imports) must be done from one thread only. Therefore, if +you want to make calls to PyTQt from several threads then you must use the TQt +API. + + + + +If you want to use both APIs in the same application then all calls to PyTQt +must be done from threads created using the TQt API. + + + + +The above comments actually apply to any SIP generated module, not just PyTQt. + + + +Garbage Collection + +C++ does not garbage collect unreferenced class instances, whereas Python does. +In the following C++ fragment both colours exist even though the first can no +longer be referenced from within the program: + + + +c = new TQColor(); +c = new TQColor(); + + + +In the corresponding Python fragment, the first colour is destroyed when +the second is assigned to c: + + + +c = TQColor() +c = TQColor() + + + +In Python, each colour must be assigned to different names. Typically this +is done within class definitions, so the code fragment would be something like: + + + +self.c1 = TQColor() +self.c2 = TQColor() + + + +Sometimes a TQt class instance will maintain a pointer to another instance and +will eventually call the destructor of that second instance. The most common +example is that a TQObject (and any of its sub-classes) keeps +pointers to its children and will automatically call their destructors. In +these cases, the corresponding Python object will also keep a reference to the +corresponding child objects. + + + +So, in the following Python fragment, the first TQLabel is +not destroyed when the second is assigned to l because the +parent TQWidget still has a reference to it. + + + +p = TQWidget() +l = TQLabel('First label',p) +l = TQLabel('Second label',p) + + + +C++ Variables + +Access to C++ variables is supported. They are accessed as Python instance +variables. For example: + + + +tab = TQTab() +tab.label = "First Tab" +tab.r = TQRect(10,10,75,30) + + + +Global variables and static class variables are effectively read-only. They +can be assigned to, but the underlying C++ variable will not be changed. This +may change in the future. + + + +Access to protected C++ class variables is not supported. This may change in +the future. + + + +Multiple Inheritance + +It is not possible to define a new Python class that sub-classes from more than +one TQt class. + + + +i18n Support + +TQt implements i18n support through the TQt Linguist application, the +TQTranslator class, and the +TQApplication::translate(), TQObject::tr() +and TQObject::trUtf8() methods. Usually the +tr() method is used to obtain the correct translation of a +message. The translation process uses a message context to allow the same +message to be translated differently. tr() is actually +generated by moc and uses the hardcoded class name as the +context. On the other hand, TQApplication::translate() +allows to context to be explicitly stated. + + + +Unfortunately, because of the way TQt implents tr() (and +trUtf8()) it is not possible for PyTQt to exactly reproduce +its behavour. The PyTQt implementation of tr() (and +trUtf8()) uses the class name of the instance as the +context. The key difference, and the source of potential problems, is that the +context is determined dynamically in PyTQt, but is hardcoded in TQt. In other +words, the context of a translation may change depending on an instance's class +hierarchy. + + + +class A(TQObject): + def __init__(self): + TQObject.__init__(self) + + def hello(self): + return self.tr("Hello") + +class B(A): + def __init__(self): + A.__init__(self) + +a = A() +a.hello() + +b = B() +b.hello() + + + +In the above the message is translated by a.hello() using a +context of A, and by b.hello() using a +context of B. In the equivalent C++ version the context +would be A in both cases. + + + +The PyTQt behaviour is unsatisfactory and may be changed in the future. It is +recommended that TQApplication.translate() be used in +preference to tr() (and trUtf8()). This +is guaranteed to work with current and future versions of PyTQt and makes it +much easier to share message files between Python and C++ code. Below is the +alternative implementation of A that uses +TQApplication.translate(). + + + +class A(TQObject): + def __init__(self): + TQObject.__init__(self) + + def hello(self): + return tqApp.translate("A","Hello") + + + +Note that the code generated by pytquic uses +TQApplication.translate(). + + + + + +Signal and Slot Support + +A signal may be either a TQt signal (specified using +SIGNAL()) or a Python signal (specified using +PYSIGNAL()). + + + +A slot can be either a Python callable object, a TQt signal (specified using +SIGNAL()), a Python signal (specified using +PYSIGNAL()), or a TQt slot (specified using +SLOT()). + + + +You connect signals to slots (and other signals) as you would from C++. For +example: + + + +TQObject.connect(a,SIGNAL("TQtSig()"),pyFunction) +TQObject.connect(a,SIGNAL("TQtSig()"),pyClass.pyMethod) +TQObject.connect(a,SIGNAL("TQtSig()"),PYSIGNAL("PySig")) +TQObject.connect(a,SIGNAL("TQtSig()"),SLOT("TQtSlot()")) +TQObject.connect(a,PYSIGNAL("PySig"),pyFunction) +TQObject.connect(a,PYSIGNAL("PySig"),pyClass.pyMethod) +TQObject.connect(a,PYSIGNAL("PySig"),SIGNAL("TQtSig()")) +TQObject.connect(a,PYSIGNAL("PySig"),SLOT("TQtSlot()")) + + + +When a slot is a Python method that corresponds to a TQt slot then a signal can +be connected to either the Python method or the TQt slot. The following +connections achieve the same effect. + + + +sbar = TQScrollBar() +lcd = TQLCDNumber() + +TQObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd.display) +TQObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd,SLOT("display(int)")) + + + +The difference is that the second connection is made at the C++ level and is +more efficient. + + + +Disconnecting signals works in exactly the same way. + + + +Any instance of a class that is derived from the TQObject +class can emit a signal using the emit method. This takes +two arguments. The first is the Python or TQt signal, the second is a Python +tuple which are the arguments to the signal. For example: + + + +a.emit(SIGNAL("clicked()"),()) +a.emit(PYSIGNAL("pySig"),("Hello","World")) + + + +Note that when a slot is a Python callable object its reference count is not +increased. This means that a class instance can be deleted without having to +explicitly disconnect any signals connected to its methods. However, it also +means that using lambda expressions as slots will not work unless you keep a +separate reference to the expression to prevent it from being immediately +garbage collected. + + + +TQt allows a signal to be connected to a slot that requires fewer arguments than +the signal passes. The extra arguments are quietly discarded. Python slots +can be used in the same way. + + + + +Static Member Functions + +Static member functions are implemented as Python class functions. +For example the C++ static member function +TQObject::connect() is called from Python as +TQObject.connect() or self.connect() if +called from a sub-class of TQObject. + + + + +Enumerated Types + +Enumerated types are implemented as a set of simple variables corresponding to +the separate enumerated values. + + + +When using an enumerated value the name of the class (or a sub-class) in which +the enumerated type was defined in must be included. For example: + + + +TQt.SolidPattern +TQWidget.TabFocus +TQFrame.TabFocus + + + + +Module Reference Documentation + +The following sections should be used in conjunction with the normal class +documentation - only the differences specific to the Python bindings are +documented here. + + + +In these sections, Not yet implemented +implies that the feature can be easily implemented if needed. Not +implemented implies that the feature will not be implemented, either +because it cannot be or because it is not appropriate. + + + +If a class is described as being fully implemented then +all non-private member functions and all public class variables have been +implemented. + + + +If an operator has been implemented then it is stated explicitly. + + + +Classes that are not mentioned have not yet been implemented. + + + + +<Literal>tqt</Literal> Module Reference +TQt Constants + +All constant values defined by TQt have equivalent constants defined to Python. + + +TQt (TQt v2+) + +TQt is fully implemented. + + +TQAccel + +TQAccel is fully implemented. + + +TQAction (TQt v2.2+) + +TQAction is fully implemented. + + + +TQActionGroup (TQt v2.2+) + +TQActionGroup is fully implemented. + + +TQApplication + + TQApplication + int &argc + char **argv + + +This takes one parameter which is a list of argument strings. Arguments +used by TQt are removed from the list. + + + + TQApplication + int &argc + char **argv + bool GUIenabled + + +This takes two parameters, the first of which is a list of argument strings. +Arguments used by TQt are removed from the list. + + + + TQApplication + int &argc + char **argv + Type type + + +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+) + + + + int exec + + + +This has been renamed to exec_loop in Python. + + +TQAssistantClient (TQt v3.1+) + +TQAssistantClient is fully implemented. + + +TQBitmap + +TQBitmap is fully implemented. + + +TQBrush + +TQBrush is fully implemented, including the Python +== and != operators. + + +TQButton + +TQButton is fully implemented. + + +TQButtonGroup + +TQButtonGroup is fully implemented. + + +TQByteArray + +A Python string can be used whenever a TQByteArray can be +used. A TQByteArray can be converted to a Python string +using the Python str() function. + + + + TQByteArray &assign + const char *data + uint size + + +Not implemented. + + + + char &at + uint i + + +Not yet implemented. + + + + int contains + const char &d + + +Not yet implemented. + + + + bool fill + const char &d + int size = -1 + + +Not yet implemented. + + + + int find + const char &d + uint i = 0 + + +Not yet implemented. + + + + void resetRawData + const char *data + uintsize + + +Not implemented. + + + + TQByteArray &setRawData + const char *data + uintsize + + +Not implemented. + + +TQCDEStyle (TQt v2+) + +TQCDEStyle is fully implemented. + + +TQCheckBox + +TQCheckBox is fully implemented. + + +TQClipboard + + void *data const + const char *format + + +Not yet implemented (TQt v1.x). + + + + void setData + const char *format + void * + + +Not yet implemented (TQt v1.x). + + +TQColor + +The Python == and != operators are +supported. + + + + void getHsv + int *h + int *s + int *v + + +This takes no parameters and returns the h, +s and v values as a tuple. + + + + void getRgb + int *r + int *g + int *b + + +This takes no parameters and returns the r, +g and b values as a tuple. + + + + void hsv + int *h + int *s + int *v + + +This takes no parameters and returns the h, +s and v values as a tuple. + + + + void rgb + int *r + int *g + int *b + + +This takes no parameters and returns the r, +g and b values as a tuple. + + +TQColorDialog (TQt v2+) + + static TQRgb getRgba + TQRgb initial + bool *ok + TQWidget *parent = 0 + const char *name = 0 + + +This takes the initial, parent and +name parameters and returns a tuple containing the +TQRgb result and the ok value. + + +TQColorGroup + +TQColorGroup is fully implemented. + + +TQComboBox + +TQComboBox is fully implemented. + + +TQCommonStyle (TQt v2+) + + virtual void getButtonShift + int &x + int &y + + +This takes no parameters and returns a tuple of the x and +y values. (TQt v2) + + + + virtual void tabbarMetrics + const TQTabBar *t + int &hframe + int &vframe + int &overlap + + +This takes only the t parameter and returns a tuple of the +hframe, vframe and +overlap values. (TQt v2) + + +TQCString (TQt v2+) + +A Python string can be used whenever a TQCString can be used. +A TQCString can be converted to a Python string using the +Python str() function. + + + + TQCString &sprintf + const char *format + ... + + +Not implemented. + + + + short toShort + bool *ok = 0 + + +This returns a tuple of the short result and the +ok value. + + + + ushort toUShort + bool *ok = 0 + + +This returns a tuple of the ushort result and the +ok value. + + + + int toInt + bool *ok = 0 + + +This returns a tuple of the int result and the +ok value. + + + + uint toUInt + bool *ok = 0 + + +This returns a tuple of the uint result and the +ok value. + + + + long toLong + bool *ok = 0 + + +This returns a tuple of the long result and the +ok value. + + + + ulong toULong + bool *ok = 0 + + +This returns a tuple of the ulong result and the +ok value. + + + + float toFloat + bool *ok = 0 + + +This returns a tuple of the float result and the +ok value. + + + + double toDouble + bool *ok = 0 + + +This returns a tuple of the double result and the +ok value. + + +TQCursor + +TQCursor is fully implemented. + + +TQDataStream + + TQDataStream &readBytes + const char *&s + uint &l + + +This takes no parameters. The TQDataStream result and the +data read are returned as a tuple. + + + + TQDataStream &readRawBytes + const char *s + uint l + + +This takes only the l parameter. The +TQDataStream result and the data read are returned as a +tuple. + + + + TQDataStream &writeBytes + const char *s + uint len + + +len is derived from s and not passed as a +parameter. + + + + TQDataStream &writeRawBytes + const char *s + uint len + + +len is derived from s and not passed as a +parameter. + + +TQDate + +The Python +==, !=, +<, <=, +>, >= +and __nonzero__ +operators are supported. + + + + int weekNumber + int *yearNum = 0 + + +This takes no parameters and returns the week number and the year number as a +tuple. (TQt v3.1+) + + + +TQDateTime + +TQDateTime is fully implemented, including the Python +==, !=, +<, <=, +>, >= +and __nonzero__ +operators. + + + +TQTime + +TQTime is fully implemented, including the Python +==, !=, +<, <=, +>, >= +and __nonzero__ +operators. + + +TQDateEdit (TQt v3+) + +TQDateEdit is fully implemented. + + + +TQTimeEdit (TQt v3+) + +TQTimeEdit is fully implemented. + + + +TQDateTimeEdit (TQt v3+) + +TQDateTimeEdit is fully implemented. + + +TQDesktopWidget (TQt v3+) + +TQDesktopWidget is fully implemented. + + +TQDial (TQt v2.2+) + +TQDial is fully implemented. + + +TQDialog + + int exec + + + +This has been renamed to exec_loop in Python. + + +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 +TQObject.deleteLater() or other techniques. + + +TQDir + +TQDir is fully implemented, including the Python +len, [] (for reading slices and +individual elements), ==, != and +in operators + + + +TQFileInfoList + +This class isn't implemented. Whenever a TQFileInfoList is +the return type of a function or the type of an argument, a Python list of +TQFileInfo instances is used instead. + + +TQDockArea (TQt v3+) + + bool hasDockWindow const + TQDockWindow *w + int *index = 0 + + +This takes the w parameter and returns the index of the +TQDockWIndow or -1 if the TQDockArea does not contain the TQDockWindow. + + +TQDockWindow (TQt v3+) + +TQDockWindow is fully implemented. + + +TQColorDrag (TQt v2.1+) + +TQColorDrag is fully implemented. + + + +TQDragObject + +TQDragObject is fully implemented. + + + +TQImageDrag + +TQImageDrag is fully implemented. + + + +TQStoredDrag + +TQStoredDrag is fully implemented. + + + +TQTextDrag + +TQTextDrag is fully implemented. + + + +TQUriDrag (TQt v2+) + +TQUriDrag is fully implemented. + + + +TQUrlDrag (TQt v1.x) + +TQUrlDrag is fully implemented. + + +TQDropSite + +TQDropSite is fully implemented. + + +TQErrorMessage (TQt v3+) + +TQErrorMessage is fully implemented. + + +TQEvent + +TQEvent is fully implemented. + + +Instances of TQEvents are automatically converted to the +correct sub-class. + + + +TQChildEvent + +TQChildEvent is fully implemented. + + + +TQCloseEvent + +TQCloseEvent is fully implemented. + + + +TQIconDragEvent (TQt v3.3+) + +TQIconDragEvent is fully implemented. + + + +TQContextMenuEvent (TQt v3+) + +TQContextMenuEvent is fully implemented. + + + +TQCustomEvent + +TQCustomEvent is fully implemented. Any Python object can be +passed as the event data and its reference count is increased. + + + +TQDragEnterEvent + +TQDragEnterEvent is fully implemented. + + + +TQDragLeaveEvent + +TQDragLeaveEvent is fully implemented. + + + +TQDragMoveEvent + +TQDragMoveEvent is fully implemented. + + + +TQDropEvent + +TQDropEvent is fully implemented. + + + +TQFocusEvent + +TQFocusEvent is fully implemented. + + + +TQHideEvent + +TQHideEvent is fully implemented. + + + +TQIMComposeEvent (TQt v3.1+) + +TQIMComposeEvent is fully implemented. + + + +TQIMEvent (TQt v3+) + +TQIMEvent is fully implemented. + + + +TQKeyEvent + +TQKeyEvent is fully implemented. + + + +TQMouseEvent + +TQMouseEvent is fully implemented. + + + +TQMoveEvent + +TQMoveEvent is fully implemented. + + + +TQPaintEvent + +TQPaintEvent is fully implemented. + + + +TQResizeEvent + +TQResizeEvent is fully implemented. + + + +TQShowEvent + +TQShowEvent is fully implemented. + + + +TQTabletEvent (TQt v3+) + +TQTabletEvent is fully implemented. + + + +TQTimerEvent + +TQTimerEvent is fully implemented. + + + +TQWheelEvent (TQt v2+) + +TQWheelEvent is fully implemented. + + +TQEventLoop (TQt v3.1+) + + virtual int exec + + + +This has been renamed to exec_loop in Python. + + +TQFile + + bool open + int m + FILE *f + + +Not implemented. + + + + TQ_LONG readBlock + char *data + TQ_ULONG len + + +This takes a single len parameter. The +data is returned if there was no error, otherwise +None is returned. + + + + TQ_LONG readLine + char *data + TQ_ULONG maxlen + + +This takes a single maxlen parameter. The +data is returned if there was no error, otherwise +None is returned. + + + + static void setDecodingFunction + EncoderFn f + + +Not yet implemented. (TQt v2+) + + + + static void setEncodingFunction + EncoderFn f + + +Not yet implemented. (TQt v2+) + + + + TQ_LONG writeBlock + const char *data + TQ_ULONG len + + +len is derived from data and not passed +as a parameter. + + +TQFileDialog + +TQFileDialog is fully implemented. + + + +TQFileIconProvider + +TQFileIconProvider is fully implemented. + + + +TQFilePreview + +TQFilePreview 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. + + +class FilePreview(TQFilePreview): + pass + +class Preview(TQLabel): + def __init__(self, parent=None): + TQLabel.__init__(self, parent) + self.preview = FilePreview() + self.preview.previewUrl = self.previewUrl + + +Note that TQFilePreview cannot be instantiated directly because it is abstract. +Thanks to Hans-Peter Jansen for this trick. + + +TQFileInfo + +TQFileInfo is fully implemented. + + +TQFont + +TQFont is fully implemented, including the Python +== and != operators. + + +TQFontDatabase (TQt v2.1+) + +TQFontDatabase is fully implemented. + + +TQFontDialog (TQt v2+) + + static TQFont getFont + bool *ok + const TQFont &def + TQWidget *parent = 0 + const char *name = 0 + + +This takes the def, parent and +name parameters and returns a tuple containing the +TQFont result and the ok value. + + + + static TQFont getFont + bool *ok + TQWidget *parent = 0 + const char *name = 0 + + +This takes the parent and name parameters +and returns a tuple containing the TQFont result and the +ok value. + + +TQFontInfo + +TQFontInfo is fully implemented. + + +TQFontMetrics + + TQRect boundingRect + int x + int y + int w + int h + int flags + const TQString &str + int len = -1 + int tabstops = 0 + int *tabarray = 0 + + +The tabarray parameter is a Python list of integers. + + + + TQSize size + int flags + const TQString &str + int len = -1 + int tabstops = 0 + int *tabarray = 0 + + +The tabarray parameter is a Python list of integers. + + +TQFrame + +TQFrame is fully implemented. + + +TQGManager (TQt v1.x) + +TQGManager is fully implemented. + + + +TQChain (TQt v1.x) + +TQChain is implemented as an opaque class. + + +TQGrid (TQt v2+) + +TQGrid is fully implemented. + + +TQGridView (TQt v3+) + +TQGridView is fully implemented. + + +TQGroupBox + +TQGroupBox is fully implemented. + + +TQHBox (TQt v2+) + +TQHBox is fully implemented. + + +TQHButtonGroup (TQt v2+) + +TQHButtonGroup is fully implemented. + + +TQHeader + +TQHeader is fully implemented. + + +TQHGroupBox (TQt v2+) + +TQHGroupBox is fully implemented. + + +TQIconSet + +TQIconSet is fully implemented. + + + +TQIconFactory (TQt v3.1+) + +TQIconFactory is fully implemented. + + +TQIconView (TQt v2.1+) + + TQIconViewItem *makeRowLayout + TQIconViewItem *begin + int &y + + +Not yet implemented. + + + +TQIconViewItem (TQt v2.1+) + +TQIconViewItem is fully implemented. + + + +TQIconDrag (TQt v2.1+) + +TQIconDrag is fully implemented. + + + +TQIconDragItem (TQt v2.1+) + +TQIconDragItem is fully implemented. + + +TQImage + +The Python == and != operators are +supported. + + + + TQImage + const char *xpm[] + + +This takes a list of strings as its parameter. + + + + TQImage + uchar *data + int w + int h + int depth + TQRgb *colorTable + int numColors + Endian bitOrder + + +The colorTable parameter is a list of TQRgb instances or +None. (TQt v2.1+) + + + + uchar *bits + + + +The return value is a sip.voidptr object which is only +useful if passed to another Python module. + + + + TQRgb *colorTable + + + +The return value is a sip.voidptr object which is only +useful if passed to another Python module. + + + + TQImage convertDepthWithPalette + int + TQRgb *p + int pc + int cf = 0 + + +Not implemented. + + + + uchar **jumpTable + + + +The return value is a sip.voidptr object which is only +useful if passed to another Python module. + + + + bool loadFromData + const uchar *buf + uint len + const char *format = 0 + ColorMode mode = Auto + + +len is derived from buf and not passed as +a parameter. + + + + uchar *scanLine + int i + + +The return value is a sip.voidptr object which is only +useful if passed to another Python module. + + + +TQImageIO + + static void defineIOHandler + const char *format + const char *header + const char *flags + image_io_handler read_image + image_io_handler write_image + + +Not implemented. + + + +TQImageTextKeyLang + +TQImageTextKeyLang is fully implemented. + + +TQInputDialog (TQt v2.1+) + + static TQString getText + const TQString &caption + const TQString &label + const TQString &text = TQString::null + bool *ok = 0 + TQWidget *parent = 0 + const char *name = 0 + + +The ok is not passed and the returned value is a tuple of +the TQString result and the ok flag. +(TQt v2.1 - v2.3.1) + + + + static TQString getText + const TQString &caption + const TQString &label + TQLineEdit::EchoModeecho + const TQString &text = TQString::null + bool *ok = 0 + TQWidget *parent = 0 + const char *name = 0 + + +The ok is not passed and the returned value is a tuple of +the TQString result and the ok flag. +(TQt v2.2 - v2.3.1) + + + + static TQString getText + const TQString &caption + const TQString &label + TQLineEdit::EchoModeecho = TQLineEdit::Normal + const TQString &text = TQString::null + bool *ok = 0 + TQWidget *parent = 0 + const char *name = 0 + + +The ok is not passed and the returned value is a tuple of +the TQString result and the ok flag. +(TQt v3+) + + + + static int getInteger + const TQString &caption + const TQString &label + int num = 0 + int from = -2147483647 + int to = 2147483647 + int step = 1 + bool *ok = 0 + TQWidget *parent = 0 + const char *name = 0 + + +The ok is not passed and the returned value is a tuple of +the int result and the ok flag. + + + + static double getDouble + const TQString &caption + const TQString &label + double num = 0 + double from = -2147483647 + double to = 2147483647 + int step = 1 + bool *ok = 0 + TQWidget *parent = 0 + const char *name = 0 + + +The ok is not passed and the returned value is a tuple of +the double result and the ok flag. + + + + static TQString getItem + const TQString &caption + const TQString &label + const TQStringList &list + int current = 0 + bool editable = TRUE + bool *ok = 0 + TQWidget *parent = 0 + const char *name = 0 + + +The ok is not passed and the returned value is a tuple of +the TQString result and the ok flag. + + +TQInterlaceStyle (TQt v2.3.1+) + + void scrollBarMetrics + const TQTabBar *sb + int &sliderMin + int &sliderMax + int &sliderLength + int &buttonDim + + +This takes only the sb parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. + + +TQIODevice + +TQIODevice is fully implemented. + + +TQKeySequence (TQt v3+) + +TQKeySequence is fully implemented including the operators +==, !=, TQString() and +int(). A TQString instance or a Python +integer may be used whenever a TQKeySequence can be used. + + +TQLabel + +TQLabel is fully implemented. + + +TQLayout + +TQLayout is fully implemented. + + + +TQBoxLayout + +TQBoxLayout is fully implemented. + + + +TQGLayoutIterator (TQt v2+) + +TQGLayoutIterator is fully implemented. + + + +TQGridLayout + + bool findWidget + TQWidget *w + int *row + int *col + + +This takes the w parameter and returns a tuple containing +the bool result, row and +col. (TQt v2+) + + + +TQHBoxLayout + +TQHBoxLayout is fully implemented. + + + +TQLayoutItem (TQt v2+) + +TQLayoutItem is fully implemented. + + + +TQLayoutIterator (TQt v2+) + + TQLayoutItem *next + + + +This is a wrapper around the TQLayoutIterator +++ operator. + + + +TQSpacerItem (TQt v2+) + +TQSpacerItem is fully implemented. + + + +TQVBoxLayout + +TQVBoxLayout is fully implemented. + + + +TQWidgetItem (TQt v2+) + +TQWidgetItem is fully implemented. + + +TQLCDNumber + +TQLCDNumber is fully implemented. + + +TQLibrary (TQt v3+) + +TQLibrary is fully implemented. + + +TQLineEdit + + int characterAt + int xpos + TQChar *chr + + +This takes only the xpos parameter and returns the int +result and the chr value as a tuple. (TQt v3+) + + + + void del + + + +This has been renamed delChar in Python. (TQt v2+) + + + + bool getSelection + int *start + int *end + + +This takes no parameters and returns the bool result and the +start and end values as a tuple. +(TQt v3+) + + +TQPtrList<type> (TQt v2) + +Types based on the TQPtrList template are automatically +converted to and from Python lists of the type. + + +TQListBox + + bool itemYPos + int index + int *yPos + + +This takes the index parameter and returns a tuple +containing the bool result and yPos. +(TQt v1.x) + + + +TQListBoxItem + +TQListBoxItem is fully implemented. + + + +TQListBoxPixmap + +TQListBoxPixmap is fully implemented. + + + +TQListBoxText + +TQListBoxText is fully implemented. + + +TQListView + +TQListView is fully implemented. + + +Note that to remove a child TQListViewItem you must first +call takeItem() and then del(). + + + +TQListViewItem + +TQListViewItem is fully implemented. + + +Note that to remove a child TQListViewItem you must first +call takeItem() and then del(). + + + +TQCheckListItem + +TQCheckListItem is fully implemented. + + + +TQListViewItemIterator (TQt v2+) + +TQListViewItemIterator is fully implemented. + + +TQLocale (TQt v3.3+) + + short toShort + bool *ok = 0 + + +This returns a tuple of the short result and the +ok value. + + + + ushort toUShort + bool *ok = 0 + + +This returns a tuple of the ushort result and the +ok value. + + + + int toInt + bool *ok = 0 + + +This returns a tuple of the int result and the +ok value. + + + + uint toUInt + bool *ok = 0 + + +This returns a tuple of the uint result and the +ok value. + + + + TQ_LONG toLong + bool *ok = 0 + + +This returns a tuple of the long result and the +ok value. + + + + TQ_ULONG toULong + bool *ok = 0 + + +This returns a tuple of the ulong result and the +ok value. + + + + float toFloat + bool *ok = 0 + + +This returns a tuple of the float result and the +ok value. + + + + double toDouble + bool *ok = 0 + + +This returns a tuple of the double result and the +ok value. + + +TQMainWindow + + TQTextStream &operator<< + TQTextStream & + const TQMainWindow & + + +This operator is fully implemented. (TQt v3+) + + + + TQTextStream &operator>> + TQTextStream & + TQMainWindow & + + +This operator is fully implemented. (TQt v3+) + + + + bool getLocation + TQToolBar *tb + ToolBarDock &dock + int &index + bool &nl + int &extraOffset + + +This takes only the tb parameter and returns a tuple of the +result, dock, index, +nl and extraOffset values. (TQt v2.1.0+) + + + + TQPtrList<TQToolBar> toolBars + ToolBarDock dock + + +This returns a list of TQToolBar instances. (TQt v2.1.0+) + + +TQMemArray<type> (TQt v3+) + +Types based on the TQMemArray template are automatically +converted to and from Python lists of the type. + + +TQMenuBar + +TQMenuBar is fully implemented. + + +TQMenuData + + TQMenuItem *findItem + int id + TQMenuData **parent + + +Not implemented. + + + +TQCustomMenuItem (TQt v2.1+) + +TQCustomMenuItem is fully implemented. + + + +TQMenuItem + +TQMenuItem is an internal TQt class. + + +TQMessageBox + +TQMessageBox is fully implemented. + + +TQMetaObject + + int numClassInfo const + bool super = FALSE + + +Not implemented. + + + + const TQClassInfo *classInfo const + bool super = FALSE + + +Not implemented. + + + +TQMetaProperty + +TQMetaProperty is fully implemented. + + +TQMimeSource (TQt v2+) + +TQMimeSource is fully implemented. + + + +TQMimeSourceFactory (TQt v2+) + +TQMimeSourceFactory is fully implemented. + + + +TQWindowsMime (TQt v3+) + +TQWindowsMime is fully implemented. + + +TQMotifPlusStyle (TQt v2.2+) + + void getButtonShift + int &x + int &y + + +This takes no parameters and returns a tuple of the x and +y values. (TQt v2) + + + + void scrollBarMetrics + const TQScrollBar *sb + int &sliderMin + int &sliderMax + int &sliderLength + int &buttonDim + + +This takes only the sb parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. +(TQt v2) + + +TQMotifStyle (TQt v2+) + + void scrollBarMetrics + const TQTabBar *sb + int &sliderMin + int &sliderMax + int &sliderLength + int &buttonDim + + +This takes only the sb parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. +(TQt v2) + + + + void tabbarMetrics + const TQTabBar *t + int &hframe + int &vframe + int &overlap + + +This takes only the t parameter and returns a tuple of the +hframe, vframe and +overlap values. (TQt v2) + + +TQMovie + + TQMovie + TQDataSource *src + int bufsize = 1024 + + +Not implemented. + + + + void pushData + const uchar *data + int length + + +length is derived from data and not +passed as a parameter. (TQt v2.2.0+) + + +TQMultiLineEdit + + void cursorPosition const + int *line + int *col + + +This takes no parameters and returns a tuple of the line and +col values. (TQt v1.x, TQt v2.x) + + + + virtual void del + + + +This has been renamed delChar in Python. (TQt v1.x, TQt v2.x) + + + + void getCursorPosition const + int *line + int *col + + +This takes no parameters and returns a tuple of the line and +col values. (TQt v1.x, TQt v2.x) + + + + bool getMarkedRegion + int *line1 + int *col1 + int *line2 + int *col2 + + +This takes no parameters and returns a tuple of the bool result and the +line1, col1, line2 and +col2 values. + + +TQMutex (TQt v2.2+) + +TQMutex is fully implemented. + + + +TQMutexLocker (TQt v3.1+) + +TQMutexLocker is fully implemented. + + +TQNetworkOperation (TQt v2.1+) + +TQNetworkOperation is fully implemented. + + + +TQNetworkProtocol (TQt v2.1+) + +TQNetworkProtocol is fully implemented. + + + +TQNetworkProtocolFactoryBase (TQt v2.1+) + +TQNetworkProtocolFactoryBase is fully implemented. + + +TQObject + + bool disconnect + const TQObject *receiver + const char *member = 0 + + +Not yet implemented. + + + + bool disconnect + const char *signal = 0 + const TQObject *receiver = 0 + const char *member = 0 + + +Not yet implemented. + + + + static bool disconnect + const TQObject *sender + const char *signal + const TQObject *receiver + const char *member + + +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 +signal and receiver parameters is not yet +supported. + + +TQObjectCleanupHandler (TQt v3+) + +TQObjectCleanupHandler is fully implemented. + + +TQObjectList + +This class isn't implemented. Whenever a TQObjectList is the +return type of a function or the type of an argument, a Python list of +TQObject instances is used instead. + + +TQPaintDeviceMetrics + +TQPaintDeviceMetrics is fully implemented. + + +TQPaintDevice + + virtual bool cmd + int + TQPainter * + TQPDevCmdParam * + + +Not implemented. + + +TQPainter + + TQRect boundingRect + int x + int y + int w + int h + int flags + const char *str + int len = -1 + char **intern = 0 + + +The intern parameter is not supported. + + + + TQRect boundingRect + const TQRect& + int flags + const char *str + int len = -1 + char **intern = 0 + + +The intern parameter is not supported. + + + + void drawText + int x + int y + int w + int h + int flags + const char *str + int len = -1 + TQRect *br = 0 + char **intern = 0 + + +The intern parameter is not supported. + + + + void drawText + const TQRect& + int flags + const char *str + int len = -1 + TQRect *br = 0 + char **intern = 0 + + +The intern parameter is not supported. + + + + void setTabArray + int *ta + + +This takes a single parameter which is a list of tab stops. + + + + int *tabArray + + + +This returns a list of tab stops. + + +TQPalette + +TQPalette is fully implemented, including the Python +== and != operators. + + +TQPixmap + + TQPixmap + const char *xpm[] + + +This takes a list of strings as its parameter. + + + + bool loadFromData + const uchar *buf + uint len + const char *format = 0 + ColorMode mode = Auto + + +len is derived from buf and not passed as +a parameter. + + + + bool loadFromData + const uchar *buf + uint len + const char *format + int conversion_flags + + +Not implemented. + + +TQPixmapCache (TQt v3+) + +TQPixmapCache is fully implemented. + + +TQPair<type,type> (TQt v3+) + +Types based on the TQPair template are automatically +converted to and from Python tuples of two elements. + + +TQPen + +TQPen is fully implemented, including the Python +== and != operators. + + +TQPicture + + const char *data + + + +Not implemented. + + + + void setData + const char *data + uint size + + +size is derived from data and not passed +as a parameter. + + +TQPlatinumStyle (TQt v2+) + + void scrollBarMetrics + const TQTabBar *sb + int &sliderMin + int &sliderMax + int &sliderLength + int &buttonDim + + +This takes only the sb parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. +(TQt v2) + + +TQPoint + +The Python ++, +=, +-, -=, unary -, +*, *=, +/, /=, +==, != and __nonzero__ +operators are supported. + + + + TQCOORD &rx + + + +Not implemented. + + + + TQCOORD &ry + + + +Not implemented. + + +TQPointArray + + TQPointArray + int nPoints + const TQCOORD *points + + +This takes a single parameter which is a list of points. + + + + void point + uint i + int *x + int *y + + +This takes the single parameter i and returns the +x and y values as a tuple. + + + + bool putPoints + int index + int nPoints + const TQCOORD *points + + +This takes two parameters, index and a list of points. + + + + bool putPoints + int index + int nPoints + int firstx + int firsty + ... + + +Not implemented. + + + + bool setPoints + int nPoints + const TQCOORD *points + + +This takes a single parameter which is a list of points. + + + + bool setPoints + int nPoints + int firstx + int firsty + ... + + +Not implemented. + + +TQPopupMenu + + int exec + + + +This has been renamed exec_loop in Python. + + +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 +TQObject.deleteLater() or other techniques. + + + + int exec + const TQPoint &pos + int indexAtPoint = 0 + + +This has been renamed exec_loop in Python. + + +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 +TQObject.deleteLater() or other techniques. + + +TQPrintDialog (X11) + +TQPrintDialog is fully implemented. + + +TQPrinter + +TQPrinter is fully implemented. + + +TQProcess (TQt v3+) + +TQProcess is fully implemented. + + +TQProgressBar + +TQProgressBar is fully implemented. + + +TQProgressDialog + +TQProgressDialog is fully implemented. +value. + + +TQPtrList<type> (TQt v2+) + +Types based on the TQPtrList template are automatically +converted to and from Python lists of the type. + + +TQPushButton + +TQPushButton is fully implemented. + + +TQRadioButton + +TQRadioButton is fully implemented. + + +TQRangeControl + +TQRangeControl is fully implemented. + + +TQRect + +The Python +&, &=, +|, |=, +==, !=, in and +__nonzero__ operators are supported. + + + + void coords + int *x1 + int *y1 + int *x2 + int *y2 + + +This takes no parameters and returns a tuple containing the four values. + + + + void rect + int *x + int *y + int *w + int *h + + +This takes no parameters and returns a tuple containing the four values. + + + + TQCOORD &rBottom + + + +Not implemented. (TQt v2+) + + + + TQCOORD &rLeft + + + +Not implemented. (TQt v2+) + + + + TQCOORD &rRight + + + +Not implemented. (TQt v2+) + + + + TQCOORD &rTop + + + +Not implemented. (TQt v2+) + + +TQRegExp + +The Python == and != operators are +supported. + + + + int match + const char *str + int index = 0 + int *len = 0 + + +This takes str and index parameters and +returns a tuple of the int result and the +len value. (TQt v1.x) + + + + int match + const TQString &str + int index = 0 + int *len = 0 + + +This takes str and index parameters and +returns a tuple of the int result and the +len value. (TQt v2+) + + +TQRegion + +The Python +|, |=, ++, +=, +&, &=, +-, -=, +^, ^=, +==, !=, in and +__nonzero__ operators are supported. + + + + TQArray<TQRect> rects + + + +Not implemented. + + + + void setRects + TQRect *rects + int num + + +Not yet implemented. (TQt v2.2+) + + +TQScrollBar + +TQScrollBar is fully implemented. + + +TQScrollView + + void contentsToViewport + int x + int y + int &vx + int &vy + + +This takes the x and y parameters and +returns a tuple containing the vx and vy +values. (TQt v2+) + + + + void viewportToContents + int vx + int vy + int &x + int &y + + +This takes the vx and vy parameters and +returns a tuple containing the x and y +values. (TQt v2+) + + +TQSemaphore (TQt v2.2+) + +TQSemaphore is fully implemented. The += +and -= operators have also been implemented, but require +Python v2.0 or later. + + +TQSemiModal (TQt v1, v2) + +TQSemiModal is fully implemented. + + +TQSessionManager (TQt v2+) + +TQSessionManager is fully implemented. + + +TQSettings (TQt v3+) + + bool readBoolEntry + const TQString &key + bool def = 0 + bool *ok = 0 + + +The ok is not passed and the returned value is a tuple of +the bool result and the ok flag. + + + +double readDoubleEntry + const TQString &key + double def = 0 + bool *ok = 0 + + +The ok is not passed and the returned value is a tuple of +the double result and the ok flag. + + + +TQString readEntry + const TQString &key + const TQString &def = TQString::null + bool *ok = 0 + + +The ok is not passed and the returned value is a tuple of +the TQString result and the ok flag. + + + +TQStringList readListEntry + const TQString &key + bool *ok = 0 + + +The ok is not passed and the returned value is a tuple of +the TQStringList result and the ok flag. + + + +TQStringList readListEntry + const TQString &key + const TQChar &separator + bool *ok = 0 + + +The ok is not passed and the returned value is a tuple of +the TQStringList result and the ok flag. + + + +int readNumEntry + const TQString &key + int def = 0 + bool *ok = 0 + + +The ok is not passed and the returned value is a tuple of +the int result and the ok flag. + + + + bool writeEntry + const TQString &key + bool value + + +Not implemented. + + +TQSGIStyle (TQt v2.2+) + + void scrollBarMetrics + const TQScrollBar *sb + int &sliderMin + int &sliderMax + int &sliderLength + int &buttonDim + + +This takes only the sb parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. +(TQt v2) + + +TQSignalMapper + +TQSignalMapper is fully implemented. + + +TQSimpleRichText (TQt v2+) + +TQSimpleRichText is fully implemented. + + +TQSize + +The Python ++, +=, +-, -=, +*, *=, +/, /=, +==, != and __nonzero__ +operators are supported. + + + + TQCOORD &rheight + + + +Not implemented. + + + + TQCOORD &rwidth + + + +Not implemented. + + +TQSizeGrip (TQt v2+) + +TQSizeGrip is fully implemented. + + +TQSizePolicy (TQt v2+) + +TQSizePolicy is fully implemented. + + +TQSlider + +TQSlider is fully implemented. + + +TQSocketNotifier + +TQSocketNotifier is fully implemented. + + +TQSound (TQt v2.2+) + +TQSound is fully implemented. + + +TQSpinBox + + virtual int mapTextToValue + bool *ok + + +This returns a tuple of the int result and the modified +ok value. + + +TQSplashScreen (TQt v3.2.0+) + +TQSplashScreen is fully implemented. + + +TQSplitter + + void getRange + int id + int *min + int *max + + +This takes the id parameter and returns the +min and max values as a tuple. (TQt v2+) + + +TQStatusBar + +TQStatusBar is fully implemented. + + +TQChar (TQt v2+) + + uchar &cell const + + + +Not implemented. + + + + uchar &row const + + + +Not implemented. + + + +TQString + +A Python string object (or Unicode object) can be used whenever a +TQString can be used. A TQString can be +converted to a Python string object using the Python str() +function, and to a Python Unicode object using the Python +unicode() function. + + + +The Python +, +=, *, +*=, len, [] +(for reading slices and individual characters), in and +comparison operators are supported. + + + + TQCharRef at + uint i + + +Not yet implemented. (TQt v2+) + + + + TQChar constref const + uint i + + +Not yet implemented. (TQt v2+) + + + + TQChar &ref + uint i + + +Not yet implemented. (TQt v2+) + + + + TQString &setUnicodeCodes + const ushort *unicode_as_shorts + uint len + + +Not yet implemented. (TQt v2.1+) + + + + TQString &sprintf + const char *format + ... + + +Not implemented. + + + + short toShort + bool *ok = 0 + + +This returns a tuple of the short result and the +ok value. + + + + ushort toUShort + bool *ok = 0 + + +This returns a tuple of the ushort result and the +ok value. + + + + int toInt + bool *ok = 0 + + +This returns a tuple of the int result and the +ok value. + + + + uint toUInt + bool *ok = 0 + + +This returns a tuple of the uint result and the +ok value. + + + + long toLong + bool *ok = 0 + + +This returns a tuple of the long result and the +ok value. + + + + ulong toULong + bool *ok = 0 + + +This returns a tuple of the ulong result and the +ok value. + + + + float toFloat + bool *ok = 0 + + +This returns a tuple of the float result and the +ok value. + + + + double toDouble + bool *ok = 0 + + +This returns a tuple of the double result and the +ok value. + + +TQStringList (TQt v2+) + +The Python len, [] (for both reading and +writing slices and individual elements), del (for deleting +slices and individual elements), +, +=, +*, *=, ==, +!= and in operators are supported. + + + + Iterator append + const TQString &x + + +This does not return a value. + + + + Iterator prepend + const TQString &x + + +This does not return a value. + + +TQStrList + +This class isn't implemented. Whenever a TQStrList is the +return type of a function or the type of an argument, a Python list of strings +is used instead. + + +TQStyle (TQt v2+) + + virtual void getButtonShift + int &x + int &y + + +This takes no parameters and returns a tuple of the x and +y values. (TQt v2) + + + + virtual void scrollBarMetrics + const TQScrollBar *b + int &sliderMin + int &sliderMax + int &sliderLength + int &buttonDim + + +Thus takes only the b parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. +(TQt v2) + + + + virtual void tabbarMetrics + const TQTabBar *t + int &hframe + int &vframe + int &overlap + + +This takes only the t parameter and returns a tuple of the +hframe, vframe and +overlap values. (TQt v2) + + + +TQStyleOption (TQt v3+) + +TQStyleOption is fully implemented. + + +TQStyleSheet (TQt v2+) + +TQStyleSheet is fully implemented. + + + +TQStyleSheetItem (TQt v2+) + +TQStyleSheetItem is fully implemented. + + +TQSyntaxHighlighter (TQt v3.1+) + +TQSyntaxHighlighter is fully implemented. + + +TQTab + +TQTab is fully implemented. + + + +TQTabBar + + TQPtrList<TQTab> tabList + + + +This returns a list of TQTab instances. + + +TQTabDialog + +TQTabDialog is fully implemented. + + +TQTableView (TQt 1.x, TQt 2.x) + + bool colXPos + int col + int *xPos + + +This takes the col parameter and returns a tuple containing +the bool result and xPos. + + + + bool rowYPos + int row + int *yPos + + +This takes the row parameter and returns a tuple containing +the bool result and yPos. + + +TQTabWidget (TQt v2+) + +TQTabWidget is fully implemented. + + +TQTextBrowser (TQt v2+) + +TQTextBrowser is fully implemented. + + +TQTextCodec (TQt v2+) + + virtual TQCString fromUnicode + const TQString &uc + int &lenInOut + + +The returned value is a tuple of the TQCString result and the +updated lenInOut. + + + +TQTextDecoder (TQt v2+) + +TQTextDecoder is fully implemented. + + + +TQTextEncoder (TQt v2+) + + virtual TQCString fromUnicode = 0 + const TQString &uc + int &lenInOut + + +The returned value is a tuple of the TQCString result and the +updated lenInOut. + + +TQTextEdit (TQt v3+) + +int charAt + const TQPoint &pos + int *para = 0 + + +This takes only the pos parameter and returns a tuple of the +value returned via the para pointer and the int result. + + + + void del + + + +This has been renamed delChar in Python. + + + +virtual bool find + const TQString &expr + bool cs + bool wo + bool forward = TRUE + int *para = 0 + int *index = 0 + + +If the para and index 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 +para and index is returned. + + + +void getCursorPosition + int *para + int *index + + +This takes no parameters and returns a tuple of the values returned via the +para and index pointers. + + + +void getSelection + int *paraFrom + int *indexFrom + int *paraTo + int *indexTo + int selNum = 0 + + +This takes only the selNum parameter and returns a tuple of +the paraFrom, indexFrom, +paraTo and indexTo values. + + +TQTextStream + + TQTextStream + FILE *fp + int mode + + +Not implemented. + + + + TQTextStream &readRawBytes + char *buf + uint len + + +Not yet implemented. + + + + TQTextStream &writeRawBytes + const char *buf + uint len + + +Not yet implemented. + + + +TQTextIStream (TQt v2+) + + TQTextIStream + FILE *fp + int mode + + +Not implemented. + + + +TQTextOStream (TQt v2+) + + TQTextOStream + FILE *fp + int mode + + +Not implemented. + + +TQTextView (TQt v2+) + +TQTextView is fully implemented. + + +TQThread (TQt v2.2+) + +TQThread is fully implemented. + + +TQTimer + +TQTimer is fully implemented. + + +TQToolBar + +TQToolBar is fully implemented. + + +TQToolBox (TQt v3.2.0+) + +TQToolBox is fully implemented. + + +TQToolButton + +TQToolButton is fully implemented. + + +TQToolTip + +TQToolTip is fully implemented. + + + +TQToolTipGroup + +TQToolTipGroup is fully implemented. + + +TQTranslator (TQt v2+) + +TQTranslator is fully implemented. + + + +TQTranslatorMessage (TQt v2.2+) + +TQTranslatorMessage is fully implemented. + + +TQUrl (TQt v2.1+) + +TQUrl is fully implemented, including the +TQString(), == and != +operators. + + +TQUrlInfo (TQt v2.1+) + +TQUrlInfo is fully implemented. + + +TQUrlOperator (TQt v2.1+) + + virtual bool isDir + bool *ok + + +This returns a tuple of the bool result and the +ok value. + + +TQUuid (TQt v3.0+) + +TQUuid is fully implemented. + + +TQValidator + + virtual State validate + TQString& input + int& pos + + +The returned value is a tuple of the State result and the +updated pos. + + + +TQDoubleValidator + + State validate + TQString& input + int& pos + + +The returned value is a tuple of the State result and the +updated pos. + + + +TQIntValidator + + State validate + TQString& input + int& pos + + +The returned value is a tuple of the State result and the +updated pos. + + + +TQRegExpValidator (TQt v3+) + + virtual State validate + TQString& input + int& pos + + +The returned value is a tuple of the State result and the +updated pos. + + +TQValueList<type> (TQt v2+) + +Types based on the TQValueList template are automatically +converted to and from Python lists of the type. + + +TQVariant (TQt v2.1+) + + TQVariant + const char *val + + +Not implemented. + + + + TQVariant + const TQBitArray &val + + +Not yet implemented. (TQt v3+) + + + + TQVariant + const TQValueList<TQVariant> &val + + +Not yet implemented. + + + + TQVariant + const TQMap<TQString,TQVariant> &val + + +Not yet implemented. + + + + TQBitArray &asBitArray + + + +Not yet implemented. (TQt v3+) + + + + bool &asBool + + + +Not implemented. + + + + double &asDouble + + + +Not implemented. + + + + int &asInt + + + +Not implemented. + + + + TQValueList<TQVariant> &asList + + + +Not implemented. + + + + TQMap<TQString,TQVariant> &asMap + + + +Not implemented. + + + + uint &asUInt + + + +Not implemented. + + + + TQValueListConstIterator<TQVariant>listBegin const + + + +Not implemented. + + + + TQValueListConstIterator<TQVariant>listEnd const + + + +Not implemented. + + + + TQMapConstIterator<TQString,TQVariant>mapBegin const + + + +Not implemented. + + + + TQMapConstIterator<TQString,TQVariant>mapEnd const + + + +Not implemented. + + + + TQMapConstIterator<TQString,TQVariant>mapFind const + const TQString &key + + +Not implemented. + + + + TQValueListConstIterator<TQString>stringListBegin const + + + +Not implemented. + + + + TQValueListConstIterator<TQString>stringListEnd const + + + +Not implemented. + + + + const TQBitArray toBitArray const + + + +Not yet implemented. (TQt v3+) + + + + const TQValueList<TQVariant>toList const + + + +Not yet implemented. + + + + const TQMap<TQString,TQVariant>toMap const + + + +Not yet implemented. + + +TQVBox (TQt v2+) + +TQVBox is fully implemented. + + +TQVButtonGroup (TQt v2+) + +TQVButtonGroup is fully implemented. + + +TQVGroupBox (TQt v2+) + +TQVGroupBox is fully implemented. + + +TQWaitCondition (TQt v2.2+) + +TQWaitCondition is fully implemented. + + +TQWhatsThis + +TQWhatsThis is fully implemented. + + +TQWidget + + TQWExtra *extraData + + + +Not implemented. + + + + TQFocusData *focusData + + + +Not implemented. + + + + void lower + + + +This has been renamed to lowerW in Python. + + + + void raise + + + +This has been renamed to raiseW in Python. + + +TQWidgetList + +This class isn't implemented. Whenever a TQWidgetList is the +return type of a function or the type of an argument, a Python list of +instances is used instead. + + +TQWidgetStack + +TQWidgetStack is fully implemented. + + +TQWindow + +TQWindow is fully implemented (TQt v1.x). + + +TQWindowsStyle (TQt v2+) + + void getButtonShift + int &x + int &y + + +This takes no parameters and returns a tuple of the x and +y values. (TQt v2) + + + + void scrollBarMetrics + const TQTabBar *sb + int &sliderMin + int &sliderMax + int &sliderLength + int &buttonDim + + +This takes only the sb parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. +(TQt v2) + + + + void tabbarMetrics + const TQTabBar *t + int &hframe + int &vframe + int &overlap + + +This takes only the t parameter and returns a tuple of the +hframe, vframe and +overlap values. (TQt v2) + + +TQWindowsXPStyle (TQt v3.0.1+, Windows) + +TQWindowsXPStyle is fully implemented. + + +TQWizard (TQt v2+) + +TQWizard is fully implemented. + + +TQWMatrix + +The Python ==, != and +*= operators are supported. + + + + TQWMatrix invert const + bool *invertible = 0 + + +This takes no parameters and returns a tuple of the TQWMatrix +result and the invertible value. + + + + void map const + int x + int y + int *tx + int *ty + + +This takes the x and y parameters and +returns a tuple containing the tx and ty +values. + + + + void map const + float x + float y + float *tx + float *ty + + +This takes the x and y parameters and +returns a tuple containing the tx and ty +values. (TQt v1.x) + + + + void map const + double x + double y + double *tx + double *ty + + +This takes the x and y parameters and +returns a tuple containing the tx and ty +values. (TQt v2+) + + +TQWorkspace (TQt v2.1+) + +TQWorkspace is fully implemented. + + + +<Literal>tqtaxcontainer</Literal> Module Reference +TQAxBase (Windows, TQt v3+) + + TQAxObject + IUnknown *iface = 0 + + +Not implemented. + + + + long queryInterface + const TQUuid &uuid + void **iface + + +Not implemented. + + + + PropertyBag propertyBag const + + + +Not implemented. + + + + void setPropertyBag + const PropertyBag &bag + + +Not implemented. + + + + unsigned long registerWeakActiveObject + const TQString &guid + + +This is a utility method provided by PyTQt to make it easier to use +Mark Hammond's win32com module to manipulate objects +created by the tqtaxcontainer module. + + +The RegisterActiveObject() COM function is called to +register the TQAxBase instance as a weak object with the +guid GUID. The revoke handle is returned. + + + + static void revokeActiveObject + unsigned long rhandle + + +This is a wrapper around the RevokeActiveObject() COM +function and is called to revoke the object registered using +registerWeakActiveObject(). rhandle is +the revoke handle returned by registerWeakActiveObject(). + + +TQAxObject (Windows, TQt v3+) + + TQAxObject + IUnknown *iface + TQObject *parent = 0 + const char *name = 0 + + +Not implemented. + + +TQAxWidget (Windows, TQt v3+) + + TQAxWidget + IUnknown *iface + TQWidget *parent = 0 + const char *name = 0 + + +Not implemented. + + + +<Literal>tqtcanvas</Literal> Module Reference +TQCanvas (TQt v2.2+) + +TQCanvas is fully implemented. + + + +TQCanvasEllipse (TQt v2.2+) + +TQCanvasEllipse is fully implemented. + + + +TQCanvasItem (TQt v2.2+) + +TQCanvasItem is fully implemented. + + + +TQCanvasItemList (TQt v2.2+) + +This class isn't implemented. Whenever a TQCanvasItemList is +the return type of a function or the type of an argument, a Python list of +TQCanvasItem instances is used instead. + + + +TQCanvasLine (TQt v2.2+) + +TQCanvasLine is fully implemented. + + + +TQCanvasPixmap (TQt v2.2+) + +TQCanvasPixmap is fully implemented. + + + +TQCanvasPixmapArray (TQt v2.2+) + + TQPixmapArray + TQPtrList<TQPixmap> pixmaps + TQPtrList<TQPoint> hotspots + + +The pixmaps argument is a Python list of TQPixmap instances, +and the hotspots argument is a Python list of TQPoint +instances. (TQt v2.2.0 - TQt v2.3.1) + + + + TQPixmapArray + TQValueList<TQPixmap> pixmaps + TQPointArray hotspots = TQPointArray() + + +The pixmaps argument is a Python list of TQPixmap instances. +(TQt v3+) + + + +TQCanvasPolygon (TQt v2.2+) + +TQCanvasPolygon is fully implemented. + + + +TQCanvasPolygonalItem (TQt v2.2+) + +TQCanvasPolygonalItem is fully implemented. + + + +TQCanvasRectangle (TQt v2.2+) + +TQCanvasRectangle is fully implemented. + + + +TQCanvasSpline (TQt v3.0+) + +TQCanvasSpline is fully implemented. + + + +TQCanvasSprite (TQt v2.2+) + +TQCanvasSprite is fully implemented. + + + +TQCanvasText (TQt v2.2+) + +TQCanvasText is fully implemented. + + + +TQCanvasView (TQt v2.2+) + +TQCanvasView is fully implemented. + + + +<Literal>tqtext</Literal> Module Reference + +TQextScintilla + + void getCursorPosition + int *line + int *index + + +This takes no parameters and returns a tuple of the values returned by the +line and index pointers. + + + + void getSelection + int *lineFrom + int *indexFrom + int *lineTo + int *indexTo + + +This takes no parameters and returns a tuple of the values returned by the +lineFrom, indexFrom, +lineTo and indexTo pointers. + + + +TQextScintillaAPIs + +TQextScintillaAPIs is fully implemented. + + + +TQextScintillaBase + +TQextScintillaBase is fully implemented. + + + +TQextScintillaCommand + +TQextScintillaCommand is fully implemented. + + + +TQextScintillaCommandSet + +TQextScintillaCommandSet is fully implemented. + + + +TQextScintillaDocument + +TQextScintillaDocument is fully implemented. + + + +TQextScintillaLexer + +TQextScintillaLexer is fully implemented. + + + +TQextScintillaLexerBash (TQScintilla v1.4+) + +TQextScintillaLexerBash is fully implemented. + + + +TQextScintillaLexerBatch (TQScintilla v1.6+) + +TQextScintillaLexerBatch is fully implemented. + + + +TQextScintillaLexerCPP + +TQextScintillaLexerCPP is fully implemented. + + + +TQextScintillaLexerCSharp + +TQextScintillaLexerCSharp is fully implemented. + + + +TQextScintillaLexerCSS (TQScintilla v1.6+) + +TQextScintillaLexerCSS is fully implemented. + + + +TQextScintillaLexerDiff (TQScintilla v1.6+) + +TQextScintillaLexerDiff is fully implemented. + + + +TQextScintillaLexerHTML (TQScintilla v1.1+) + +TQextScintillaLexerHTML is fully implemented. + + + +TQextScintillaLexerIDL + +TQextScintillaLexerIDL is fully implemented. + + + +TQextScintillaLexerJava + +TQextScintillaLexerJava is fully implemented. + + + +TQextScintillaLexerJavaScript + +TQextScintillaLexerJavaScript is fully implemented. + + + +TQextScintillaLexerLua (TQScintilla v1.5+) + +TQextScintillaLexerLua is fully implemented. + + + +TQextScintillaLexerMakefile (TQScintilla v1.6+) + +TQextScintillaLexerMakefile is fully implemented. + + + +TQextScintillaLexerPerl + +TQextScintillaLexerPerl is fully implemented. + + + +TQextScintillaLexerPOV (TQScintilla v1.6+) + +TQextScintillaLexerPOV is fully implemented. + + + +TQextScintillaLexerProperties (TQScintilla v1.6+) + +TQextScintillaLexerProperties is fully implemented. + + + +TQextScintillaLexerPython + +TQextScintillaLexerPython is fully implemented. + + + +TQextScintillaLexerRuby (TQScintilla v1.5+) + +TQextScintillaLexerRuby is fully implemented. + + + +TQextScintillaLexerSQL (TQScintilla v1.1+) + +TQextScintillaLexerSQL is fully implemented. + + + +TQextScintillaLexerTeX (TQScintilla v1.6+) + +TQextScintillaLexerTeX is fully implemented. + + + +TQextScintillaMacro + +TQextScintillaMacro is fully implemented. + + + +TQextScintillaPrinter + +TQextScintillaPrinter is fully implemented. + + + +<Literal>tqtgl</Literal> Module Reference +TQGL + +TQGL is fully implemented. + + + +TQGLContext + +TQGLContext is fully implemented. + + + +TQGLFormat + +TQGLFormat is fully implemented. + + + +TQGLWidget + +TQGLWidget is fully implemented. + + +TQGLColormap (TQt v3.0+) + + void setEntries + int count + const TQRgb *colors + int base = 0 + + +Not yet implemented. + + + +<Literal>tqtnetwork</Literal> Module Reference +TQDns (TQt v2.2+) + +TQDns is fully implemented. + + +TQFtp (TQt v2.2+) + + TQ_LONG readBlock + char *data + TQ_ULONG maxlen + + +This takes a single maxlen parameter. The +data is returned if there was no error, otherwise +None is returned. + + +TQHostAddress (TQt v2.2+) + + TQHostAddress + TQ_UINT8 *ip6Addr + + +Not yet implemented. + + + + TQHostAddress + const Q_IPV6ADDR &ip6Addr + + +Not yet implemented. + + + + void setAddress + TQ_UINT8 *ip6Addr + + +Not yet implemented. + + + + Q_IPV6ADDR toIPv6Address const + + + +Not yet implemented. + + +TQHttp (TQt v3+) + + TQ_LONG readBlock + char *data + TQ_ULONG maxlen + + +This takes a single maxlen parameter. The +data is returned if there was no error, otherwise +None is returned. + + + +TQHttpHeader (TQt v3.1+) + +TQHttpHeader is fully implemented. + + + +TQHttpRequestHeader (TQt v3.1+) + +TQHttpRequestHeader is fully implemented. + + + +TQHttpResponseHeader (TQt v3.1+) + +TQHttpResponseHeader is fully implemented. + + +TQLocalFs (TQt v2.1+) + +TQLocalFs is fully implemented. + + +TQServerSocket (TQt v2.2+) + +TQServerSocket is fully implemented. + + +TQSocket (TQt v2.2+) + + TQ_LONG readBlock + char *data + TQ_ULONG len + + +This takes a single len parameter. The +data is returned if there was no error, otherwise +Py_None is returned. + + + + TQ_LONG readLine + char *data + TQ_ULONG maxlen + + +This takes a single maxlen parameter. The +data is returned if there was no error, otherwise +Py_None is returned. + + + + TQ_LONG writeBlock + const char *data + TQ_ULONG len + + +len is derived from data and not passed +as a parameter. + + +TQSocketDevice (TQt v2.2+) + + TQ_LONG readBlock + char *data + TQ_ULONG len + + +This takes a single len parameter. The +data is returned if there was no error, otherwise +None is returned. + + + + TQ_LONG writeBlock + const char *data + TQ_ULONG len + + +len is derived from data and not passed +as a parameter. + + + +<Literal>tqtpe</Literal> Module Reference + +TQPEApplication + + TQApplication + int& argc + char **argv + Type type + + +This takes two parameters, the first of which is a list of argument strings. +Arguments used by TQt are removed from the list. + + + + int exec + + + +This has been renamed to exec_loop in Python. + + + +AppLnk + + virtual TQString exec const + + + +This has been renamed to exec_property in Python. + + + +AppLnkSet + +AppLnkSet is fully implemented. + + + +Config + +Config is fully implemented. + + + +DateFormat + +DateFormat is fully implemented. + + + +DocLnk + + TQString exec const + + + +This has been renamed to exec_property in Python. + + + +DocLnkSet + +DocLnkSet is fully implemented. + + + +FileManager + +FileManager is fully implemented. + + + +FileSelector + +FileSelector is fully implemented. + + + +FileSelectorItem + +FileSelectorItem is fully implemented. + + + +FontDatabase + +FontDatabase is fully implemented. + + + +Global + + static void setBuiltinCommands + Command * + + +Not implemented. + + + +MenuButton + +MenuButton is fully implemented. + + + +TQCopEnvelope + +TQCopEnvelope is fully implemented. + + + +TQDawg + +TQDawg is fully implemented. + + + +TQPEMenuBar + +TQPEMenuBar is fully implemented. + + + +TQPEToolBar + +TQPEToolBar is fully implemented. + + + +Resource + +Resource is fully implemented. + + + + +<Literal>tqtsql</Literal> Module Reference +TQDataBrowser (TQt v3+) + + virtual void del + + + +This has been renamed delOnCursor in Python. + + +TQDataTable (TQt v3+) + +TQDataTable is fully implemented. + + +TQDataView (TQt v3+) + +TQDataView is fully implemented. + + +TQEditorFactory (TQt v3+) + +TQEditorFactory is fully implemented. + + +TQSql (TQt v3+) + +TQSql is fully implemented. + + +TQSqlCursor (TQt v3+) + + virtual int del + bool invalidate = TRUE + + +This has been renamed delRecords in Python. + + + + virtual int del + const TQString &filter + bool invalidate = TRUE + + +This has been renamed delRecords in Python. + + + + bool exec + const TQString &query + + +This has been renamed execQuery in Python. + + +TQSqlDatabase (TQt v3+) + + TQSqlQuery exec + const TQString &query = TQString::null + + +This has been renamed execStatement in Python. + + +TQSqlDriver (TQt v3+) + +TQSqlDriver is fully implemented. + + +TQSqlEditorFactory (TQt v3+) + +TQSqlEditorFactory is fully implemented. + + +TQSqlError (TQt v3+) + +TQSqlError is fully implemented. + + +TQSqlField (TQt v3+) + +TQSqlField is fully implemented. + + + +TQSqlFieldInfo (TQt v3+) + +TQSqlFieldInfo is fully implemented. + + +TQSqlForm (TQt v3+) + +TQSqlForm is fully implemented. + + +TQSqlIndex (TQt v3+) + +TQSqlIndex is fully implemented. + + +TQSqlPropertyMap (TQt v3+) + +TQSqlPropertyMap is fully implemented. However, because PyTQt +does not allow new properties to be defined, it is not possible to implement +custom editor widgets in Python and add them to a property map. These will +simply be ignored. + + + +This problem may be addressed in a future release of PyTQt. + + +TQSqlQuery (TQt v3+) + + TQMap<TQString,TQVariant> boundValues const + + + +Not yet implemented. (TQt v3.2.0+) + + + + virtual bool exec + const TQString &query + + +This has been renamed execQuery in Python. + + + + bool exec + + + +This has been renamed execQuery in Python. (TQt v3.1+) + + +TQSqlRecord (TQt v3+) + +TQSqlRecord is fully implemented. + + + +TQSqlRecordInfo (TQt v3+) + +TQSqlRecordInfo is implemented as a Python list of +TQSqlFieldInfo instances. + + +TQSqlResult (TQt v3+) + +TQSqlResult is fully implemented. + + +TQSqlSelectCursor (TQt v3.2.0+) + + int del + bool invalidate = TRUE + + +This has been renamed delRecords in Python. + + + + bool exec + const TQString &query + + +This has been renamed execQuery in Python. + + + +<Literal>tqttable</Literal> Module Reference +TQTable (TQt v2.2+) + +TQTable is fully implemented. + + + +TQTableItem (TQt v2.2+) + +TQTableItem is fully implemented. + + + +TQCheckTableItem (TQt v3+) + +TQCheckTableItem is fully implemented. + + + +TQComboTableItem (TQt v3+) + +TQComboTableItem is fully implemented. + + + +TQTableSelection (TQt v2.2+) + +TQTableSelection is fully implemented. + + + +<Literal>tqtui</Literal> Module Reference +TQWidgetFactory (TQt v3+) + +TQWidgetFactory is fully implemented. + + + +<Literal>tqtxml</Literal> Module Reference +TQDomImplementation (TQt v2.2+) + +TQDomImplementation is fully implemented. + + + +TQDomNode (TQt v2.2+) + +TQDomNode is fully implemented, including the Python +== and != operators. + + + +TQDomNodeList (TQt v2.2+) + +TQDomNodeList is fully implemented. + + + +TQDomDocument (TQt v2.2+) + + bool setContent + const TQCString &buffer + bool namespaceProcessing + TQString *errorMsg = 0 + int *errorLine = 0 + int *errorColumn = 0 + + +This takes the buffer and +namespaceProcessing parameters and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+) + + + + bool setContent + const TQByteArray &buffer + bool namespaceProcessing + TQString *errorMsg = 0 + int *errorLine = 0 + int *errorColumn = 0 + + +This takes the buffer and +namespaceProcessing parameters and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+) + + + + bool setContent + const TQString &text + bool namespaceProcessing + TQString *errorMsg = 0 + int *errorLine = 0 + int *errorColumn = 0 + + +This takes the text and +namespaceProcessing parameters and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+) + + + + bool setContent + const TQIODevice *dev + bool namespaceProcessing + TQString *errorMsg = 0 + int *errorLine = 0 + int *errorColumn = 0 + + +This takes the dev and +namespaceProcessing parameters and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+) + + + + bool setContent + const TQCString &buffer + TQString *errorMsg = 0 + int *errorLine = 0 + int *errorColumn = 0 + + +This takes the buffer parameter only and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+) + + + + bool setContent + const TQByteArray &buffer + TQString *errorMsg = 0 + int *errorLine = 0 + int *errorColumn = 0 + + +This takes the buffer parameter only and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+) + + + + bool setContent + const TQString &text + TQString *errorMsg = 0 + int *errorLine = 0 + int *errorColumn = 0 + + +This takes the text parameter only and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+) + + + + bool setContent + const TQIODevice *dev + TQString *errorMsg = 0 + int *errorLine = 0 + int *errorColumn = 0 + + +This takes the dev parameter only and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+) + + + + bool setContent + TQXmlInputSource *source + TQXmlReader *reader + TQString *errorMsg = 0 + int *errorLine = 0 + int *errorColumn = 0 + + +Not yet implemented. (TQt v3.2.0+) + + + +TQDomDocumentFragment (TQt v2.2+) + +TQDomDocumentFragment is fully implemented. + + + +TQDomDocumentType (TQt v2.2+) + +TQDomDocumentType is fully implemented. + + + +TQDomNamedNodeMap (TQt v2.2+) + +TQDomNamedNodeMap is fully implemented. + + + +TQDomCharacterData (TQt v2.2+) + +TQDomCharacterData is fully implemented. + + + +TQDomAttr (TQt v2.2+) + +TQDomAttr is fully implemented. + + + +TQDomElement (TQt v2.2+) + +TQDomElement is fully implemented. + + + +TQDomText (TQt v2.2+) + +TQDomText is fully implemented. + + + +TQDomComment (TQt v2.2+) + +TQDomComment is fully implemented. + + + +TQDomCDATASection (TQt v2.2+) + +TQDomCDATASection is fully implemented. + + + +TQDomNotation (TQt v2.2+) + +TQDomNotation is fully implemented. + + + +TQDomEntity (TQt v2.2+) + +TQDomEntity is fully implemented. + + + +TQDomEntityReference (TQt v2.2+) + +TQDomEntityReference is fully implemented. + + + +TQDomProcessingInstruction (TQt v2.2+) + +TQDomProcessingInstruction is fully implemented. + + + +
diff --git a/doc/qtdocs.sip b/doc/qtdocs.sip deleted file mode 100644 index 171bacd..0000000 --- a/doc/qtdocs.sip +++ /dev/null @@ -1,1915 +0,0 @@ -// This is the SIP file for organising the PyTQt documentation. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 Dummy - - -%Include qt/versions.sip - - -%Doc - -
- - Python Bindings for TQt (3.18.1) - - Phil - Thompson - - - - This document describes a set of Python bindings for the TQt widget set. - Contact the author at phil@riverbankcomputing.co.uk. - - - - - -Introduction - -PyTQt is a set of Python bindings for the TQt toolkit and available for all -platforms supported by TQt, including Windows, Linux, UNIX, MacOS/X and embedded -systems such as the Sharp Zaurus and the Compaq iPAQ. They have been tested -against TQt versions 1.43 to 3.3.6, TQt Non-commercial, TQtopia 1.5.0, and Python -versions 1.5 to 2.4.2. TQt/Embedded v3 is not supported. TQt v4 is supported -by PyTQt v4. - - - -PyTQt is available under the GPL license for use with the GPL version of TQt, a -a commercial license for use with the commercial version of TQt, a -non-commercial license for use with the non-commercial version of TQt v2, and an -educational license for use with the educational version of TQt. - - - -There is also an evaluation version of PyTQt for Windows. This must be used -with the corresponding evaluation version of TQt. - - - -PyTQt is built using SIP (a tool for generating Python extension modules for -C++ class libraries). SIP v4.6 or later must be installed in order to build -and run this version of PyTQt. - - - -PyTQt for MacOS/X requires TQt v3.1.0 or later and Python v2.3 or later. - - - -The bindings are implemented as a number of Python modules - - - - - -qt is the main module and contains the core classes and most -user interface widgets. - - - - - -qtaxcontainer contains a sub-set of the classes implemented -in TQt's TQAxContainer module, part of TQt's ActiveTQt framework. - - - - - -qtcanvas contains the classes implemented in TQt's Canvas -module. - - - - - -qtgl contains the classes implemented in TQt's OpenGL module. - - - - - -qtnetwork contains the classes implemented in TQt's Network -module. - - - - - -qtpe contains the classes implemented in TQtopia (originally -called the TQt Palmtop Environment). It is only supported with TQt/Embedded. - - - - - -qtsql contains the classes implemented in TQt's SQL module. - - - - - -qttable contains the classes implemented in TQt's Table -module. - - - - - -qtui contains the classes implemented in TQt's tqui library. -These allow GUIs to be created directly from TQt Designer's -.ui files. - - - - - -qtxml contains the classes implemented in TQt's XML module. - - - - - -qtext contains useful third-party classes that are not part -of TQt. At the moment it contains bindings for TQScintilla, the port to TQt of -the Scintilla programmer's editor class. - - - - - -PyTQt also includes the pyuic and -pylupdate utilities which correspond to the TQt -uic and lupdate utilities. -pyuic converts the GUI designs created with TQt Designer to -executable Python code. pylupdate scans Python code, -extracts all strings that are candidates for internationalisation, and creates -an XML file for use by TQt Linguist. - - -Changes - -The changes visible to the Python programmer in this release are as follows. - - - - - -This version requires SIP v4.4 (or later). - - - - - -Concatenating Python strings and TQStrings is now supported. - - - - - -TQString now supports the * and -*= operators that behave as they do for Python strings. - - - - - -TQString is more interoperable with Python string and unicode -objects. For example they can be passed as arguments to -open() and to most (but not all) string methods. - - - - - -TQPopupMenu (and sub-classes) instances now transfer -ownership of the menu to Python in the call to exec_loop(). -This means the menu's resources are all released when the Python wrapper is -garbage collected without needing to call -TQObject.deleteLater(). - - - - - -TQObject.sender() now handles Python signals. - - - - - -The missing MacintoshVersion enum has been added. - - - - - -PYQT_BUILD has been removed. - - - - - -The convention for converting between a C/C++ null pointer and Python's -None object has now been universally applied. In previous -versions a null pointer to, for example, a TQt list container would often be -converted to an empty list rather than None. - - - - - - - - -Other PyTQt Goodies -Using TQt Designer - -TQt Designer is a GPL'ed GUI design editor provided by Trolltech as part of TQt. -It generates an XML description of a GUI design. TQt includes -uic which generates C++ code from that XML. - - - -PyTQt includes pyuic which generates Python code from the -same XML. The Python code is self contained and can be executed immediately. - - - -It is sometimes useful to be able to include some specific Python code in the -output generated by pyuic. For example, if you are using -custom widgets, pyuic has no way of knowing the name of the -Python module containing the widget and so cannot generate the required -import statement. To help get around this, -pyuic will extract any lines entered in the -Comment field of TQt Designer's -Form Settings dialog that begin with -Python: and copies them to the generated output. - - - -Here's a simple example showing the contents of the Comment -field. - - - -This comment will be ignored by pyuic. -Python: -Python:# Import our custom widget. -Python:from foo import bar - - - -Here's the corresponding output from pyuic. - - - -from PyTQt.qt import * - -# Import our custom widget. -from foo import bar - - - -Thanks to Christian Bird, pyuic will extract Python code -entered using TQt Designer to implement slots. In TQt Designer, when you need to -edit a slot and the source editor appears, enter Python code between the curly -braces. Don't worry about the correct starting indent level, each line is -prepended with a correct indentation. - - - -Make sure that the ui.h file is in the same directory as the -.ui file when using pyuic. The -.ui file implies the name of the .ui.h -file so there is no need to specify it on the command line. - - - -Here's an example of a simple slot. - - - -void DebMainWindowFrm::browsePushButtonClicked() -{ -if self.debugging: - TQMessageBox.critical(self, "Event", "browse pushbutton was clicked!") -} - - - -Here is the resulting code when pyuic is run. - - - -class DebMainWindowFrm(TQMainWindow): - ...stuff... - def browsePushButtonClicked(self): - if self.debugging: - TQMessageBox.critical(self, "Event", "browse pushbutton was clicked!") - - - -Note that indenting is as normal and that self and all other -parameters passed to the slot are available. - - - -If you use this, you will need to turn off all of the fancy options for the C++ -editor in Designer as it tries to force C++ syntax and that's naturally -annoying when trying to code in Python. - - - -Using TQt Linguist - -TQt includes the lupdate program which parses C++ source -files converting calls to the QT_TR_NOOP() and -QT_TRANSLATE_NOOP() macros to .ts -language source files. The lrelease program is then used to -generate .qm binary language files that are distributed with -your application. - - - -Thanks to Detlev Offenbach, PyTQt includes the pylupdate -program. This generates the same .ts language source files -from your PyTQt source files. - - - - - -Deploying Commercial PyTQt Applications - -When deploying commercial PyTQt applications it is necessary to discourage users -from accessing the underlying PyTQt modules for themselves. A user that used -the modules shipped with your application to develop new applications would -themselves be considered a developer and would need their own commercial TQt and -PyTQt licenses. - - - -One solution to this problem is the -VendorID -package. This allows you to build Python extension modules that can only be -imported by a digitally signed custom interpreter. The package enables you to -create such an interpreter with your application embedded within it. The -result is an interpreter that can only run your application, and PyTQt modules -that can only be imported by that interpreter. You can use the package to -similarly restrict access to any extension module. - - - -In order to build PyTQt with support for the VendorID package, pass the --i command line flag to configure.py. - - - -<Literal>pyqtconfig</Literal> and Build System Support - -The SIP build system (ie. the sipconfig module) is described -in the SIP documentation. PyTQt includes the pyqtconfig -module that can be used by configuration scripts of other bindings that are -built on top of PyTQt. - - - -The pyqtconfig module contains the following classes: - - - - -Configuration(sipconfig.Configuration) - - -This class encapsulates additional configuration values, specific to PyTQt, that -can be accessed as instance variables. - - - -The following configuration values are provided (in addition to those provided -by the sipconfig.Configuration class): - - - - -pyqt_bin_dir - - -The name of the directory containing the pyuic and -pylupdate executables. - - - - - - -pyqt_config_args - - -The command line passed to configure.py when PyTQt was -configured. - - - - - - -pyqt_mod_dir - - -The name of the directory containing the PyTQt modules. - - - - - - -pyqt_modules - - -A string containing the names of the PyTQt modules that were installed. - - - - - - -pyqt_qt_sip_flags - - -A string of the SIP flags used to generate the code for the -qt module and which should be added to those needed by any -module that imports the qt module. - - - - - - -pyqt_qtaxcontainer_sip_flags - - -A string of the SIP flags used to generate the code for the -qtaxcontainer module and which should be added to those -needed by any module that imports the qtaxcontainer module. - - - - - - -pyqt_qtcanvas_sip_flags - - -A string of the SIP flags used to generate the code for the -qtcanvas module and which should be added to those needed by -any module that imports the qtcanvas module. - - - - - - -pyqt_qtext_sip_flags - - -A string of the SIP flags used to generate the code for the -qtext module and which should be added to those needed by -any module that imports the qtext module. - - - - - - -pyqt_qtgl_sip_flags - - -A string of the SIP flags used to generate the code for the -qtgl module and which should be added to those needed by any -module that imports the qtgl module. - - - - - - -pyqt_qtnetwork_sip_flags - - -A string of the SIP flags used to generate the code for the -qtnetwork module and which should be added to those needed -by any module that imports the qtnetwork module. - - - - - - -pyqt_qtsql_sip_flags - - -A string of the SIP flags used to generate the code for the -qtsql module and which should be added to those needed by -any module that imports the qtsql module. - - - - - - -pyqt_qttable_sip_flags - - -A string of the SIP flags used to generate the code for the -qttable module and which should be added to those needed by -any module that imports the qttable module. - - - - - - -pyqt_qtui_sip_flags - - -A string of the SIP flags used to generate the code for the -qtui module and which should be added to those needed by any -module that imports the qtui module. - - - - - - -pyqt_qtxml_sip_flags - - -A string of the SIP flags used to generate the code for the -qtxml module and which should be added to those needed by -any module that imports the qtxml module. - - - - - - -pyqt_sip_dir - - -The name of the base directory where the .sip files for each -of the PyTQt modules is installed. A sub-directory exists with the same name as -the module. - - - - - - -pyqt_version - - -The PyTQt version as a 3 part hexadecimal number (eg. v3.10 is represented as -0x030a00). - - - - - - -pyqt_version_str - - -The PyTQt version as a string. For development snapshots it will start with -snapshot-. - - - - - - - - - - -TQtModuleMakefile(sipconfig.SIPModuleMakefile) - - -The Makefile class for modules that import the qt module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - -TQtAxContainerModuleMakefile(TQtModuleMakefile) - - -The Makefile class for modules that import the qtaxcontainer -module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - -TQtCanvasModuleMakefile(TQtModuleMakefile) - - -The Makefile class for modules that import the qtcanvas -module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - -TQtExtModuleMakefile(TQtModuleMakefile) - - -The Makefile class for modules that import the qtext module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - -TQtGLModuleMakefile(TQtModuleMakefile) - - -The Makefile class for modules that import the qtgl module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - -TQtNetworkModuleMakefile(TQtModuleMakefile) - - -The Makefile class for modules that import the qtnetwork -module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - -TQtTableModuleMakefile(TQtModuleMakefile) - - -The Makefile class for modules that import the qttable -module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - -TQtSQLModuleMakefile(TQtTableModuleMakefile) - - -The Makefile class for modules that import the qtsql module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - -TQtUIModuleMakefile(TQtModuleMakefile) - - -The Makefile class for modules that import the qtui module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - -TQtXMLModuleMakefile(TQtModuleMakefile) - - -The Makefile class for modules that import the qtxml module. - - - -finalise(self) - - -This is a reimplementation of sipconfig.Makefile.finalise(). - - - - - - - - - - -%End - - -%ExportedDoc -Things to be Aware Of -super and Wrapped Classes - -Internally PyTQt implements a lazy technique for attribute lookup where -attributes are only placed in type and instance dictionaries when they are -first referenced. This technique is needed to reduce the time taken to import -large modules such as PyTQt. - - - -In most circumstances this technique is transparent to an application. The -exception is when super is used with a PyTQt class. The way -that super is currently implemented means that the lazy -lookup is bypassed resulting in AttributeError exceptions -unless the attribute has been previously referenced. - - - -Note that this restriction applies to any class wrapped by SIP and not just -PyTQt. - - - - -Python Strings, TQt Strings and Unicode - -Unicode support was added to TQt in v2.0 and to Python in v1.6. In TQt, Unicode -support is implemented using the TQString class. It is -important to understand that TQStrings, Python string objects -and Python Unicode objects are all different but conversions between them are -automatic in almost all cases and easy to achieve manually when needed. - - - -Whenever PyTQt expects a TQString as a function argument, a -Python string object or a Python Unicode object can be provided instead, and -PyTQt will do the necessary conversion automatically. - - - -You may also manually convert Python string and Unicode objects to -TQStrings by using the TQString constructor -as demonstrated in the following code fragment. - - - -qs1 = TQString('Converted Python string object') -qs2 = TQString(u'Converted Python Unicode object') - - - -In order to convert a TQString to a Python string object use -the Python str() function. Applying -str() to a null TQString and an empty -TQString both result in an empty Python string object. - - - -In order to convert a TQString to a Python Unicode object use -the Python unicode() function. Applying -unicode() to a null TQString and an empty -TQString both result in an empty Python Unicode object. - - - -Access to Protected Member Functions - -When an instance of a C++ class is not created from Python it is not possible -to access the protected member functions, or emit the signals, of that -instance. Attempts to do so will raise a Python exception. Also, any Python -methods corresponding to the instance's virtual member functions will never be -called. - - - -<Literal>None</Literal> and <Literal>NULL</Literal> - -Throughout the bindings, the None value can be specified -wherever NULL is acceptable to the underlying C++ code. - - - -Equally, NULL is converted to None -whenever it is returned by the underlying C++ code. - - - - -Support for C++ <Literal>void *</Literal> Data Types - -PyTQt represents void * values as objects of type -sip.voidptr. Such values are often used to pass the -addresses of external objects between different Python modules. To make this -easier, a Python integer (or anything that Python can convert to an integer) -can be used whenever a sip.voidptr is expected. - - -A sip.voidptr may be converted to a Python integer by using -the int() builtin function. - - -A sip.voidptr may be converted to a Python string by using -its asstring() method. The asstring() -method takes an integer argument which is the length of the data in bytes. - - - - -Support for Threads - -PyTQt implements the full set of TQt's thread classes. Python, of course, also -has its own thread extension modules. If you are using SIP v4 (or later) and -Python v2.3.5 (or later) then PyTQt does not impose any additional restrictions. -(Read the relevant part of the TQt documentation to understand the restrictions -imposed by the TQt API.) - - -If you are using earlier versions of either SIP or Python then it is possible -to use either of the APIs so long as you follow some simple rules. - - - - -If you use the TQt API then the very first import of one of -the PyTQt modules must be done from the main thread. - - - - -If you use the Python API then all calls to PyTQt (including any -imports) must be done from one thread only. Therefore, if -you want to make calls to PyTQt from several threads then you must use the TQt -API. - - - - -If you want to use both APIs in the same application then all calls to PyTQt -must be done from threads created using the TQt API. - - - - -The above comments actually apply to any SIP generated module, not just PyTQt. - - - -Garbage Collection - -C++ does not garbage collect unreferenced class instances, whereas Python does. -In the following C++ fragment both colours exist even though the first can no -longer be referenced from within the program: - - - -c = new TQColor(); -c = new TQColor(); - - - -In the corresponding Python fragment, the first colour is destroyed when -the second is assigned to c: - - - -c = TQColor() -c = TQColor() - - - -In Python, each colour must be assigned to different names. Typically this -is done within class definitions, so the code fragment would be something like: - - - -self.c1 = TQColor() -self.c2 = TQColor() - - - -Sometimes a TQt class instance will maintain a pointer to another instance and -will eventually call the destructor of that second instance. The most common -example is that a TQObject (and any of its sub-classes) keeps -pointers to its children and will automatically call their destructors. In -these cases, the corresponding Python object will also keep a reference to the -corresponding child objects. - - - -So, in the following Python fragment, the first TQLabel is -not destroyed when the second is assigned to l because the -parent TQWidget still has a reference to it. - - - -p = TQWidget() -l = TQLabel('First label',p) -l = TQLabel('Second label',p) - - - -C++ Variables - -Access to C++ variables is supported. They are accessed as Python instance -variables. For example: - - - -tab = TQTab() -tab.label = "First Tab" -tab.r = TQRect(10,10,75,30) - - - -Global variables and static class variables are effectively read-only. They -can be assigned to, but the underlying C++ variable will not be changed. This -may change in the future. - - - -Access to protected C++ class variables is not supported. This may change in -the future. - - - -Multiple Inheritance - -It is not possible to define a new Python class that sub-classes from more than -one TQt class. - - - -i18n Support - -TQt implements i18n support through the TQt Linguist application, the -TQTranslator class, and the -TQApplication::translate(), TQObject::tr() -and TQObject::trUtf8() methods. Usually the -tr() method is used to obtain the correct translation of a -message. The translation process uses a message context to allow the same -message to be translated differently. tr() is actually -generated by moc and uses the hardcoded class name as the -context. On the other hand, TQApplication::translate() -allows to context to be explicitly stated. - - - -Unfortunately, because of the way TQt implents tr() (and -trUtf8()) it is not possible for PyTQt to exactly reproduce -its behavour. The PyTQt implementation of tr() (and -trUtf8()) uses the class name of the instance as the -context. The key difference, and the source of potential problems, is that the -context is determined dynamically in PyTQt, but is hardcoded in TQt. In other -words, the context of a translation may change depending on an instance's class -hierarchy. - - - -class A(TQObject): - def __init__(self): - TQObject.__init__(self) - - def hello(self): - return self.tr("Hello") - -class B(A): - def __init__(self): - A.__init__(self) - -a = A() -a.hello() - -b = B() -b.hello() - - - -In the above the message is translated by a.hello() using a -context of A, and by b.hello() using a -context of B. In the equivalent C++ version the context -would be A in both cases. - - - -The PyTQt behaviour is unsatisfactory and may be changed in the future. It is -recommended that TQApplication.translate() be used in -preference to tr() (and trUtf8()). This -is guaranteed to work with current and future versions of PyTQt and makes it -much easier to share message files between Python and C++ code. Below is the -alternative implementation of A that uses -TQApplication.translate(). - - - -class A(TQObject): - def __init__(self): - TQObject.__init__(self) - - def hello(self): - return tqApp.translate("A","Hello") - - - -Note that the code generated by pyuic uses -TQApplication.translate(). - - - - - -Signal and Slot Support - -A signal may be either a TQt signal (specified using -SIGNAL()) or a Python signal (specified using -PYSIGNAL()). - - - -A slot can be either a Python callable object, a TQt signal (specified using -SIGNAL()), a Python signal (specified using -PYSIGNAL()), or a TQt slot (specified using -SLOT()). - - - -You connect signals to slots (and other signals) as you would from C++. For -example: - - - -TQObject.connect(a,SIGNAL("TQtSig()"),pyFunction) -TQObject.connect(a,SIGNAL("TQtSig()"),pyClass.pyMethod) -TQObject.connect(a,SIGNAL("TQtSig()"),PYSIGNAL("PySig")) -TQObject.connect(a,SIGNAL("TQtSig()"),SLOT("TQtSlot()")) -TQObject.connect(a,PYSIGNAL("PySig"),pyFunction) -TQObject.connect(a,PYSIGNAL("PySig"),pyClass.pyMethod) -TQObject.connect(a,PYSIGNAL("PySig"),SIGNAL("TQtSig()")) -TQObject.connect(a,PYSIGNAL("PySig"),SLOT("TQtSlot()")) - - - -When a slot is a Python method that corresponds to a TQt slot then a signal can -be connected to either the Python method or the TQt slot. The following -connections achieve the same effect. - - - -sbar = TQScrollBar() -lcd = TQLCDNumber() - -TQObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd.display) -TQObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd,SLOT("display(int)")) - - - -The difference is that the second connection is made at the C++ level and is -more efficient. - - - -Disconnecting signals works in exactly the same way. - - - -Any instance of a class that is derived from the TQObject -class can emit a signal using the emit method. This takes -two arguments. The first is the Python or TQt signal, the second is a Python -tuple which are the arguments to the signal. For example: - - - -a.emit(SIGNAL("clicked()"),()) -a.emit(PYSIGNAL("pySig"),("Hello","World")) - - - -Note that when a slot is a Python callable object its reference count is not -increased. This means that a class instance can be deleted without having to -explicitly disconnect any signals connected to its methods. However, it also -means that using lambda expressions as slots will not work unless you keep a -separate reference to the expression to prevent it from being immediately -garbage collected. - - - -TQt allows a signal to be connected to a slot that requires fewer arguments than -the signal passes. The extra arguments are quietly discarded. Python slots -can be used in the same way. - - - - -Static Member Functions - -Static member functions are implemented as Python class functions. -For example the C++ static member function -TQObject::connect() is called from Python as -TQObject.connect() or self.connect() if -called from a sub-class of TQObject. - - - - -Enumerated Types - -Enumerated types are implemented as a set of simple variables corresponding to -the separate enumerated values. - - - -When using an enumerated value the name of the class (or a sub-class) in which -the enumerated type was defined in must be included. For example: - - - -TQt.SolidPattern -TQWidget.TabFocus -TQFrame.TabFocus - - - - -Module Reference Documentation - -The following sections should be used in conjunction with the normal class -documentation - only the differences specific to the Python bindings are -documented here. - - - -In these sections, Not yet implemented -implies that the feature can be easily implemented if needed. Not -implemented implies that the feature will not be implemented, either -because it cannot be or because it is not appropriate. - - - -If a class is described as being fully implemented then -all non-private member functions and all public class variables have been -implemented. - - - -If an operator has been implemented then it is stated explicitly. - - - -Classes that are not mentioned have not yet been implemented. - - - - -<Literal>qt</Literal> Module Reference -%End - -%Include qt/qglobal.sip -%Include qt/qwindowdefs.sip -%Include qt/qnamespace.sip - -%Include qt/qaccel.sip -%Include qt/qaction.sip -%Include qt/qapplication.sip -%Include qt/qassistantclient.sip -%Include qt/qbitmap.sip -%Include qt/qbrush.sip -%Include qt/qbutton.sip -%Include qt/qbuttongroup.sip -%Include qt/qbytearray.sip -%Include qt/qcdestyle.sip -%Include qt/qcheckbox.sip -%Include qt/qclipboard.sip -%Include qt/qcolor.sip -%Include qt/qcolordialog.sip -%Include qt/qcolorgroup.sip -%Include qt/qcombobox.sip -%Include qt/qcommonstyle.sip -%Include qt/qcstring.sip -%Include qt/qcursor.sip -%Include qt/qdatastream.sip -%Include qt/qdatetime.sip -%Include qt/qdatetimeedit.sip -%Include qt/qdesktopwidget.sip -%Include qt/qdial.sip -%Include qt/qdialog.sip -%Include qt/qdir.sip -%Include qt/qdockarea.sip -%Include qt/qdockwindow.sip -%Include qt/qdragobject.sip -%Include qt/qdrawutil.sip -%Include qt/qdropsite.sip -%Include qt/qerrormessage.sip -%Include qt/qevent.sip -%Include qt/qeventloop.sip -%Include qt/qfile.sip -%Include qt/qfiledialog.sip -%Include qt/qfileinfo.sip -%Include qt/qfont.sip -%Include qt/qfontdatabase.sip -%Include qt/qfontdialog.sip -%Include qt/qfontinfo.sip -%Include qt/qfontmetrics.sip -%Include qt/qframe.sip -%Include qt/qgrid.sip -%Include qt/qgridview.sip -%Include qt/qgroupbox.sip -%Include qt/qhbox.sip -%Include qt/qhbuttongroup.sip -%Include qt/qheader.sip -%Include qt/qhgroupbox.sip -%Include qt/qiconset.sip -%Include qt/qiconview.sip -%Include qt/qimage.sip -%Include qt/qinputdialog.sip -%Include qt/qinterlacestyle.sip -%Include qt/qiodevice.sip -%Include qt/qkeysequence.sip -%Include qt/qlabel.sip -%Include qt/qlayout.sip -%Include qt/qlcdnumber.sip -%Include qt/qlibrary.sip -%Include qt/qlineedit.sip -%Include qt/qlistbox.sip -%Include qt/qlistview.sip -%Include qt/qlocale.sip -%Include qt/qmainwindow.sip -%Include qt/qmemarray.sip -%Include qt/qmenubar.sip -%Include qt/qmenudata.sip -%Include qt/qmessagebox.sip -%Include qt/qmetaobject.sip -%Include qt/qmime.sip -%Include qt/qmotifplusstyle.sip -%Include qt/qmotifstyle.sip -%Include qt/qmovie.sip -%Include qt/qmultilinedit.sip -%Include qt/qmutex.sip -%Include qt/qnetworkprotocol.sip -%Include qt/qobject.sip -%Include qt/qobjectcleanuphandler.sip -%Include qt/qobjectlist.sip -%Include qt/qpaintdevicemetrics.sip -%Include qt/qpaintdevice.sip -%Include qt/qpainter.sip -%Include qt/qpalette.sip -%Include qt/qpixmap.sip -%Include qt/qpixmapcache.sip -%Include qt/qpair.sip -%Include qt/qpen.sip -%Include qt/qpicture.sip -%Include qt/qplatinumstyle.sip -%Include qt/qpoint.sip -%Include qt/qpointarray.sip -%Include qt/qpopupmenu.sip -%Include qt/qprintdialog.sip -%Include qt/qprinter.sip -%Include qt/qprocess.sip -%Include qt/qprogressbar.sip -%Include qt/qprogressdialog.sip -%Include qt/qptrlist.sip -%Include qt/qpushbutton.sip -%Include qt/qradiobutton.sip -%Include qt/qrangecontrol.sip -%Include qt/qrect.sip -%Include qt/qregexp.sip -%Include qt/qregion.sip -%Include qt/qscrollbar.sip -%Include qt/qscrollview.sip -%Include qt/qsemaphore.sip -%Include qt/qsemimodal.sip -%Include qt/qsessionmanager.sip -%Include qt/qsettings.sip -%Include qt/qsgistyle.sip -%Include qt/qsignalmapper.sip -%Include qt/qsimplerichtext.sip -%Include qt/qsize.sip -%Include qt/qsizegrip.sip -%Include qt/qsizepolicy.sip -%Include qt/qslider.sip -%Include qt/qsocketnotifier.sip -%Include qt/qsound.sip -%Include qt/qspinbox.sip -%Include qt/qsplashscreen.sip -%Include qt/qsplitter.sip -%Include qt/qstatusbar.sip -%Include qt/qstring.sip -%Include qt/qstringlist.sip -%Include qt/qstrlist.sip -%Include qt/qstyle.sip -%Include qt/qstylesheet.sip -%Include qt/qsyntaxhighlighter.sip -%Include qt/qtabbar.sip -%Include qt/qtabdialog.sip -%Include qt/qtabwidget.sip -%Include qt/qtextbrowser.sip -%Include qt/qtextcodec.sip -%Include qt/qtextedit.sip -%Include qt/qtextstream.sip -%Include qt/qtextview.sip -%Include qt/qthread.sip -%Include qt/qtimer.sip -%Include qt/qtoolbar.sip -%Include qt/qtoolbox.sip -%Include qt/qtoolbutton.sip -%Include qt/qtooltip.sip -%Include qt/qtranslator.sip -%Include qt/qurl.sip -%Include qt/qurlinfo.sip -%Include qt/qurloperator.sip -%Include qt/quuid.sip -%Include qt/qvalidator.sip -%Include qt/qvaluelist.sip -%Include qt/qvariant.sip -%Include qt/qvbox.sip -%Include qt/qvbuttongroup.sip -%Include qt/qvgroupbox.sip -%Include qt/qwaitcondition.sip -%Include qt/qwhatsthis.sip -%Include qt/qwidget.sip -%Include qt/qwidgetlist.sip -%Include qt/qwidgetstack.sip -%Include qt/qwindowsstyle.sip -%Include qt/qwindowsxpstyle.sip -%Include qt/qwizard.sip -%Include qt/qwmatrix.sip -%Include qt/qworkspace.sip - -%ExportedDoc - -%End - - -%ExportedDoc -<Literal>qtaxcontainer</Literal> Module Reference -%End - -%Include qtaxcontainer/qaxbase.sip -%Include qtaxcontainer/qaxobject.sip -%Include qtaxcontainer/qaxwidget.sip - -%ExportedDoc - -%End - - -%ExportedDoc -<Literal>qtcanvas</Literal> Module Reference -%End - -%Include qtcanvas/qcanvas.sip - -%ExportedDoc - -%End - - -%ExportedDoc -<Literal>qtext</Literal> Module Reference - -TQextScintilla - - void getCursorPosition - int *line - int *index - - -This takes no parameters and returns a tuple of the values returned by the -line and index pointers. - - - - void getSelection - int *lineFrom - int *indexFrom - int *lineTo - int *indexTo - - -This takes no parameters and returns a tuple of the values returned by the -lineFrom, indexFrom, -lineTo and indexTo pointers. - - - -TQextScintillaAPIs - -TQextScintillaAPIs is fully implemented. - - - -TQextScintillaBase - -TQextScintillaBase is fully implemented. - - - -TQextScintillaCommand - -TQextScintillaCommand is fully implemented. - - - -TQextScintillaCommandSet - -TQextScintillaCommandSet is fully implemented. - - - -TQextScintillaDocument - -TQextScintillaDocument is fully implemented. - - - -TQextScintillaLexer - -TQextScintillaLexer is fully implemented. - - - -TQextScintillaLexerBash (TQScintilla v1.4+) - -TQextScintillaLexerBash is fully implemented. - - - -TQextScintillaLexerBatch (TQScintilla v1.6+) - -TQextScintillaLexerBatch is fully implemented. - - - -TQextScintillaLexerCPP - -TQextScintillaLexerCPP is fully implemented. - - - -TQextScintillaLexerCSharp - -TQextScintillaLexerCSharp is fully implemented. - - - -TQextScintillaLexerCSS (TQScintilla v1.6+) - -TQextScintillaLexerCSS is fully implemented. - - - -TQextScintillaLexerDiff (TQScintilla v1.6+) - -TQextScintillaLexerDiff is fully implemented. - - - -TQextScintillaLexerHTML (TQScintilla v1.1+) - -TQextScintillaLexerHTML is fully implemented. - - - -TQextScintillaLexerIDL - -TQextScintillaLexerIDL is fully implemented. - - - -TQextScintillaLexerJava - -TQextScintillaLexerJava is fully implemented. - - - -TQextScintillaLexerJavaScript - -TQextScintillaLexerJavaScript is fully implemented. - - - -TQextScintillaLexerLua (TQScintilla v1.5+) - -TQextScintillaLexerLua is fully implemented. - - - -TQextScintillaLexerMakefile (TQScintilla v1.6+) - -TQextScintillaLexerMakefile is fully implemented. - - - -TQextScintillaLexerPerl - -TQextScintillaLexerPerl is fully implemented. - - - -TQextScintillaLexerPOV (TQScintilla v1.6+) - -TQextScintillaLexerPOV is fully implemented. - - - -TQextScintillaLexerProperties (TQScintilla v1.6+) - -TQextScintillaLexerProperties is fully implemented. - - - -TQextScintillaLexerPython - -TQextScintillaLexerPython is fully implemented. - - - -TQextScintillaLexerRuby (TQScintilla v1.5+) - -TQextScintillaLexerRuby is fully implemented. - - - -TQextScintillaLexerSQL (TQScintilla v1.1+) - -TQextScintillaLexerSQL is fully implemented. - - - -TQextScintillaLexerTeX (TQScintilla v1.6+) - -TQextScintillaLexerTeX is fully implemented. - - - -TQextScintillaMacro - -TQextScintillaMacro is fully implemented. - - - -TQextScintillaPrinter - -TQextScintillaPrinter is fully implemented. - - -%End - - -%ExportedDoc - -%End - - -%ExportedDoc -<Literal>qtgl</Literal> Module Reference -%End - -%Include qtgl/qgl.sip -%Include qtgl/qglcolormap.sip - -%ExportedDoc - -%End - - -%ExportedDoc -<Literal>qtnetwork</Literal> Module Reference -%End - -%Include qtnetwork/qdns.sip -%Include qtnetwork/qftp.sip -%Include qtnetwork/qhostaddress.sip -%Include qtnetwork/qhttp.sip -%Include qtnetwork/qlocalfs.sip -%Include qtnetwork/qnetwork.sip -%Include qtnetwork/qserversocket.sip -%Include qtnetwork/qsocket.sip -%Include qtnetwork/qsocketdevice.sip - -%ExportedDoc - -%End - - -%ExportedDoc -<Literal>qtpe</Literal> Module Reference - -TQPEApplication - - TQApplication - int& argc - char **argv - Type type - - -This takes two parameters, the first of which is a list of argument strings. -Arguments used by TQt are removed from the list. - - - - int exec - - - -This has been renamed to exec_loop in Python. - - - -AppLnk - - virtual TQString exec const - - - -This has been renamed to exec_property in Python. - - - -AppLnkSet - -AppLnkSet is fully implemented. - - - -Config - -Config is fully implemented. - - - -DateFormat - -DateFormat is fully implemented. - - - -DocLnk - - TQString exec const - - - -This has been renamed to exec_property in Python. - - - -DocLnkSet - -DocLnkSet is fully implemented. - - - -FileManager - -FileManager is fully implemented. - - - -FileSelector - -FileSelector is fully implemented. - - - -FileSelectorItem - -FileSelectorItem is fully implemented. - - - -FontDatabase - -FontDatabase is fully implemented. - - - -Global - - static void setBuiltinCommands - Command * - - -Not implemented. - - - -MenuButton - -MenuButton is fully implemented. - - - -TQCopEnvelope - -TQCopEnvelope is fully implemented. - - - -TQDawg - -TQDawg is fully implemented. - - - -TQPEMenuBar - -TQPEMenuBar is fully implemented. - - - -TQPEToolBar - -TQPEToolBar is fully implemented. - - - -Resource - -Resource is fully implemented. - - - - -%End - - -%ExportedDoc -<Literal>qtsql</Literal> Module Reference -%End - -%Include qtsql/qdatabrowser.sip -%Include qtsql/qdatatable.sip -%Include qtsql/qdataview.sip -%Include qtsql/qeditorfactory.sip -%Include qtsql/qsql.sip -%Include qtsql/qsqlcursor.sip -%Include qtsql/qsqldatabase.sip -%Include qtsql/qsqldriver.sip -%Include qtsql/qsqleditorfactory.sip -%Include qtsql/qsqlerror.sip -%Include qtsql/qsqlfield.sip -%Include qtsql/qsqlform.sip -%Include qtsql/qsqlindex.sip -%Include qtsql/qsqlpropertymap.sip -%Include qtsql/qsqlquery.sip -%Include qtsql/qsqlrecord.sip -%Include qtsql/qsqlresult.sip -%Include qtsql/qsqlselectcursor.sip - -%ExportedDoc - -%End - - -%ExportedDoc -<Literal>qttable</Literal> Module Reference -%End - -%Include qttable/qtable.sip - -%ExportedDoc - -%End - - -%ExportedDoc -<Literal>qtui</Literal> Module Reference -%End - -%Include qtui/qwidgetfactory.sip - -%ExportedDoc - -%End - - -%ExportedDoc -<Literal>qtxml</Literal> Module Reference -%End - -%Include qtxml/qdom.sip - -%ExportedDoc - -%End - - -%Doc -
-%End diff --git a/doc/tqtdocs.sip b/doc/tqtdocs.sip new file mode 100644 index 0000000..5c8c295 --- /dev/null +++ b/doc/tqtdocs.sip @@ -0,0 +1,1915 @@ +// This is the SIP file for organising the PyTQt documentation. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 Dummy + + +%Include tqt/versions.sip + + +%Doc + +
+ + Python Bindings for TQt (3.18.1) + + Phil + Thompson + + + + This document describes a set of Python bindings for the TQt widget set. + Contact the author at phil@riverbankcomputing.co.uk. + + + + + +Introduction + +PyTQt is a set of Python bindings for the TQt toolkit and available for all +platforms supported by TQt, including Windows, Linux, UNIX, MacOS/X and embedded +systems such as the Sharp Zaurus and the Compaq iPAQ. They have been tested +against TQt versions 1.43 to 3.3.6, TQt Non-commercial, TQtopia 1.5.0, and Python +versions 1.5 to 2.4.2. TQt/Embedded v3 is not supported. TQt v4 is supported +by PyTQt v4. + + + +PyTQt is available under the GPL license for use with the GPL version of TQt, a +a commercial license for use with the commercial version of TQt, a +non-commercial license for use with the non-commercial version of TQt v2, and an +educational license for use with the educational version of TQt. + + + +There is also an evaluation version of PyTQt for Windows. This must be used +with the corresponding evaluation version of TQt. + + + +PyTQt is built using SIP (a tool for generating Python extension modules for +C++ class libraries). SIP v4.6 or later must be installed in order to build +and run this version of PyTQt. + + + +PyTQt for MacOS/X requires TQt v3.1.0 or later and Python v2.3 or later. + + + +The bindings are implemented as a number of Python modules + + + + + +tqt is the main module and contains the core classes and most +user interface widgets. + + + + + +tqtaxcontainer contains a sub-set of the classes implemented +in TQt's TQAxContainer module, part of TQt's ActiveTQt framework. + + + + + +tqtcanvas contains the classes implemented in TQt's Canvas +module. + + + + + +tqtgl contains the classes implemented in TQt's OpenGL module. + + + + + +tqtnetwork contains the classes implemented in TQt's Network +module. + + + + + +tqtpe contains the classes implemented in TQtopia (originally +called the TQt Palmtop Environment). It is only supported with TQt/Embedded. + + + + + +tqtsql contains the classes implemented in TQt's SQL module. + + + + + +tqttable contains the classes implemented in TQt's Table +module. + + + + + +tqtui contains the classes implemented in TQt's tqui library. +These allow GUIs to be created directly from TQt Designer's +.ui files. + + + + + +tqtxml contains the classes implemented in TQt's XML module. + + + + + +tqtext contains useful third-party classes that are not part +of TQt. At the moment it contains bindings for TQScintilla, the port to TQt of +the Scintilla programmer's editor class. + + + + + +PyTQt also includes the pytquic and +pytqlupdate utilities which correspond to the TQt +uic and lupdate utilities. +pytquic converts the GUI designs created with TQt Designer to +executable Python code. pytqlupdate scans Python code, +extracts all strings that are candidates for internationalisation, and creates +an XML file for use by TQt Linguist. + + +Changes + +The changes visible to the Python programmer in this release are as follows. + + + + + +This version requires SIP v4.4 (or later). + + + + + +Concatenating Python strings and TQStrings is now supported. + + + + + +TQString now supports the * and +*= operators that behave as they do for Python strings. + + + + + +TQString is more interoperable with Python string and unicode +objects. For example they can be passed as arguments to +open() and to most (but not all) string methods. + + + + + +TQPopupMenu (and sub-classes) instances now transfer +ownership of the menu to Python in the call to exec_loop(). +This means the menu's resources are all released when the Python wrapper is +garbage collected without needing to call +TQObject.deleteLater(). + + + + + +TQObject.sender() now handles Python signals. + + + + + +The missing MacintoshVersion enum has been added. + + + + + +PYTQT_BUILD has been removed. + + + + + +The convention for converting between a C/C++ null pointer and Python's +None object has now been universally applied. In previous +versions a null pointer to, for example, a TQt list container would often be +converted to an empty list rather than None. + + + + + + + + +Other PyTQt Goodies +Using TQt Designer + +TQt Designer is a GPL'ed GUI design editor provided by Trolltech as part of TQt. +It generates an XML description of a GUI design. TQt includes +uic which generates C++ code from that XML. + + + +PyTQt includes pytquic which generates Python code from the +same XML. The Python code is self contained and can be executed immediately. + + + +It is sometimes useful to be able to include some specific Python code in the +output generated by pytquic. For example, if you are using +custom widgets, pytquic has no way of knowing the name of the +Python module containing the widget and so cannot generate the required +import statement. To help get around this, +pytquic will extract any lines entered in the +Comment field of TQt Designer's +Form Settings dialog that begin with +Python: and copies them to the generated output. + + + +Here's a simple example showing the contents of the Comment +field. + + + +This comment will be ignored by pytquic. +Python: +Python:# Import our custom widget. +Python:from foo import bar + + + +Here's the corresponding output from pytquic. + + + +from PyTQt.tqt import * + +# Import our custom widget. +from foo import bar + + + +Thanks to Christian Bird, pytquic will extract Python code +entered using TQt Designer to implement slots. In TQt Designer, when you need to +edit a slot and the source editor appears, enter Python code between the curly +braces. Don't worry about the correct starting indent level, each line is +prepended with a correct indentation. + + + +Make sure that the ui.h file is in the same directory as the +.ui file when using pytquic. The +.ui file implies the name of the .ui.h +file so there is no need to specify it on the command line. + + + +Here's an example of a simple slot. + + + +void DebMainWindowFrm::browsePushButtonClicked() +{ +if self.debugging: + TQMessageBox.critical(self, "Event", "browse pushbutton was clicked!") +} + + + +Here is the resulting code when pytquic is run. + + + +class DebMainWindowFrm(TQMainWindow): + ...stuff... + def browsePushButtonClicked(self): + if self.debugging: + TQMessageBox.critical(self, "Event", "browse pushbutton was clicked!") + + + +Note that indenting is as normal and that self and all other +parameters passed to the slot are available. + + + +If you use this, you will need to turn off all of the fancy options for the C++ +editor in Designer as it tries to force C++ syntax and that's naturally +annoying when trying to code in Python. + + + +Using TQt Linguist + +TQt includes the lupdate program which parses C++ source +files converting calls to the QT_TR_NOOP() and +QT_TRANSLATE_NOOP() macros to .ts +language source files. The lrelease program is then used to +generate .qm binary language files that are distributed with +your application. + + + +Thanks to Detlev Offenbach, PyTQt includes the pytqlupdate +program. This generates the same .ts language source files +from your PyTQt source files. + + + + + +Deploying Commercial PyTQt Applications + +When deploying commercial PyTQt applications it is necessary to discourage users +from accessing the underlying PyTQt modules for themselves. A user that used +the modules shipped with your application to develop new applications would +themselves be considered a developer and would need their own commercial TQt and +PyTQt licenses. + + + +One solution to this problem is the +VendorID +package. This allows you to build Python extension modules that can only be +imported by a digitally signed custom interpreter. The package enables you to +create such an interpreter with your application embedded within it. The +result is an interpreter that can only run your application, and PyTQt modules +that can only be imported by that interpreter. You can use the package to +similarly restrict access to any extension module. + + + +In order to build PyTQt with support for the VendorID package, pass the +-i command line flag to configure.py. + + + +<Literal>pytqtconfig</Literal> and Build System Support + +The SIP build system (ie. the sipconfig module) is described +in the SIP documentation. PyTQt includes the pytqtconfig +module that can be used by configuration scripts of other bindings that are +built on top of PyTQt. + + + +The pytqtconfig module contains the following classes: + + + + +Configuration(sipconfig.Configuration) + + +This class encapsulates additional configuration values, specific to PyTQt, that +can be accessed as instance variables. + + + +The following configuration values are provided (in addition to those provided +by the sipconfig.Configuration class): + + + + +pytqt_bin_dir + + +The name of the directory containing the pytquic and +pytqlupdate executables. + + + + + + +pytqt_config_args + + +The command line passed to configure.py when PyTQt was +configured. + + + + + + +pytqt_mod_dir + + +The name of the directory containing the PyTQt modules. + + + + + + +pytqt_modules + + +A string containing the names of the PyTQt modules that were installed. + + + + + + +pytqt_tqt_sip_flags + + +A string of the SIP flags used to generate the code for the +tqt module and which should be added to those needed by any +module that imports the tqt module. + + + + + + +pytqt_tqtaxcontainer_sip_flags + + +A string of the SIP flags used to generate the code for the +tqtaxcontainer module and which should be added to those +needed by any module that imports the tqtaxcontainer module. + + + + + + +pytqt_tqtcanvas_sip_flags + + +A string of the SIP flags used to generate the code for the +tqtcanvas module and which should be added to those needed by +any module that imports the tqtcanvas module. + + + + + + +pytqt_tqtext_sip_flags + + +A string of the SIP flags used to generate the code for the +tqtext module and which should be added to those needed by +any module that imports the tqtext module. + + + + + + +pytqt_tqtgl_sip_flags + + +A string of the SIP flags used to generate the code for the +tqtgl module and which should be added to those needed by any +module that imports the tqtgl module. + + + + + + +pytqt_tqtnetwork_sip_flags + + +A string of the SIP flags used to generate the code for the +tqtnetwork module and which should be added to those needed +by any module that imports the tqtnetwork module. + + + + + + +pytqt_tqtsql_sip_flags + + +A string of the SIP flags used to generate the code for the +tqtsql module and which should be added to those needed by +any module that imports the tqtsql module. + + + + + + +pytqt_tqttable_sip_flags + + +A string of the SIP flags used to generate the code for the +tqttable module and which should be added to those needed by +any module that imports the tqttable module. + + + + + + +pytqt_tqtui_sip_flags + + +A string of the SIP flags used to generate the code for the +tqtui module and which should be added to those needed by any +module that imports the tqtui module. + + + + + + +pytqt_tqtxml_sip_flags + + +A string of the SIP flags used to generate the code for the +tqtxml module and which should be added to those needed by +any module that imports the tqtxml module. + + + + + + +pytqt_sip_dir + + +The name of the base directory where the .sip files for each +of the PyTQt modules is installed. A sub-directory exists with the same name as +the module. + + + + + + +pytqt_version + + +The PyTQt version as a 3 part hexadecimal number (eg. v3.10 is represented as +0x030a00). + + + + + + +pytqt_version_str + + +The PyTQt version as a string. For development snapshots it will start with +snapshot-. + + + + + + + + + + +TQtModuleMakefile(sipconfig.SIPModuleMakefile) + + +The Makefile class for modules that import the tqt module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + +TQtAxContainerModuleMakefile(TQtModuleMakefile) + + +The Makefile class for modules that import the tqtaxcontainer +module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + +TQtCanvasModuleMakefile(TQtModuleMakefile) + + +The Makefile class for modules that import the tqtcanvas +module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + +TQtExtModuleMakefile(TQtModuleMakefile) + + +The Makefile class for modules that import the tqtext module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + +TQtGLModuleMakefile(TQtModuleMakefile) + + +The Makefile class for modules that import the tqtgl module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + +TQtNetworkModuleMakefile(TQtModuleMakefile) + + +The Makefile class for modules that import the tqtnetwork +module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + +TQtTableModuleMakefile(TQtModuleMakefile) + + +The Makefile class for modules that import the tqttable +module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + +TQtSQLModuleMakefile(TQtTableModuleMakefile) + + +The Makefile class for modules that import the tqtsql module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + +TQtUIModuleMakefile(TQtModuleMakefile) + + +The Makefile class for modules that import the tqtui module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + +TQtXMLModuleMakefile(TQtModuleMakefile) + + +The Makefile class for modules that import the tqtxml module. + + + +finalise(self) + + +This is a reimplementation of sipconfig.Makefile.finalise(). + + + + + + + + + + +%End + + +%ExportedDoc +Things to be Aware Of +super and Wrapped Classes + +Internally PyTQt implements a lazy technique for attribute lookup where +attributes are only placed in type and instance dictionaries when they are +first referenced. This technique is needed to reduce the time taken to import +large modules such as PyTQt. + + + +In most circumstances this technique is transparent to an application. The +exception is when super is used with a PyTQt class. The way +that super is currently implemented means that the lazy +lookup is bypassed resulting in AttributeError exceptions +unless the attribute has been previously referenced. + + + +Note that this restriction applies to any class wrapped by SIP and not just +PyTQt. + + + + +Python Strings, TQt Strings and Unicode + +Unicode support was added to TQt in v2.0 and to Python in v1.6. In TQt, Unicode +support is implemented using the TQString class. It is +important to understand that TQStrings, Python string objects +and Python Unicode objects are all different but conversions between them are +automatic in almost all cases and easy to achieve manually when needed. + + + +Whenever PyTQt expects a TQString as a function argument, a +Python string object or a Python Unicode object can be provided instead, and +PyTQt will do the necessary conversion automatically. + + + +You may also manually convert Python string and Unicode objects to +TQStrings by using the TQString constructor +as demonstrated in the following code fragment. + + + +qs1 = TQString('Converted Python string object') +qs2 = TQString(u'Converted Python Unicode object') + + + +In order to convert a TQString to a Python string object use +the Python str() function. Applying +str() to a null TQString and an empty +TQString both result in an empty Python string object. + + + +In order to convert a TQString to a Python Unicode object use +the Python unicode() function. Applying +unicode() to a null TQString and an empty +TQString both result in an empty Python Unicode object. + + + +Access to Protected Member Functions + +When an instance of a C++ class is not created from Python it is not possible +to access the protected member functions, or emit the signals, of that +instance. Attempts to do so will raise a Python exception. Also, any Python +methods corresponding to the instance's virtual member functions will never be +called. + + + +<Literal>None</Literal> and <Literal>NULL</Literal> + +Throughout the bindings, the None value can be specified +wherever NULL is acceptable to the underlying C++ code. + + + +Equally, NULL is converted to None +whenever it is returned by the underlying C++ code. + + + + +Support for C++ <Literal>void *</Literal> Data Types + +PyTQt represents void * values as objects of type +sip.voidptr. Such values are often used to pass the +addresses of external objects between different Python modules. To make this +easier, a Python integer (or anything that Python can convert to an integer) +can be used whenever a sip.voidptr is expected. + + +A sip.voidptr may be converted to a Python integer by using +the int() builtin function. + + +A sip.voidptr may be converted to a Python string by using +its asstring() method. The asstring() +method takes an integer argument which is the length of the data in bytes. + + + + +Support for Threads + +PyTQt implements the full set of TQt's thread classes. Python, of course, also +has its own thread extension modules. If you are using SIP v4 (or later) and +Python v2.3.5 (or later) then PyTQt does not impose any additional restrictions. +(Read the relevant part of the TQt documentation to understand the restrictions +imposed by the TQt API.) + + +If you are using earlier versions of either SIP or Python then it is possible +to use either of the APIs so long as you follow some simple rules. + + + + +If you use the TQt API then the very first import of one of +the PyTQt modules must be done from the main thread. + + + + +If you use the Python API then all calls to PyTQt (including any +imports) must be done from one thread only. Therefore, if +you want to make calls to PyTQt from several threads then you must use the TQt +API. + + + + +If you want to use both APIs in the same application then all calls to PyTQt +must be done from threads created using the TQt API. + + + + +The above comments actually apply to any SIP generated module, not just PyTQt. + + + +Garbage Collection + +C++ does not garbage collect unreferenced class instances, whereas Python does. +In the following C++ fragment both colours exist even though the first can no +longer be referenced from within the program: + + + +c = new TQColor(); +c = new TQColor(); + + + +In the corresponding Python fragment, the first colour is destroyed when +the second is assigned to c: + + + +c = TQColor() +c = TQColor() + + + +In Python, each colour must be assigned to different names. Typically this +is done within class definitions, so the code fragment would be something like: + + + +self.c1 = TQColor() +self.c2 = TQColor() + + + +Sometimes a TQt class instance will maintain a pointer to another instance and +will eventually call the destructor of that second instance. The most common +example is that a TQObject (and any of its sub-classes) keeps +pointers to its children and will automatically call their destructors. In +these cases, the corresponding Python object will also keep a reference to the +corresponding child objects. + + + +So, in the following Python fragment, the first TQLabel is +not destroyed when the second is assigned to l because the +parent TQWidget still has a reference to it. + + + +p = TQWidget() +l = TQLabel('First label',p) +l = TQLabel('Second label',p) + + + +C++ Variables + +Access to C++ variables is supported. They are accessed as Python instance +variables. For example: + + + +tab = TQTab() +tab.label = "First Tab" +tab.r = TQRect(10,10,75,30) + + + +Global variables and static class variables are effectively read-only. They +can be assigned to, but the underlying C++ variable will not be changed. This +may change in the future. + + + +Access to protected C++ class variables is not supported. This may change in +the future. + + + +Multiple Inheritance + +It is not possible to define a new Python class that sub-classes from more than +one TQt class. + + + +i18n Support + +TQt implements i18n support through the TQt Linguist application, the +TQTranslator class, and the +TQApplication::translate(), TQObject::tr() +and TQObject::trUtf8() methods. Usually the +tr() method is used to obtain the correct translation of a +message. The translation process uses a message context to allow the same +message to be translated differently. tr() is actually +generated by moc and uses the hardcoded class name as the +context. On the other hand, TQApplication::translate() +allows to context to be explicitly stated. + + + +Unfortunately, because of the way TQt implents tr() (and +trUtf8()) it is not possible for PyTQt to exactly reproduce +its behavour. The PyTQt implementation of tr() (and +trUtf8()) uses the class name of the instance as the +context. The key difference, and the source of potential problems, is that the +context is determined dynamically in PyTQt, but is hardcoded in TQt. In other +words, the context of a translation may change depending on an instance's class +hierarchy. + + + +class A(TQObject): + def __init__(self): + TQObject.__init__(self) + + def hello(self): + return self.tr("Hello") + +class B(A): + def __init__(self): + A.__init__(self) + +a = A() +a.hello() + +b = B() +b.hello() + + + +In the above the message is translated by a.hello() using a +context of A, and by b.hello() using a +context of B. In the equivalent C++ version the context +would be A in both cases. + + + +The PyTQt behaviour is unsatisfactory and may be changed in the future. It is +recommended that TQApplication.translate() be used in +preference to tr() (and trUtf8()). This +is guaranteed to work with current and future versions of PyTQt and makes it +much easier to share message files between Python and C++ code. Below is the +alternative implementation of A that uses +TQApplication.translate(). + + + +class A(TQObject): + def __init__(self): + TQObject.__init__(self) + + def hello(self): + return tqApp.translate("A","Hello") + + + +Note that the code generated by pytquic uses +TQApplication.translate(). + + + + + +Signal and Slot Support + +A signal may be either a TQt signal (specified using +SIGNAL()) or a Python signal (specified using +PYSIGNAL()). + + + +A slot can be either a Python callable object, a TQt signal (specified using +SIGNAL()), a Python signal (specified using +PYSIGNAL()), or a TQt slot (specified using +SLOT()). + + + +You connect signals to slots (and other signals) as you would from C++. For +example: + + + +TQObject.connect(a,SIGNAL("TQtSig()"),pyFunction) +TQObject.connect(a,SIGNAL("TQtSig()"),pyClass.pyMethod) +TQObject.connect(a,SIGNAL("TQtSig()"),PYSIGNAL("PySig")) +TQObject.connect(a,SIGNAL("TQtSig()"),SLOT("TQtSlot()")) +TQObject.connect(a,PYSIGNAL("PySig"),pyFunction) +TQObject.connect(a,PYSIGNAL("PySig"),pyClass.pyMethod) +TQObject.connect(a,PYSIGNAL("PySig"),SIGNAL("TQtSig()")) +TQObject.connect(a,PYSIGNAL("PySig"),SLOT("TQtSlot()")) + + + +When a slot is a Python method that corresponds to a TQt slot then a signal can +be connected to either the Python method or the TQt slot. The following +connections achieve the same effect. + + + +sbar = TQScrollBar() +lcd = TQLCDNumber() + +TQObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd.display) +TQObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd,SLOT("display(int)")) + + + +The difference is that the second connection is made at the C++ level and is +more efficient. + + + +Disconnecting signals works in exactly the same way. + + + +Any instance of a class that is derived from the TQObject +class can emit a signal using the emit method. This takes +two arguments. The first is the Python or TQt signal, the second is a Python +tuple which are the arguments to the signal. For example: + + + +a.emit(SIGNAL("clicked()"),()) +a.emit(PYSIGNAL("pySig"),("Hello","World")) + + + +Note that when a slot is a Python callable object its reference count is not +increased. This means that a class instance can be deleted without having to +explicitly disconnect any signals connected to its methods. However, it also +means that using lambda expressions as slots will not work unless you keep a +separate reference to the expression to prevent it from being immediately +garbage collected. + + + +TQt allows a signal to be connected to a slot that requires fewer arguments than +the signal passes. The extra arguments are quietly discarded. Python slots +can be used in the same way. + + + + +Static Member Functions + +Static member functions are implemented as Python class functions. +For example the C++ static member function +TQObject::connect() is called from Python as +TQObject.connect() or self.connect() if +called from a sub-class of TQObject. + + + + +Enumerated Types + +Enumerated types are implemented as a set of simple variables corresponding to +the separate enumerated values. + + + +When using an enumerated value the name of the class (or a sub-class) in which +the enumerated type was defined in must be included. For example: + + + +TQt.SolidPattern +TQWidget.TabFocus +TQFrame.TabFocus + + + + +Module Reference Documentation + +The following sections should be used in conjunction with the normal class +documentation - only the differences specific to the Python bindings are +documented here. + + + +In these sections, Not yet implemented +implies that the feature can be easily implemented if needed. Not +implemented implies that the feature will not be implemented, either +because it cannot be or because it is not appropriate. + + + +If a class is described as being fully implemented then +all non-private member functions and all public class variables have been +implemented. + + + +If an operator has been implemented then it is stated explicitly. + + + +Classes that are not mentioned have not yet been implemented. + + + + +<Literal>tqt</Literal> Module Reference +%End + +%Include tqt/tqglobal.sip +%Include tqt/tqwindowdefs.sip +%Include tqt/tqnamespace.sip + +%Include tqt/tqaccel.sip +%Include tqt/tqaction.sip +%Include tqt/tqapplication.sip +%Include tqt/tqassistantclient.sip +%Include tqt/tqbitmap.sip +%Include tqt/tqbrush.sip +%Include tqt/tqbutton.sip +%Include tqt/tqbuttongroup.sip +%Include tqt/tqbytearray.sip +%Include tqt/tqcdestyle.sip +%Include tqt/tqcheckbox.sip +%Include tqt/tqclipboard.sip +%Include tqt/tqcolor.sip +%Include tqt/tqcolordialog.sip +%Include tqt/tqcolorgroup.sip +%Include tqt/tqcombobox.sip +%Include tqt/tqcommonstyle.sip +%Include tqt/tqcstring.sip +%Include tqt/tqcursor.sip +%Include tqt/tqdatastream.sip +%Include tqt/tqdatetime.sip +%Include tqt/tqdatetimeedit.sip +%Include tqt/tqdesktopwidget.sip +%Include tqt/tqdial.sip +%Include tqt/tqdialog.sip +%Include tqt/tqdir.sip +%Include tqt/tqdockarea.sip +%Include tqt/tqdockwindow.sip +%Include tqt/tqdragobject.sip +%Include tqt/tqdrawutil.sip +%Include tqt/tqdropsite.sip +%Include tqt/tqerrormessage.sip +%Include tqt/tqevent.sip +%Include tqt/tqeventloop.sip +%Include tqt/tqfile.sip +%Include tqt/tqfiledialog.sip +%Include tqt/tqfileinfo.sip +%Include tqt/tqfont.sip +%Include tqt/tqfontdatabase.sip +%Include tqt/tqfontdialog.sip +%Include tqt/tqfontinfo.sip +%Include tqt/tqfontmetrics.sip +%Include tqt/tqframe.sip +%Include tqt/tqgrid.sip +%Include tqt/tqgridview.sip +%Include tqt/tqgroupbox.sip +%Include tqt/tqhbox.sip +%Include tqt/tqhbuttongroup.sip +%Include tqt/tqheader.sip +%Include tqt/tqhgroupbox.sip +%Include tqt/tqiconset.sip +%Include tqt/tqiconview.sip +%Include tqt/tqimage.sip +%Include tqt/tqinputdialog.sip +%Include tqt/tqinterlacestyle.sip +%Include tqt/tqiodevice.sip +%Include tqt/tqkeysequence.sip +%Include tqt/tqlabel.sip +%Include tqt/tqlayout.sip +%Include tqt/tqlcdnumber.sip +%Include tqt/tqlibrary.sip +%Include tqt/tqlineedit.sip +%Include tqt/tqlistbox.sip +%Include tqt/tqlistview.sip +%Include tqt/tqlocale.sip +%Include tqt/tqmainwindow.sip +%Include tqt/tqmemarray.sip +%Include tqt/tqmenubar.sip +%Include tqt/tqmenudata.sip +%Include tqt/tqmessagebox.sip +%Include tqt/tqmetaobject.sip +%Include tqt/tqmime.sip +%Include tqt/tqmotifplusstyle.sip +%Include tqt/tqmotifstyle.sip +%Include tqt/tqmovie.sip +%Include tqt/tqmultilinedit.sip +%Include tqt/tqmutex.sip +%Include tqt/tqnetworkprotocol.sip +%Include tqt/tqobject.sip +%Include tqt/tqobjectcleanuphandler.sip +%Include tqt/tqobjectlist.sip +%Include tqt/tqpaintdevicemetrics.sip +%Include tqt/tqpaintdevice.sip +%Include tqt/tqpainter.sip +%Include tqt/tqpalette.sip +%Include tqt/tqpixmap.sip +%Include tqt/tqpixmapcache.sip +%Include tqt/tqpair.sip +%Include tqt/tqpen.sip +%Include tqt/tqpicture.sip +%Include tqt/tqplatinumstyle.sip +%Include tqt/tqpoint.sip +%Include tqt/tqpointarray.sip +%Include tqt/tqpopupmenu.sip +%Include tqt/tqprintdialog.sip +%Include tqt/tqprinter.sip +%Include tqt/tqprocess.sip +%Include tqt/tqprogressbar.sip +%Include tqt/tqprogressdialog.sip +%Include tqt/tqptrlist.sip +%Include tqt/tqpushbutton.sip +%Include tqt/tqradiobutton.sip +%Include tqt/tqrangecontrol.sip +%Include tqt/tqrect.sip +%Include tqt/tqregexp.sip +%Include tqt/tqregion.sip +%Include tqt/tqscrollbar.sip +%Include tqt/tqscrollview.sip +%Include tqt/tqsemaphore.sip +%Include tqt/tqsemimodal.sip +%Include tqt/tqsessionmanager.sip +%Include tqt/tqsettings.sip +%Include tqt/tqsgistyle.sip +%Include tqt/tqsignalmapper.sip +%Include tqt/tqsimplerichtext.sip +%Include tqt/tqsize.sip +%Include tqt/tqsizegrip.sip +%Include tqt/tqsizepolicy.sip +%Include tqt/tqslider.sip +%Include tqt/tqsocketnotifier.sip +%Include tqt/tqsound.sip +%Include tqt/tqspinbox.sip +%Include tqt/tqsplashscreen.sip +%Include tqt/tqsplitter.sip +%Include tqt/tqstatusbar.sip +%Include tqt/tqstring.sip +%Include tqt/tqstringlist.sip +%Include tqt/tqstrlist.sip +%Include tqt/tqstyle.sip +%Include tqt/tqstylesheet.sip +%Include tqt/tqsyntaxhighlighter.sip +%Include tqt/tqtabbar.sip +%Include tqt/tqtabdialog.sip +%Include tqt/tqtabwidget.sip +%Include tqt/tqtextbrowser.sip +%Include tqt/tqtextcodec.sip +%Include tqt/tqtextedit.sip +%Include tqt/tqtextstream.sip +%Include tqt/tqtextview.sip +%Include tqt/tqthread.sip +%Include tqt/tqtimer.sip +%Include tqt/tqtoolbar.sip +%Include tqt/tqtoolbox.sip +%Include tqt/tqtoolbutton.sip +%Include tqt/tqtooltip.sip +%Include tqt/tqtranslator.sip +%Include tqt/tqurl.sip +%Include tqt/tqurlinfo.sip +%Include tqt/tqurloperator.sip +%Include tqt/tquuid.sip +%Include tqt/tqvalidator.sip +%Include tqt/tqvaluelist.sip +%Include tqt/tqvariant.sip +%Include tqt/tqvbox.sip +%Include tqt/tqvbuttongroup.sip +%Include tqt/tqvgroupbox.sip +%Include tqt/tqwaitcondition.sip +%Include tqt/tqwhatsthis.sip +%Include tqt/tqwidget.sip +%Include tqt/tqwidgetlist.sip +%Include tqt/tqwidgetstack.sip +%Include tqt/tqwindowsstyle.sip +%Include tqt/tqwindowsxpstyle.sip +%Include tqt/tqwizard.sip +%Include tqt/tqwmatrix.sip +%Include tqt/tqworkspace.sip + +%ExportedDoc + +%End + + +%ExportedDoc +<Literal>tqtaxcontainer</Literal> Module Reference +%End + +%Include tqtaxcontainer/tqaxbase.sip +%Include tqtaxcontainer/tqaxobject.sip +%Include tqtaxcontainer/tqaxwidget.sip + +%ExportedDoc + +%End + + +%ExportedDoc +<Literal>tqtcanvas</Literal> Module Reference +%End + +%Include tqtcanvas/tqcanvas.sip + +%ExportedDoc + +%End + + +%ExportedDoc +<Literal>tqtext</Literal> Module Reference + +TQextScintilla + + void getCursorPosition + int *line + int *index + + +This takes no parameters and returns a tuple of the values returned by the +line and index pointers. + + + + void getSelection + int *lineFrom + int *indexFrom + int *lineTo + int *indexTo + + +This takes no parameters and returns a tuple of the values returned by the +lineFrom, indexFrom, +lineTo and indexTo pointers. + + + +TQextScintillaAPIs + +TQextScintillaAPIs is fully implemented. + + + +TQextScintillaBase + +TQextScintillaBase is fully implemented. + + + +TQextScintillaCommand + +TQextScintillaCommand is fully implemented. + + + +TQextScintillaCommandSet + +TQextScintillaCommandSet is fully implemented. + + + +TQextScintillaDocument + +TQextScintillaDocument is fully implemented. + + + +TQextScintillaLexer + +TQextScintillaLexer is fully implemented. + + + +TQextScintillaLexerBash (TQScintilla v1.4+) + +TQextScintillaLexerBash is fully implemented. + + + +TQextScintillaLexerBatch (TQScintilla v1.6+) + +TQextScintillaLexerBatch is fully implemented. + + + +TQextScintillaLexerCPP + +TQextScintillaLexerCPP is fully implemented. + + + +TQextScintillaLexerCSharp + +TQextScintillaLexerCSharp is fully implemented. + + + +TQextScintillaLexerCSS (TQScintilla v1.6+) + +TQextScintillaLexerCSS is fully implemented. + + + +TQextScintillaLexerDiff (TQScintilla v1.6+) + +TQextScintillaLexerDiff is fully implemented. + + + +TQextScintillaLexerHTML (TQScintilla v1.1+) + +TQextScintillaLexerHTML is fully implemented. + + + +TQextScintillaLexerIDL + +TQextScintillaLexerIDL is fully implemented. + + + +TQextScintillaLexerJava + +TQextScintillaLexerJava is fully implemented. + + + +TQextScintillaLexerJavaScript + +TQextScintillaLexerJavaScript is fully implemented. + + + +TQextScintillaLexerLua (TQScintilla v1.5+) + +TQextScintillaLexerLua is fully implemented. + + + +TQextScintillaLexerMakefile (TQScintilla v1.6+) + +TQextScintillaLexerMakefile is fully implemented. + + + +TQextScintillaLexerPerl + +TQextScintillaLexerPerl is fully implemented. + + + +TQextScintillaLexerPOV (TQScintilla v1.6+) + +TQextScintillaLexerPOV is fully implemented. + + + +TQextScintillaLexerProperties (TQScintilla v1.6+) + +TQextScintillaLexerProperties is fully implemented. + + + +TQextScintillaLexerPython + +TQextScintillaLexerPython is fully implemented. + + + +TQextScintillaLexerRuby (TQScintilla v1.5+) + +TQextScintillaLexerRuby is fully implemented. + + + +TQextScintillaLexerSQL (TQScintilla v1.1+) + +TQextScintillaLexerSQL is fully implemented. + + + +TQextScintillaLexerTeX (TQScintilla v1.6+) + +TQextScintillaLexerTeX is fully implemented. + + + +TQextScintillaMacro + +TQextScintillaMacro is fully implemented. + + + +TQextScintillaPrinter + +TQextScintillaPrinter is fully implemented. + + +%End + + +%ExportedDoc + +%End + + +%ExportedDoc +<Literal>tqtgl</Literal> Module Reference +%End + +%Include tqtgl/tqgl.sip +%Include tqtgl/tqglcolormap.sip + +%ExportedDoc + +%End + + +%ExportedDoc +<Literal>tqtnetwork</Literal> Module Reference +%End + +%Include tqtnetwork/tqdns.sip +%Include tqtnetwork/tqftp.sip +%Include tqtnetwork/tqhostaddress.sip +%Include tqtnetwork/tqhttp.sip +%Include tqtnetwork/tqlocalfs.sip +%Include tqtnetwork/tqnetwork.sip +%Include tqtnetwork/tqserversocket.sip +%Include tqtnetwork/tqsocket.sip +%Include tqtnetwork/tqsocketdevice.sip + +%ExportedDoc + +%End + + +%ExportedDoc +<Literal>tqtpe</Literal> Module Reference + +TQPEApplication + + TQApplication + int& argc + char **argv + Type type + + +This takes two parameters, the first of which is a list of argument strings. +Arguments used by TQt are removed from the list. + + + + int exec + + + +This has been renamed to exec_loop in Python. + + + +AppLnk + + virtual TQString exec const + + + +This has been renamed to exec_property in Python. + + + +AppLnkSet + +AppLnkSet is fully implemented. + + + +Config + +Config is fully implemented. + + + +DateFormat + +DateFormat is fully implemented. + + + +DocLnk + + TQString exec const + + + +This has been renamed to exec_property in Python. + + + +DocLnkSet + +DocLnkSet is fully implemented. + + + +FileManager + +FileManager is fully implemented. + + + +FileSelector + +FileSelector is fully implemented. + + + +FileSelectorItem + +FileSelectorItem is fully implemented. + + + +FontDatabase + +FontDatabase is fully implemented. + + + +Global + + static void setBuiltinCommands + Command * + + +Not implemented. + + + +MenuButton + +MenuButton is fully implemented. + + + +TQCopEnvelope + +TQCopEnvelope is fully implemented. + + + +TQDawg + +TQDawg is fully implemented. + + + +TQPEMenuBar + +TQPEMenuBar is fully implemented. + + + +TQPEToolBar + +TQPEToolBar is fully implemented. + + + +Resource + +Resource is fully implemented. + + + + +%End + + +%ExportedDoc +<Literal>tqtsql</Literal> Module Reference +%End + +%Include tqtsql/tqdatabrowser.sip +%Include tqtsql/tqdatatable.sip +%Include tqtsql/tqdataview.sip +%Include tqtsql/tqeditorfactory.sip +%Include tqtsql/tqsql.sip +%Include tqtsql/tqsqlcursor.sip +%Include tqtsql/tqsqldatabase.sip +%Include tqtsql/tqsqldriver.sip +%Include tqtsql/tqsqleditorfactory.sip +%Include tqtsql/tqsqlerror.sip +%Include tqtsql/tqsqlfield.sip +%Include tqtsql/tqsqlform.sip +%Include tqtsql/tqsqlindex.sip +%Include tqtsql/tqsqlpropertymap.sip +%Include tqtsql/tqsqlquery.sip +%Include tqtsql/tqsqlrecord.sip +%Include tqtsql/tqsqlresult.sip +%Include tqtsql/tqsqlselectcursor.sip + +%ExportedDoc + +%End + + +%ExportedDoc +<Literal>tqttable</Literal> Module Reference +%End + +%Include tqttable/tqtable.sip + +%ExportedDoc + +%End + + +%ExportedDoc +<Literal>tqtui</Literal> Module Reference +%End + +%Include tqtui/tqwidgetfactory.sip + +%ExportedDoc + +%End + + +%ExportedDoc +<Literal>tqtxml</Literal> Module Reference +%End + +%Include tqtxml/tqdom.sip + +%ExportedDoc + +%End + + +%Doc +
+%End diff --git a/examples/SQL/README b/examples/SQL/README index 862e608..823937f 100644 --- a/examples/SQL/README +++ b/examples/SQL/README @@ -2,11 +2,11 @@ This directory contains some translated sql examples from TQt 3.x. runform1.py, form1.ui: - A simple designer generated TQDataTable. Run "pyuic form1.ui -o form1.py". + A simple designer generated TQDataTable. Run "pytquic form1.ui -o form1.py". runform2.py, form2.ui: - A simple designer generated TQDataBrowser. Run "pyuic form2.ui -o form2.py". + A simple designer generated TQDataBrowser. Run "pytquic form2.ui -o form2.py". sqlcustom1.py: diff --git a/examples/SQL/connect.ui.h b/examples/SQL/connect.ui.h index 1e9f544..fd37494 100644 --- a/examples/SQL/connect.ui.h +++ b/examples/SQL/connect.ui.h @@ -9,7 +9,7 @@ void ConnectDialog::init() { -from PyTQt.qtsql import TQSqlDatabase +from PyTQt.tqtsql import TQSqlDatabase #qDebug("ConnectDialog init") self.comboDriver.clear() self.comboDriver.insertStringList(TQSqlDatabase.drivers()) diff --git a/examples/SQL/dbconnect.py b/examples/SQL/dbconnect.py index 2fb2b08..75887e6 100755 --- a/examples/SQL/dbconnect.py +++ b/examples/SQL/dbconnect.py @@ -1,8 +1,8 @@ #!/usr/bin/env python import sys -from PyTQt.qt import * -from PyTQt.qtsql import * +from PyTQt.tqt import * +from PyTQt.tqtsql import * from frmconnect import frmConnect from dbpar import * @@ -12,7 +12,7 @@ FALSE = 0 def createConnection(): driver = DB_DRIVER - # all qt examples use TQSqlDatabase::addDatabase, but + # all tqt examples use TQSqlDatabase::addDatabase, but # this never returns NULL in my experience drivers = list(map(str, TQSqlDatabase.drivers())) if driver in drivers: diff --git a/examples/SQL/frmconnect.py b/examples/SQL/frmconnect.py index 0fec45f..430f5b2 100644 --- a/examples/SQL/frmconnect.py +++ b/examples/SQL/frmconnect.py @@ -1,12 +1,12 @@ # Form implementation generated from reading ui file 'frmconnect.ui' # # Created: Sam Jul 6 12:47:10 2002 -# by: The PyTQt User Interface Compiler (pyuic) +# by: The PyTQt User Interface Compiler (pytquic) # # WARNING! All changes made in this file will be lost! -from PyTQt.qt import * +from PyTQt.tqt import * class frmConnect(TQDialog): diff --git a/examples/SQL/runform1.py b/examples/SQL/runform1.py index 0724547..8ef4908 100755 --- a/examples/SQL/runform1.py +++ b/examples/SQL/runform1.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import sys -from PyTQt.qt import * +from PyTQt.tqt import * from form1 import Form1 from dbconnect import createConnection diff --git a/examples/SQL/runform2.py b/examples/SQL/runform2.py index 5644475..112d04f 100755 --- a/examples/SQL/runform2.py +++ b/examples/SQL/runform2.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import sys -from PyTQt.qt import * +from PyTQt.tqt import * from form2 import Form2 from dbconnect import createConnection diff --git a/examples/SQL/runsqlex.py b/examples/SQL/runsqlex.py index ccdec9d..4f35e52 100755 --- a/examples/SQL/runsqlex.py +++ b/examples/SQL/runsqlex.py @@ -1,8 +1,8 @@ #!/usr/bin/env python import sys -from PyTQt.qt import * -from PyTQt.qtsql import * +from PyTQt.tqt import * +from PyTQt.tqtsql import * from sqlex import SqlEx from connect import ConnectDialog diff --git a/examples/SQL/sqlcustom1.py b/examples/SQL/sqlcustom1.py index 1ea3471..0c37911 100755 --- a/examples/SQL/sqlcustom1.py +++ b/examples/SQL/sqlcustom1.py @@ -11,8 +11,8 @@ #*****************************************************************************/ import sys -from PyTQt.qt import * -from PyTQt.qtsql import * +from PyTQt.tqt import * +from PyTQt.tqtsql import * from dbconnect import createConnection diff --git a/examples/SQL/sqlsubclass5.py b/examples/SQL/sqlsubclass5.py index a288099..d627a6c 100755 --- a/examples/SQL/sqlsubclass5.py +++ b/examples/SQL/sqlsubclass5.py @@ -11,8 +11,8 @@ #*****************************************************************************/ import sys -from PyTQt.qt import * -from PyTQt.qtsql import * +from PyTQt.tqt import * +from PyTQt.tqtsql import * from dbconnect import createConnection diff --git a/examples/SQL/sqltable4.py b/examples/SQL/sqltable4.py index 75eddad..13bbe3f 100755 --- a/examples/SQL/sqltable4.py +++ b/examples/SQL/sqltable4.py @@ -11,8 +11,8 @@ #*****************************************************************************/ import sys -from PyTQt.qt import * -from PyTQt.qtsql import * +from PyTQt.tqt import * +from PyTQt.tqtsql import * from dbconnect import createConnection diff --git a/examples/aclock.py b/examples/aclock.py index 23ef169..ca81eb3 100755 --- a/examples/aclock.py +++ b/examples/aclock.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import sys -from PyTQt.qt import * +from PyTQt.tqt import * def TQMIN(x, y): if y > x: return y @@ -19,7 +19,7 @@ class AnalogClock(TQWidget): if new_time.minute() != self.time.minute(): self.update() - def paintEvent(self, qe): + def paintEvent(self, tqe): if not self.isVisible(): return self.time = TQTime.currentTime() diff --git a/examples/addressbook.py b/examples/addressbook.py index 760a164..22683d4 100755 --- a/examples/addressbook.py +++ b/examples/addressbook.py @@ -4,7 +4,7 @@ import sys, string -from PyTQt.qt import * +from PyTQt.tqt import * TRUE = 1 FALSE = 0 diff --git a/examples/application.py b/examples/application.py index 30747e0..6e8a638 100755 --- a/examples/application.py +++ b/examples/application.py @@ -4,7 +4,7 @@ import sys, string -from PyTQt.qt import * +from PyTQt.tqt import * fileopen = [ diff --git a/examples/biff.py b/examples/biff.py index 0fdc9f6..2d41184 100755 --- a/examples/biff.py +++ b/examples/biff.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import os, sys, string -from PyTQt.qt import * +from PyTQt.tqt import * if TQT_VERSION < 0x030100: diff --git a/examples/bigtable.py b/examples/bigtable.py index 85a0349..e3c47a9 100755 --- a/examples/bigtable.py +++ b/examples/bigtable.py @@ -12,8 +12,8 @@ import sys import os -from PyTQt.qt import * -from PyTQt.qttable import * +from PyTQt.tqt import * +from PyTQt.tqttable import * TRUE = 1 FALSE = 0 diff --git a/examples/buttongroups.py b/examples/buttongroups.py index 1fe595a..7b780c2 100755 --- a/examples/buttongroups.py +++ b/examples/buttongroups.py @@ -10,7 +10,7 @@ #*****************************************************************************/ import sys -from PyTQt.qt import * +from PyTQt.tqt import * TRUE = 1 FALSE = 0 @@ -118,7 +118,7 @@ a = TQApplication( sys.argv ) buttonsgroups = ButtonsGroups() buttonsgroups.resize( 500, 250 ) -buttonsgroups.setCaption( "PyQT Example - Buttons and Groups" ) +buttonsgroups.setCaption( "PyTQt Example - Buttons and Groups" ) a.setMainWidget( buttonsgroups ) buttonsgroups.show() diff --git a/examples/canvas/canvas.py b/examples/canvas/canvas.py index 3039cdb..50797e5 100755 --- a/examples/canvas/canvas.py +++ b/examples/canvas/canvas.py @@ -1,8 +1,8 @@ #!/usr/bin/env python import sys -from PyTQt.qt import * -from PyTQt.qtcanvas import * +from PyTQt.tqt import * +from PyTQt.tqtcanvas import * import random @@ -124,7 +124,7 @@ class BouncyLogo(TQCanvasSprite): # Make sure the logo exists. global bouncy_logo if bouncy_logo is None: - bouncy_logo=TQCanvasPixmapArray("qt-trans.xpm") + bouncy_logo=TQCanvasPixmapArray("tqt-trans.xpm") TQCanvasSprite.__init__(self,None,canvas) self.setSequence(bouncy_logo) @@ -587,11 +587,11 @@ if __name__=='__main__': if len(sys.argv) > 2: logo_fn = TQString(sys.argv[2]) else: - logo_fn=TQString("qtlogo.png") + logo_fn=TQString("tqtlogo.png") canvas=TQCanvas(800,600) canvas.setAdvancePeriod(30) - m=Main(canvas,None,"pyqt canvas example") + m=Main(canvas,None,"pytqt canvas example") m.resize(m.sizeHint()) tqApp.setMainWidget(m) diff --git a/examples/canvas/qt-trans.xpm b/examples/canvas/qt-trans.xpm deleted file mode 100644 index 225f684..0000000 --- a/examples/canvas/qt-trans.xpm +++ /dev/null @@ -1,54 +0,0 @@ -/* XPM */ -static char *qtlogo_xpm[] = { -/* width height ncolors chars_per_pixel */ -"54 34 13 1", -/* colors */ -" c #000000", -". c #999999", -"X c #333366", -"o c #6666CC", -"O c #333333", -"@ c #666699", -"# c #000066", -"$ c #666666", -"% c #3333CC", -"& c #000033", -"* c #9999CC", -"= c #333399", -"+ c None", -/* pixels */ -"+++++++++++++++++++.$OOO$.++++++++++++++++++++++++++++", -"+++++++++++++++++$ O.+++++++++++++++++++++++++", -"+++++++++++++++.O $++++++++++++++++++++++++", -"++++++++++++++. $.++.$ O+++++++++++++++++++++++", -"+++++++++++++. O.+++++++$ O++++++++++++++++++++++", -"+++++++++++++O ++++++++++$ $+++++++++++++++++++++", -"++++++++++++$ .+++++++++++O .++++++++++++++++++++", -"+++++++++++. O+++++++++++++ O++++++.+++++++++++++", -"+++++++++++$ .+++++++++++++$ .+++.O +++++++++++++", -"+++++++++++ +++++++++++++++ O+++. +++++++++++++", -"++++++++++. &Xoooo*++++++++++$ +++. +++++++++++++", -"++++++++++@=%%%%%%%%%%*+++++++. .++. +++++++++++++", -"+++++++**oooooo**++*o%%%%o+++++ $++O +++++++++++++", -"+++++*****$OOX@oooo*++*%%%%%*++O $+. OOO$++++++++*", -"++..+.++....$O$+*ooooo*+*o%%%%%O O+$ $$O.++++++**+", -"***+*+++++$$....+++*oooo**+*o%%# O++O ++++++***o*++", -"*+++++++++O $.....++**oooo**+*X &o*O ++++*ooo*++++", -"++++++++++$ O++.....++**oooo*X &%%& ..*o%%*++++++", -"++++++++++$ ++++.....+++**ooO $*o& @oo*+++++++++", -"++++++++++. .++++++.....+++*O Xo*O .++++++++++++", -"+++++++++++ O+++++++++...... .++O +++++++++++++", -"+++++++++++O +++.$$$.++++++. O+++O +++++++++++++", -"+++++++++++. $$OO O.++++O .+++O +++++++++++++", -"++++++++++++O .+++.O $++. O++++O +++++++++++++", -"++++++++++++. O+++++O $+O +++++O +++++++++++++", -"+++++++++++++. O+++++O O .+++++O .++++++++++++", -"++++++++++++++$ .++++O .++++.+$ O+.$.++++++++", -"+++++++++++++++. O$$O .+++++... +++++++++", -"+++++++++++++++++$ O+++++$$+.O O$.+++++++++", -"+++++++++++++++++++$OO O$.O O.++. .++++++++++++++++", -"+++++++++++++++++++++++++++. OO .++++++++++++++++", -"++++++++++++++++++++++++++++. O+++++++++++++++++", -"+++++++++++++++++++++++++++++. .+++++++++++++++++", -"++++++++++++++++++++++++++++++.O O.++++++++++++++++++" -}; diff --git a/examples/canvas/qtlogo.png b/examples/canvas/qtlogo.png deleted file mode 100644 index 96202de..0000000 Binary files a/examples/canvas/qtlogo.png and /dev/null differ diff --git a/examples/canvas/tqt-trans.xpm b/examples/canvas/tqt-trans.xpm new file mode 100644 index 0000000..225f684 --- /dev/null +++ b/examples/canvas/tqt-trans.xpm @@ -0,0 +1,54 @@ +/* XPM */ +static char *qtlogo_xpm[] = { +/* width height ncolors chars_per_pixel */ +"54 34 13 1", +/* colors */ +" c #000000", +". c #999999", +"X c #333366", +"o c #6666CC", +"O c #333333", +"@ c #666699", +"# c #000066", +"$ c #666666", +"% c #3333CC", +"& c #000033", +"* c #9999CC", +"= c #333399", +"+ c None", +/* pixels */ +"+++++++++++++++++++.$OOO$.++++++++++++++++++++++++++++", +"+++++++++++++++++$ O.+++++++++++++++++++++++++", +"+++++++++++++++.O $++++++++++++++++++++++++", +"++++++++++++++. $.++.$ O+++++++++++++++++++++++", +"+++++++++++++. O.+++++++$ O++++++++++++++++++++++", +"+++++++++++++O ++++++++++$ $+++++++++++++++++++++", +"++++++++++++$ .+++++++++++O .++++++++++++++++++++", +"+++++++++++. O+++++++++++++ O++++++.+++++++++++++", +"+++++++++++$ .+++++++++++++$ .+++.O +++++++++++++", +"+++++++++++ +++++++++++++++ O+++. +++++++++++++", +"++++++++++. &Xoooo*++++++++++$ +++. +++++++++++++", +"++++++++++@=%%%%%%%%%%*+++++++. .++. +++++++++++++", +"+++++++**oooooo**++*o%%%%o+++++ $++O +++++++++++++", +"+++++*****$OOX@oooo*++*%%%%%*++O $+. OOO$++++++++*", +"++..+.++....$O$+*ooooo*+*o%%%%%O O+$ $$O.++++++**+", +"***+*+++++$$....+++*oooo**+*o%%# O++O ++++++***o*++", +"*+++++++++O $.....++**oooo**+*X &o*O ++++*ooo*++++", +"++++++++++$ O++.....++**oooo*X &%%& ..*o%%*++++++", +"++++++++++$ ++++.....+++**ooO $*o& @oo*+++++++++", +"++++++++++. .++++++.....+++*O Xo*O .++++++++++++", +"+++++++++++ O+++++++++...... .++O +++++++++++++", +"+++++++++++O +++.$$$.++++++. O+++O +++++++++++++", +"+++++++++++. $$OO O.++++O .+++O +++++++++++++", +"++++++++++++O .+++.O $++. O++++O +++++++++++++", +"++++++++++++. O+++++O $+O +++++O +++++++++++++", +"+++++++++++++. O+++++O O .+++++O .++++++++++++", +"++++++++++++++$ .++++O .++++.+$ O+.$.++++++++", +"+++++++++++++++. O$$O .+++++... +++++++++", +"+++++++++++++++++$ O+++++$$+.O O$.+++++++++", +"+++++++++++++++++++$OO O$.O O.++. .++++++++++++++++", +"+++++++++++++++++++++++++++. OO .++++++++++++++++", +"++++++++++++++++++++++++++++. O+++++++++++++++++", +"+++++++++++++++++++++++++++++. .+++++++++++++++++", +"++++++++++++++++++++++++++++++.O O.++++++++++++++++++" +}; diff --git a/examples/canvas/tqtlogo.png b/examples/canvas/tqtlogo.png new file mode 100644 index 0000000..96202de Binary files /dev/null and b/examples/canvas/tqtlogo.png differ diff --git a/examples/checklists.py b/examples/checklists.py index 5249bb0..52b93e8 100755 --- a/examples/checklists.py +++ b/examples/checklists.py @@ -3,7 +3,7 @@ # Copyright (C) 2002 Oleksandr Yakovlyev (yshurik) import sys -from PyTQt.qt import * +from PyTQt.tqt import * TRUE = 1 FALSE = 0 diff --git a/examples/cursor.py b/examples/cursor.py index f6ef6ee..f4a0ca4 100755 --- a/examples/cursor.py +++ b/examples/cursor.py @@ -10,7 +10,7 @@ ***************************************************************************""" import sys -from PyTQt.qt import * +from PyTQt.tqt import * # cb_bits and cm_bits were generated by X bitmap program. diff --git a/examples/dclock.py b/examples/dclock.py index 9be19eb..08fcafe 100755 --- a/examples/dclock.py +++ b/examples/dclock.py @@ -4,7 +4,7 @@ import sys, string -from PyTQt.qt import * +from PyTQt.tqt import * class DigitalClock(TQLCDNumber): diff --git a/examples/desktop.py b/examples/desktop.py index 909ab91..f695835 100755 --- a/examples/desktop.py +++ b/examples/desktop.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import sys -from PyTQt.qt import * +from PyTQt.tqt import * seed = 0.353535353535 KINDA_RAND_MAX = 32767 diff --git a/examples/dirview.py b/examples/dirview.py index d3c8b0e..a147f3c 100755 --- a/examples/dirview.py +++ b/examples/dirview.py @@ -12,7 +12,7 @@ ***************************************************************************""" import sys -from PyTQt.qt import * +from PyTQt.tqt import * folder_closed_xpm = [ "16 16 9 1", diff --git a/examples/dragdrop.py b/examples/dragdrop.py index ae577be..439e92d 100755 --- a/examples/dragdrop.py +++ b/examples/dragdrop.py @@ -3,7 +3,7 @@ # Ported to PyTQt by Issac Trotts on Jan 1, 2002 import sys -from PyTQt.qt import * +from PyTQt.tqt import * import dropsite, secret diff --git a/examples/drawlines.py b/examples/drawlines.py index 75da388..8e1ac82 100755 --- a/examples/drawlines.py +++ b/examples/drawlines.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import sys, random -from PyTQt.qt import * +from PyTQt.tqt import * TRUE = 1 FALSE = 0 diff --git a/examples/dropsite.py b/examples/dropsite.py index ee8fcfb..162081e 100644 --- a/examples/dropsite.py +++ b/examples/dropsite.py @@ -1,7 +1,7 @@ # This is part of the dragdrop example. -from PyTQt.qt import * +from PyTQt.tqt import * import secret @@ -23,7 +23,7 @@ class DropSite(TQLabel): drobj = TQTextDrag( self.text(), self ) drobj.dragCopy() - def backgroundColorChange( self, qcolor ): + def backgroundColorChange( self, tqcolor ): # Reduce flicker by using repaint() rather than update() self.repaint() diff --git a/examples/fontdisplayer.py b/examples/fontdisplayer.py index bbf53a5..381b4d0 100755 --- a/examples/fontdisplayer.py +++ b/examples/fontdisplayer.py @@ -11,7 +11,7 @@ ***************************************************************************""" import sys -from PyTQt.qt import * +from PyTQt.tqt import * class FontRowTable( TQFrame ): def __init__( self, parent=None, name=None ): diff --git a/examples/fonts.py b/examples/fonts.py index 770778c..7cb3cd1 100755 --- a/examples/fonts.py +++ b/examples/fonts.py @@ -11,7 +11,7 @@ ***************************************************************************""" import sys -from PyTQt.qt import * +from PyTQt.tqt import * class Viewer( TQWidget ): def __init__( self ): diff --git a/examples/gears.py b/examples/gears.py index 71d81c0..e7bef18 100755 --- a/examples/gears.py +++ b/examples/gears.py @@ -3,8 +3,8 @@ import sys import math -from PyTQt.qt import * -from PyTQt.qtgl import * +from PyTQt.tqt import * +from PyTQt.tqtgl import * from OpenGL.GL import * def gear(inner_radius,outer_radius,width,teeth,tooth_depth): diff --git a/examples/i18n/i18n.py b/examples/i18n/i18n.py index 03d7c0c..ba64098 100755 --- a/examples/i18n/i18n.py +++ b/examples/i18n/i18n.py @@ -5,7 +5,7 @@ from whrandom import randint import sys -from PyTQt.qt import * +from PyTQt.tqt import * from mywidget import MyWidget diff --git a/examples/i18n/mywidget.py b/examples/i18n/mywidget.py index 760f4f8..cf5abea 100644 --- a/examples/i18n/mywidget.py +++ b/examples/i18n/mywidget.py @@ -1,6 +1,6 @@ # Copyright (c) 2002 Detlev Offenbach -from PyTQt.qt import * +from PyTQt.tqt import * class MyWidget(TQMainWindow): diff --git a/examples/lineedits.py b/examples/lineedits.py index b3248fe..fe566ba 100755 --- a/examples/lineedits.py +++ b/examples/lineedits.py @@ -11,7 +11,7 @@ #*****************************************************************************/ import sys -from PyTQt.qt import * +from PyTQt.tqt import * TRUE = 1 FALSE = 0 diff --git a/examples/listbox.py b/examples/listbox.py index af142eb..d5bf2e1 100755 --- a/examples/listbox.py +++ b/examples/listbox.py @@ -11,7 +11,7 @@ ***************************************************************************""" import sys -from PyTQt.qt import * +from PyTQt.tqt import * FALSE = 0 TRUE = 1 diff --git a/examples/listboxcombo.py b/examples/listboxcombo.py index c997dab..b6b546e 100755 --- a/examples/listboxcombo.py +++ b/examples/listboxcombo.py @@ -11,7 +11,7 @@ ***************************************************************************""" import sys -from PyTQt.qt import * +from PyTQt.tqt import * FALSE = 0 TRUE = 1 @@ -34,7 +34,7 @@ class ListBoxCombo( TQVBox ): self.lb1.setSelectionMode( TQListBox.Multi ) # ...insert a pixmap item... - xpm = TQPixmap( "qtlogo.png" ) + xpm = TQPixmap( "tqtlogo.png" ) txt = TQString() TQListBoxPixmap( self.lb1, xpm, txt ) diff --git a/examples/mdi.py b/examples/mdi.py index daf750b..591a4eb 100755 --- a/examples/mdi.py +++ b/examples/mdi.py @@ -4,7 +4,7 @@ import sys, string -from PyTQt.qt import * +from PyTQt.tqt import * fileopen = [ diff --git a/examples/menu.py b/examples/menu.py index ab9146e..f363195 100755 --- a/examples/menu.py +++ b/examples/menu.py @@ -11,7 +11,7 @@ #*****************************************************************************/ import sys, string -from PyTQt.qt import * +from PyTQt.tqt import * TRUE = 1 FALSE = 0 diff --git a/examples/progress.py b/examples/progress.py index e38e737..e2344cc 100755 --- a/examples/progress.py +++ b/examples/progress.py @@ -13,7 +13,7 @@ #*****************************************************************************/ import sys -from PyTQt.qt import * +from PyTQt.tqt import * from random import randint class AnimatedThingy(TQLabel): diff --git a/examples/progressbar.py b/examples/progressbar.py index dbb6e4e..b507d08 100755 --- a/examples/progressbar.py +++ b/examples/progressbar.py @@ -12,7 +12,7 @@ #import pdb import sys -from PyTQt.qt import * +from PyTQt.tqt import * FALSE = 0 TRUE = 1 diff --git a/examples/qdir.py b/examples/qdir.py deleted file mode 100755 index c08e9bc..0000000 --- a/examples/qdir.py +++ /dev/null @@ -1,324 +0,0 @@ -#!/usr/bin/env python -# -# 2005-02-12 initial version hp - -from __future__ import print_function -import os -import pickle -from PyTQt.qt import * -from dirview import Directory, DirectoryView - -bookmarks = [ - "22 14 8 1", - "# c #000080", - "a c #585858", - "b c #000000", - "c c #ffffff", - "d c #ffffff", - "e c #ffffff", - "f c #000000", - ". c None", - "...bb.................", - "..bacb....bbb.........", - "..badcb.bbccbab.......", - "..bacccbadccbab.......", - "..baecdbcccdbab.......", - "..bacccbacccbab.......", - "..badcdbcecdfab.......", - "..bacecbacccbab.......", - "..baccdbcccdbab.......", - "...badcbacdbbab.......", - "....bacbcbbccab.......", - ".....babbaaaaab.......", - ".....bbabbbbbbb.......", - "......bb.............." -] - -home = [ - "16 15 4 1", - "# c #000000", - "a c #ffffff", - "b c #c0c0c0", - ". c None", - ".......##.......", - "..#...####......", - "..#..#aabb#.....", - "..#.#aaaabb#....", - "..##aaaaaabb#...", - "..#aaaaaaaabb#..", - ".#aaaaaaaaabbb#.", - "###aaaaaaaabb###", - "..#aaaaaaaabb#..", - "..#aaa###aabb#..", - "..#aaa#.#aabb#..", - "..#aaa#.#aabb#..", - "..#aaa#.#aabb#..", - "..#aaa#.#aabb#..", - "..#####.######.." -] - - -class PixmapView(TQScrollView): - def __init__(self, parent): - TQScrollView.__init__(self, parent) - self.pixmap = None - self.viewport().setBackgroundMode(self.PaletteBase) - - def setPixmap(self, pix): - self.pixmap = pix - self.resizeContents(pix.size().width(), pix.size().height()) - self.viewport().repaint(False) - - def drawContents(self, p, cx, cy, cw, ch): - p.fillRect(cx, cy, cw, ch, self.colorGroup().brush(TQColorGroup.Base)) - p.drawPixmap(0, 0, self.pixmap) - - -class Preview(TQWidgetStack): - def __init__(self, parent): - TQWidgetStack.__init__(self, parent) - self.normalText = TQMultiLineEdit(self) - self.normalText.setReadOnly(True) - self.html = TQTextView(self) - self.pixmap = PixmapView(self) - self.raiseWidget(self.normalText) - - def showPreview(self, url, size): - if url.isLocalFile(): - path = url.path() - fi = TQFileInfo(path) - if fi.isFile() and fi.size() > size * 1000: - self.normalText.setText( - "The File\n%s\nis too large, so I don't show it!" % path) - self.raiseWidget(self.normalText) - return - pix = TQPixmap(path) - if pix.isNull(): - if fi.isFile(): - err = False - try: - text = open(path.latin1(), "r").read() - except IOError as msg: - text = TQString(str(msg)) - err = True - if not err and fi.extension().lower().contains("htm"): - url = self.html.mimeSourceFactory().makeAbsolute( - path, self.html.context()) - self.html.setText(text, url) - self.raiseWidget(self.html) - return - else: - self.normalText.setText(text) - self.raiseWidget(self.normalText) - return - else: - self.normalText.setText("") - self.raiseWidget(self.normalText) - else: - self.pixmap.setPixmap(pix) - self.raiseWidget(self.pixmap) - else: - self.normalText.setText("I only show local files!") - self.raiseWidget(self.normalText) - - -# We can't instantiate TQFilePreview directly because it is abstract. Note that -# the previewUrl() abstract is patched in later to work around the fact that -# you can't multiply inherit from more than one wrapped class. -class FilePreview(TQFilePreview): - pass - - -class PreviewWidget(TQVBox): - def __init__(self, parent): - TQVBox.__init__(self, parent) - self.setSpacing( 5 ) - self.setMargin( 5 ) - row = TQHBox(self) - row.setSpacing(5) - TQLabel("Only show files smaller than: ", row) - self.sizeSpinBox = TQSpinBox(1, 10000, 1, row) - self.sizeSpinBox.setSuffix(" KB") - self.sizeSpinBox.setValue(128) - row.setFixedHeight(10 + self.sizeSpinBox.sizeHint().height()) - self.__preview = Preview(self) - # workaround sip inability of multiple inheritance - # create a local TQFilePreview instance and redirect - # the method, which is called on preview, to us - self.preview = FilePreview() - self.preview.previewUrl = self.previewUrl - - def previewUrl(self, url): - self.__preview.showPreview(url, self.sizeSpinBox.value()) - - -class CustomFileDialog(TQFileDialog): - def __init__(self, preview = False): - TQFileDialog.__init__(self, None, None, True) - self.bookmarkFile = ".pybookmarks" - self.bookmarkList = [] - if os.path.exists(self.bookmarkFile): - try: - self.bookmarkList = pickle.loads(open(self.bookmarkFile, "rb").read()) - except IOError as msg: - print(msg) - self.setDir("/") - self.dirView = DirectoryView(self, None, True) - self.dirView.addColumn("") - self.dirView.header().hide() - root = Directory(self.dirView, "/") - root.setOpen(True) - self.dirView.setFixedWidth(200) - self.addLeftWidget(self.dirView) - p = TQPushButton(self) - p.setPixmap(TQPixmap(bookmarks)) - TQToolTip.add(p, "Bookmarks") - self.bookmarkMenu = TQPopupMenu(self) - self.connect(self.bookmarkMenu, SIGNAL("activated(int)"), - self.bookmarkChosen) - self.addId = self.bookmarkMenu.insertItem("Add bookmark") - self.bookmarkMenu.insertSeparator() - for l in self.bookmarkList: - self.bookmarkMenu.insertItem(l) - p.setPopup(self.bookmarkMenu) - self.addToolButton(p, True) - self.connect(self.dirView, PYSIGNAL("folderSelected(const TQString &)"), - self.setDir2) - self.connect(self, SIGNAL("dirEntered(const TQString &)"), - self.dirView.setDir) - b = TQToolButton(self) - TQToolTip.add(b, "Go Home!") - b.setPixmap(TQPixmap(home)) - self.connect(b, SIGNAL("clicked()"), self.goHome) - self.addToolButton(b) - - if preview: - self.setContentsPreviewEnabled(True) - pw = PreviewWidget(self) - self.setContentsPreview(pw, pw.preview) - self.setViewMode(TQFileDialog.List) - self.setPreviewMode(TQFileDialog.Contents) - - w = self.width() - h = self.height() - if preview: - self.resize(w + w / 2, h + h / 3) - else: - self.resize(w + w / 3, h + h / 4) - - def done(self, r): - if self.bookmarkList: - try: - open(self.bookmarkFile, "wb").write(pickle.dumps(self.bookmarkList)) - except IOError as msg: - print(msg) - return TQFileDialog.done(self, r) - - def showEvent(self, e): - TQFileDialog.showEvent(self, e) - self.dirView.setDir(self.dirPath()) - - def setDir2(self, path): - self.blockSignals(True) - self.setDir(path) - self.blockSignals(False) - - def bookmarkChosen(self, i): - if i == self.addId: - # keep bookmarks pythonic - dp = self.dirPath().latin1() - if dp not in self.bookmarkList: - self.bookmarkList.append(dp) - self.bookmarkMenu.insertItem(dp) - else: - self.setDir(self.bookmarkMenu.text(i)) - - def goHome(self): - if os.getenv("HOME"): - self.setDir(os.getenv("HOME")) - else: - self.setDir("/") - - -if __name__ == '__main__': - import sys - import getopt - - def usage(msg = None): - if msg: - print(msg, file=sys.stderr) - print("""\ -usage: qdir [--any | --dir | --custom] [--preview] [--default f] {--filter f} [caption ...] - --any Get any filename, need not exist. - --dir Return a directory rather than a file. - --custom Opens a customized TQFileDialog with - dir browser, bookmark menu, etc. - --preview Show a preview widget. - --default f Start from directory/file f. - --filter f eg. '*.gif' '*.bmp' - caption ... Caption for dialog. -""", file=sys.stderr) - sys.exit(1) - - def main(): - options = ["help", "any", "dir", "custom", "preview", "default=", "filter="] - mode = TQFileDialog.ExistingFile - preview = False - custom = False - start = None - filter = TQString.null - app = TQApplication(sys.argv) - - try: - optlist, args = getopt.getopt(sys.argv[1:], "h", options) - except getopt.error as msg: - usage(msg) - - for opt, par in optlist: - if opt in ("-h", "--help"): - usage() - elif opt == "--any": - mode = TQFileDialog.AnyFile - elif opt == "--dir": - mode = TQFileDialog.Directory - elif opt == "--default": - start = par - elif opt == "--filter": - filter = par - elif opt == "--preview": - preview = True - elif opt == "--custom": - custom = True - if args: - caption = " ".join(args) - elif mode == TQFileDialog.Directory: - caption = "Choose directory..." - else: - caption = "Choose file..." - if not start: - start = TQDir.currentDirPath() - if not custom: - fd = TQFileDialog(TQString.null, filter, None, None, True) - fd.setMode(mode) - if preview: - fd.setContentsPreviewEnabled(True) - pw = PreviewWidget(fd) - fd.setContentsPreview(pw, pw.preview) - fd.setViewMode(TQFileDialog.List) - fd.setPreviewMode(TQFileDialog.Contents) - w = fd.width() - h = fd.height() - fd.resize(w + w / 3, h + h / 4) - fd.setCaption(caption) - fd.setSelection(start) - if fd.exec_loop() == TQDialog.Accepted: - print("%s\n" % fd.selectedFile().latin1()) - return 0 - else: - return 1 - else: - fd = CustomFileDialog(preview) - fd.exec_loop() - return 1 - - sys.exit(main()) diff --git a/examples/qmag.py b/examples/qmag.py deleted file mode 100755 index bad7ecf..0000000 --- a/examples/qmag.py +++ /dev/null @@ -1,233 +0,0 @@ -#!/usr/bin/env python - -#**************************************************************************** -#** $Id: qmag.py,v 1.1 2002/06/20 18:52:31 phil Exp $ -#** -#** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved. -#** -#** This file is part of an example program for PyTQt. This example -#** program may be used, distributed and modified without limitation. -#** -#*****************************************************************************/ - -import sys -from PyTQt.qt import * - -TRUE = 1 -FALSE = 0 - -zoomfactors = ["100%","200%","300%","400%","500%","600%","700%","800%","1600%"] - -refreshrates = [ - "No autorefresh", "50 per second", "4 per second", "3 per second", - "2 per second", "Every second", "Every two seconds", "Every three seconds", - "Every five seconds", "Every ten seconds"] - -timer = (0, 20, 250, 333, 500, 1000, 2000, 3000, 5000, 10000) - -class MagWidget(TQWidget): - def __init__(self, tqApp, parent = None, name = None): - self.qApp = tqApp - TQWidget.__init__(self, parent, name) - self.pm = TQPixmap() # pixmap magnified - self.p = TQPixmap() # pixmap - self.image = TQImage() # image of pixmap (for RGB) - self.z = 0 # zoom factor - self.r = 0 # autorefresh rate (index into refreshrates) - self.grabbing = FALSE # TRUE if currently grabbing - self.grabx = -1 - self.graby = -1 - - self.zoom = TQComboBox(FALSE, self) - self.zoom.insertStrList(zoomfactors, len(zoomfactors)) - self.connect(self.zoom, SIGNAL("activated(int)"), - self.setZoom) - - self.refresh = TQComboBox(FALSE, self) - self.refresh.insertStrList(refreshrates, len(refreshrates)) - self.connect(self.refresh, SIGNAL("activated(int)"), - self.setRefresh) - - x = 0 - w = 0 - h = 20 - for s in zoomfactors: - cw = self.zoom.fontMetrics().width(s) - w = max(cw, w) - self.zoom.setGeometry(x, 2, w + 30, h) - - x = w + 34 - w = 0 - for s in refreshrates: - cw = self.refresh.fontMetrics().width(s) - w = max(cw, w) - self.refresh.setGeometry(x, 2, w + 30, h) - - self.saveButton = TQPushButton(self) - self.connect(self.saveButton, SIGNAL("clicked()"), self.save) - self.saveButton.setText("Save") - self.saveButton.setGeometry(x + w + 30 + 2, 2, - 10 + self.saveButton.fontMetrics().width("Save"), h) - - self.quitButton = TQPushButton(self) - self.connect(self.quitButton, SIGNAL("clicked()"), self.qApp, SLOT("quit()")) - self.quitButton.setText("Quit") - self.quitButton.setGeometry(self.saveButton.geometry().right() + 2, 2, - 10 + self.quitButton.fontMetrics().width("Quit"), h) - - self.rgb = TQLabel(self) - self.rgb.setText("") - self.rgb.setAlignment(TQt.AlignVCenter) - self.rgb.resize(self.width(), self.rgb.fontMetrics().height() + 4) - - self.yoffset = self.zoom.height() + 4 + self.rgb.height() - self.setMinimumSize(self.quitButton.geometry().topRight().x() + 2, - self.yoffset + 20) - w = self.quitButton.geometry().topRight().x() + 2 - self.resize(w, w) - - self.setMouseTracking(TRUE) - self.grabx = self.qApp.desktop().width() / 2 - self.graby = self.qApp.desktop().height() / 2 - self.grabAround(TQPoint(self.grabx, self.graby)) - - #self.zoom.setCurrentItem(1) # grabAround sets zoom factor - #self.setZoom(1) - self.refresh.setCurrentItem(5) - self.setRefresh(5) - - def setZoom(self, index): - if index == 8: - self.z = 16 - else: - self.z = index + 1 - self.grab() - - def setRefresh(self, index): - self.r = index - self.killTimers() - if index and not self.grabbing: - #print "st:", timer[index] - self.startTimer(timer[index]) - - def save(self): - if not self.p.isNull(): - self.killTimers() - fn = TQFileDialog.getSaveFileName() - if not fn.isEmpty(): - self.p.save(fn, "BMP") - if self.r: - self.startTimer(timer[self.r]) - - def grab(self): - if not self.isVisible() or self.grabx < 0 or self.graby < 0: - return - - w = (self.width() + self.z - 1) / self.z - h = (self.height() + self.z - 1 - self.yoffset) / self.z - - if w < 1 or h < 1: - return - - x = self.grabx - w / 2 - y = self.graby - h / 2 - - if x + w > TQApplication.desktop().width(): - x = TQApplication.desktop().width() - w - elif x < 0: - x = 0 - - if y + h > TQApplication.desktop().height(): - y = TQApplication.desktop().height() - h - elif y < 0: - y = 0 - - self.p = TQPixmap.grabWindow(TQApplication.desktop().winId(), x, y, w, h) - self.image = self.p.convertToImage() - m = TQWMatrix() - #print "z:", self.z - m.scale(float(self.z), float(self.z)) - self.pm = self.p.xForm(m) - self.repaint(FALSE) - - def paintEvent(self, e): - if not self.pm.isNull(): - paint = TQPainter(self) - paint.drawPixmap(0, self.zoom.height() + 4, self.pm, - 0, 0, self.width(), self.height() - self.yoffset) - - def mousePressEvent(self, e): - if not self.grabbing: - self.grabbing = TRUE - self.killTimers() - self.grabMouse(TQt.crossCursor) - self.grabx = -1 - self.graby = -1 - else: - self.grabx = self.mapToGlobal(e.pos()).x() - self.graby = self.mapToGlobal(e.pos()).y() - - def mouseReleaseEvent(self, e): - if self.grabbing and self.grabx >= 0 and self.graby >= 0: - self.grabbing = FALSE - self.grabAround(e.pos()) - self.releaseMouse() - - def grabAround(self, pos): - rx = self.mapToGlobal(pos).x() - ry = self.mapToGlobal(pos).y() - w = abs(rx - self.grabx) - h = abs(ry - self.graby) - if w > 10 and h > 10: - pz = 1 - while w*pz*h*pz < self.width()*(self.height()-self.yoffset) and \ - w*pz < TQApplication.desktop().width() and \ - h*pz < TQApplication.desktop().height(): - pz += 1 - if (w*pz*h*pz - self.width()*(self.height()-self.yoffset)) > \ - (self.width()*(self.height()-self.yoffset) - w*(pz-1)*h*(pz-1)): - pz -= 1 - if pz < 1: - pz = 1 - elif pz > 8: - pz = 8 - self.zoom.setCurrentItem(pz-1) - self.z = pz - self.grabx = min(rx, self.grabx) + w / 2 - self.graby = min(ry, self.graby) + h / 2 - #self.resize(w*self.z, h*self.z*self.yoffset) - self.grab() - - def mouseMoveEvent(self, e): - if self.grabbing or self.pm.isNull() or \ - e.pos().y() > self.height() - self.zoom.fontMetrics().height() - 4 or \ - e.pos().y() < self.zoom.height() + 4: - self.rgb.setText("") - else: - x = e.pos().x() / self.z - y = (e.pos().y() - self.zoom.height() - 4) / self.z - pixelinfo = "" - if self.image.valid(x, y): - px = self.image.pixel(x, y) - pixelinfo = "%3d,%3d,%3d #%02x%02x%02x" % ( - tqRed(px), tqGreen(px), tqBlue(px), - tqRed(px), tqGreen(px), tqBlue(px)) - self.rgb.setText("x=%d, y=%d %s" % \ - (x + self.grabx, y + self.graby, pixelinfo)) - - def focusOutEvent(self, e): - self.rgb.setText("") - - def timerEvent(self, e): - self.grab() - - def resizeEvent(self, e): - self.rgb.setGeometry(0, self.height() - self.rgb.height(), - self.width(), self.rgb.height()) - -if __name__=='__main__': - app = TQApplication( sys.argv ) - m = MagWidget(app) - app.setMainWidget(m) - m.show() - app.exec_loop() diff --git a/examples/qt.png b/examples/qt.png deleted file mode 100644 index d63e16f..0000000 Binary files a/examples/qt.png and /dev/null differ diff --git a/examples/qtlogo.png b/examples/qtlogo.png deleted file mode 100644 index c83c7b2..0000000 Binary files a/examples/qtlogo.png and /dev/null differ diff --git a/examples/rangecontrols.py b/examples/rangecontrols.py index f59d7fc..e7983e2 100755 --- a/examples/rangecontrols.py +++ b/examples/rangecontrols.py @@ -11,7 +11,7 @@ ***************************************************************************""" import sys -from PyTQt.qt import * +from PyTQt.tqt import * INT_MAX = sys.maxsize diff --git a/examples/richtext.py b/examples/richtext.py index 3ae6e81..14728ab 100755 --- a/examples/richtext.py +++ b/examples/richtext.py @@ -11,7 +11,7 @@ ***************************************************************************""" import sys -from PyTQt.qt import * +from PyTQt.tqt import * sayings = [ "Saying 1:
" diff --git a/examples/secret.py b/examples/secret.py index f2f5a64..9d3f2d4 100644 --- a/examples/secret.py +++ b/examples/secret.py @@ -1,7 +1,7 @@ # This is part of the dragdrop example. -from PyTQt.qt import * +from PyTQt.tqt import * def canDecode(e): diff --git a/examples/semaphore.py b/examples/semaphore.py index ecf1209..99b9bc6 100755 --- a/examples/semaphore.py +++ b/examples/semaphore.py @@ -7,12 +7,12 @@ import sys # Check if thread support was enabled. try: - from PyTQt.qt import TQThread + from PyTQt.tqt import TQThread except: print("Thread support not enabled") sys.exit(1) -from PyTQt.qt import * +from PyTQt.tqt import * # The semaphore instances. diff --git a/examples/smalltable.py b/examples/smalltable.py index ccee6c8..e3521e1 100755 --- a/examples/smalltable.py +++ b/examples/smalltable.py @@ -12,8 +12,8 @@ import sys import os -from PyTQt.qt import * -from PyTQt.qttable import * +from PyTQt.tqt import * +from PyTQt.tqttable import * TRUE = 1 FALSE = 0 diff --git a/examples/splitter.py b/examples/splitter.py index 534e50e..935cf66 100755 --- a/examples/splitter.py +++ b/examples/splitter.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import sys -from PyTQt.qt import * +from PyTQt.tqt import * class Test(TQWidget): def __init__(self, parent=None, name='Test', f=0): diff --git a/examples/tabdialog.py b/examples/tabdialog.py index 2fcc050..05365ff 100755 --- a/examples/tabdialog.py +++ b/examples/tabdialog.py @@ -11,7 +11,7 @@ ***************************************************************************""" import sys -from PyTQt.qt import * +from PyTQt.tqt import * class TabDialog( TQTabDialog ): def __init__( self, parent=None, name=None, filename=None ): diff --git a/examples/tablestatistics.py b/examples/tablestatistics.py index 1288ff0..dd3058d 100755 --- a/examples/tablestatistics.py +++ b/examples/tablestatistics.py @@ -12,8 +12,8 @@ import sys import os -from PyTQt.qt import * -from PyTQt.qttable import * +from PyTQt.tqt import * +from PyTQt.tqttable import * TRUE = 1 FALSE = 0 @@ -52,11 +52,11 @@ class Table(TQTable): def initTable(self): # read all the TQt source and header files into a list all = [] - qtdir = os.getenv("TQTDIR") - if qtdir is None: + tqtdir = os.getenv("TQTDIR") + if tqtdir is None: raise Exception("The TQTDIR environment variable has not been set.") for i in dirs: - dir = TQDir(os.path.join(qtdir, "src", i)) + dir = TQDir(os.path.join(tqtdir, "src", i)) lst = TQStringList(dir.entryList("*.cpp; *.h")) for f in lst: if f.contains("moc"): @@ -71,7 +71,7 @@ class Table(TQTable): # insert the data into the table for it in all: self.setText(i, TB_FILE, it) - f = TQFile(os.path.join(qtdir, "src", str(it))) + f = TQFile(os.path.join(tqtdir, "src", str(it))) self.setText(i, TB_SIZE, str(f.size())) ci = ComboItem(self, TQTableItem.WhenCurrent) self.setItem(i, TB_FLAG, ci) diff --git a/examples/tooltip.py b/examples/tooltip.py index b55e0d6..ed36888 100755 --- a/examples/tooltip.py +++ b/examples/tooltip.py @@ -11,7 +11,7 @@ ***************************************************************************""" import sys -from PyTQt.qt import * +from PyTQt.tqt import * from random import random class DynamicTip( TQToolTip ): diff --git a/examples/tqdir.py b/examples/tqdir.py new file mode 100755 index 0000000..8ed9d5e --- /dev/null +++ b/examples/tqdir.py @@ -0,0 +1,324 @@ +#!/usr/bin/env python +# +# 2005-02-12 initial version hp + +from __future__ import print_function +import os +import pickle +from PyTQt.tqt import * +from dirview import Directory, DirectoryView + +bookmarks = [ + "22 14 8 1", + "# c #000080", + "a c #585858", + "b c #000000", + "c c #ffffff", + "d c #ffffff", + "e c #ffffff", + "f c #000000", + ". c None", + "...bb.................", + "..bacb....bbb.........", + "..badcb.bbccbab.......", + "..bacccbadccbab.......", + "..baecdbcccdbab.......", + "..bacccbacccbab.......", + "..badcdbcecdfab.......", + "..bacecbacccbab.......", + "..baccdbcccdbab.......", + "...badcbacdbbab.......", + "....bacbcbbccab.......", + ".....babbaaaaab.......", + ".....bbabbbbbbb.......", + "......bb.............." +] + +home = [ + "16 15 4 1", + "# c #000000", + "a c #ffffff", + "b c #c0c0c0", + ". c None", + ".......##.......", + "..#...####......", + "..#..#aabb#.....", + "..#.#aaaabb#....", + "..##aaaaaabb#...", + "..#aaaaaaaabb#..", + ".#aaaaaaaaabbb#.", + "###aaaaaaaabb###", + "..#aaaaaaaabb#..", + "..#aaa###aabb#..", + "..#aaa#.#aabb#..", + "..#aaa#.#aabb#..", + "..#aaa#.#aabb#..", + "..#aaa#.#aabb#..", + "..#####.######.." +] + + +class PixmapView(TQScrollView): + def __init__(self, parent): + TQScrollView.__init__(self, parent) + self.pixmap = None + self.viewport().setBackgroundMode(self.PaletteBase) + + def setPixmap(self, pix): + self.pixmap = pix + self.resizeContents(pix.size().width(), pix.size().height()) + self.viewport().repaint(False) + + def drawContents(self, p, cx, cy, cw, ch): + p.fillRect(cx, cy, cw, ch, self.colorGroup().brush(TQColorGroup.Base)) + p.drawPixmap(0, 0, self.pixmap) + + +class Preview(TQWidgetStack): + def __init__(self, parent): + TQWidgetStack.__init__(self, parent) + self.normalText = TQMultiLineEdit(self) + self.normalText.setReadOnly(True) + self.html = TQTextView(self) + self.pixmap = PixmapView(self) + self.raiseWidget(self.normalText) + + def showPreview(self, url, size): + if url.isLocalFile(): + path = url.path() + fi = TQFileInfo(path) + if fi.isFile() and fi.size() > size * 1000: + self.normalText.setText( + "The File\n%s\nis too large, so I don't show it!" % path) + self.raiseWidget(self.normalText) + return + pix = TQPixmap(path) + if pix.isNull(): + if fi.isFile(): + err = False + try: + text = open(path.latin1(), "r").read() + except IOError as msg: + text = TQString(str(msg)) + err = True + if not err and fi.extension().lower().contains("htm"): + url = self.html.mimeSourceFactory().makeAbsolute( + path, self.html.context()) + self.html.setText(text, url) + self.raiseWidget(self.html) + return + else: + self.normalText.setText(text) + self.raiseWidget(self.normalText) + return + else: + self.normalText.setText("") + self.raiseWidget(self.normalText) + else: + self.pixmap.setPixmap(pix) + self.raiseWidget(self.pixmap) + else: + self.normalText.setText("I only show local files!") + self.raiseWidget(self.normalText) + + +# We can't instantiate TQFilePreview directly because it is abstract. Note that +# the previewUrl() abstract is patched in later to work around the fact that +# you can't multiply inherit from more than one wrapped class. +class FilePreview(TQFilePreview): + pass + + +class PreviewWidget(TQVBox): + def __init__(self, parent): + TQVBox.__init__(self, parent) + self.setSpacing( 5 ) + self.setMargin( 5 ) + row = TQHBox(self) + row.setSpacing(5) + TQLabel("Only show files smaller than: ", row) + self.sizeSpinBox = TQSpinBox(1, 10000, 1, row) + self.sizeSpinBox.setSuffix(" KB") + self.sizeSpinBox.setValue(128) + row.setFixedHeight(10 + self.sizeSpinBox.sizeHint().height()) + self.__preview = Preview(self) + # workaround sip inability of multiple inheritance + # create a local TQFilePreview instance and redirect + # the method, which is called on preview, to us + self.preview = FilePreview() + self.preview.previewUrl = self.previewUrl + + def previewUrl(self, url): + self.__preview.showPreview(url, self.sizeSpinBox.value()) + + +class CustomFileDialog(TQFileDialog): + def __init__(self, preview = False): + TQFileDialog.__init__(self, None, None, True) + self.bookmarkFile = ".pybookmarks" + self.bookmarkList = [] + if os.path.exists(self.bookmarkFile): + try: + self.bookmarkList = pickle.loads(open(self.bookmarkFile, "rb").read()) + except IOError as msg: + print(msg) + self.setDir("/") + self.dirView = DirectoryView(self, None, True) + self.dirView.addColumn("") + self.dirView.header().hide() + root = Directory(self.dirView, "/") + root.setOpen(True) + self.dirView.setFixedWidth(200) + self.addLeftWidget(self.dirView) + p = TQPushButton(self) + p.setPixmap(TQPixmap(bookmarks)) + TQToolTip.add(p, "Bookmarks") + self.bookmarkMenu = TQPopupMenu(self) + self.connect(self.bookmarkMenu, SIGNAL("activated(int)"), + self.bookmarkChosen) + self.addId = self.bookmarkMenu.insertItem("Add bookmark") + self.bookmarkMenu.insertSeparator() + for l in self.bookmarkList: + self.bookmarkMenu.insertItem(l) + p.setPopup(self.bookmarkMenu) + self.addToolButton(p, True) + self.connect(self.dirView, PYSIGNAL("folderSelected(const TQString &)"), + self.setDir2) + self.connect(self, SIGNAL("dirEntered(const TQString &)"), + self.dirView.setDir) + b = TQToolButton(self) + TQToolTip.add(b, "Go Home!") + b.setPixmap(TQPixmap(home)) + self.connect(b, SIGNAL("clicked()"), self.goHome) + self.addToolButton(b) + + if preview: + self.setContentsPreviewEnabled(True) + pw = PreviewWidget(self) + self.setContentsPreview(pw, pw.preview) + self.setViewMode(TQFileDialog.List) + self.setPreviewMode(TQFileDialog.Contents) + + w = self.width() + h = self.height() + if preview: + self.resize(w + w / 2, h + h / 3) + else: + self.resize(w + w / 3, h + h / 4) + + def done(self, r): + if self.bookmarkList: + try: + open(self.bookmarkFile, "wb").write(pickle.dumps(self.bookmarkList)) + except IOError as msg: + print(msg) + return TQFileDialog.done(self, r) + + def showEvent(self, e): + TQFileDialog.showEvent(self, e) + self.dirView.setDir(self.dirPath()) + + def setDir2(self, path): + self.blockSignals(True) + self.setDir(path) + self.blockSignals(False) + + def bookmarkChosen(self, i): + if i == self.addId: + # keep bookmarks pythonic + dp = self.dirPath().latin1() + if dp not in self.bookmarkList: + self.bookmarkList.append(dp) + self.bookmarkMenu.insertItem(dp) + else: + self.setDir(self.bookmarkMenu.text(i)) + + def goHome(self): + if os.getenv("HOME"): + self.setDir(os.getenv("HOME")) + else: + self.setDir("/") + + +if __name__ == '__main__': + import sys + import getopt + + def usage(msg = None): + if msg: + print(msg, file=sys.stderr) + print("""\ +usage: qdir [--any | --dir | --custom] [--preview] [--default f] {--filter f} [caption ...] + --any Get any filename, need not exist. + --dir Return a directory rather than a file. + --custom Opens a customized TQFileDialog with + dir browser, bookmark menu, etc. + --preview Show a preview widget. + --default f Start from directory/file f. + --filter f eg. '*.gif' '*.bmp' + caption ... Caption for dialog. +""", file=sys.stderr) + sys.exit(1) + + def main(): + options = ["help", "any", "dir", "custom", "preview", "default=", "filter="] + mode = TQFileDialog.ExistingFile + preview = False + custom = False + start = None + filter = TQString.null + app = TQApplication(sys.argv) + + try: + optlist, args = getopt.getopt(sys.argv[1:], "h", options) + except getopt.error as msg: + usage(msg) + + for opt, par in optlist: + if opt in ("-h", "--help"): + usage() + elif opt == "--any": + mode = TQFileDialog.AnyFile + elif opt == "--dir": + mode = TQFileDialog.Directory + elif opt == "--default": + start = par + elif opt == "--filter": + filter = par + elif opt == "--preview": + preview = True + elif opt == "--custom": + custom = True + if args: + caption = " ".join(args) + elif mode == TQFileDialog.Directory: + caption = "Choose directory..." + else: + caption = "Choose file..." + if not start: + start = TQDir.currentDirPath() + if not custom: + fd = TQFileDialog(TQString.null, filter, None, None, True) + fd.setMode(mode) + if preview: + fd.setContentsPreviewEnabled(True) + pw = PreviewWidget(fd) + fd.setContentsPreview(pw, pw.preview) + fd.setViewMode(TQFileDialog.List) + fd.setPreviewMode(TQFileDialog.Contents) + w = fd.width() + h = fd.height() + fd.resize(w + w / 3, h + h / 4) + fd.setCaption(caption) + fd.setSelection(start) + if fd.exec_loop() == TQDialog.Accepted: + print("%s\n" % fd.selectedFile().latin1()) + return 0 + else: + return 1 + else: + fd = CustomFileDialog(preview) + fd.exec_loop() + return 1 + + sys.exit(main()) diff --git a/examples/tqmag.py b/examples/tqmag.py new file mode 100755 index 0000000..df4a85d --- /dev/null +++ b/examples/tqmag.py @@ -0,0 +1,233 @@ +#!/usr/bin/env python + +#**************************************************************************** +#** $Id: qmag.py,v 1.1 2002/06/20 18:52:31 phil Exp $ +#** +#** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved. +#** +#** This file is part of an example program for PyTQt. This example +#** program may be used, distributed and modified without limitation. +#** +#*****************************************************************************/ + +import sys +from PyTQt.tqt import * + +TRUE = 1 +FALSE = 0 + +zoomfactors = ["100%","200%","300%","400%","500%","600%","700%","800%","1600%"] + +refreshrates = [ + "No autorefresh", "50 per second", "4 per second", "3 per second", + "2 per second", "Every second", "Every two seconds", "Every three seconds", + "Every five seconds", "Every ten seconds"] + +timer = (0, 20, 250, 333, 500, 1000, 2000, 3000, 5000, 10000) + +class MagWidget(TQWidget): + def __init__(self, tqApp, parent = None, name = None): + self.qApp = tqApp + TQWidget.__init__(self, parent, name) + self.pm = TQPixmap() # pixmap magnified + self.p = TQPixmap() # pixmap + self.image = TQImage() # image of pixmap (for RGB) + self.z = 0 # zoom factor + self.r = 0 # autorefresh rate (index into refreshrates) + self.grabbing = FALSE # TRUE if currently grabbing + self.grabx = -1 + self.graby = -1 + + self.zoom = TQComboBox(FALSE, self) + self.zoom.insertStrList(zoomfactors, len(zoomfactors)) + self.connect(self.zoom, SIGNAL("activated(int)"), + self.setZoom) + + self.refresh = TQComboBox(FALSE, self) + self.refresh.insertStrList(refreshrates, len(refreshrates)) + self.connect(self.refresh, SIGNAL("activated(int)"), + self.setRefresh) + + x = 0 + w = 0 + h = 20 + for s in zoomfactors: + cw = self.zoom.fontMetrics().width(s) + w = max(cw, w) + self.zoom.setGeometry(x, 2, w + 30, h) + + x = w + 34 + w = 0 + for s in refreshrates: + cw = self.refresh.fontMetrics().width(s) + w = max(cw, w) + self.refresh.setGeometry(x, 2, w + 30, h) + + self.saveButton = TQPushButton(self) + self.connect(self.saveButton, SIGNAL("clicked()"), self.save) + self.saveButton.setText("Save") + self.saveButton.setGeometry(x + w + 30 + 2, 2, + 10 + self.saveButton.fontMetrics().width("Save"), h) + + self.quitButton = TQPushButton(self) + self.connect(self.quitButton, SIGNAL("clicked()"), self.qApp, SLOT("quit()")) + self.quitButton.setText("Quit") + self.quitButton.setGeometry(self.saveButton.geometry().right() + 2, 2, + 10 + self.quitButton.fontMetrics().width("Quit"), h) + + self.rgb = TQLabel(self) + self.rgb.setText("") + self.rgb.setAlignment(TQt.AlignVCenter) + self.rgb.resize(self.width(), self.rgb.fontMetrics().height() + 4) + + self.yoffset = self.zoom.height() + 4 + self.rgb.height() + self.setMinimumSize(self.quitButton.geometry().topRight().x() + 2, + self.yoffset + 20) + w = self.quitButton.geometry().topRight().x() + 2 + self.resize(w, w) + + self.setMouseTracking(TRUE) + self.grabx = self.qApp.desktop().width() / 2 + self.graby = self.qApp.desktop().height() / 2 + self.grabAround(TQPoint(self.grabx, self.graby)) + + #self.zoom.setCurrentItem(1) # grabAround sets zoom factor + #self.setZoom(1) + self.refresh.setCurrentItem(5) + self.setRefresh(5) + + def setZoom(self, index): + if index == 8: + self.z = 16 + else: + self.z = index + 1 + self.grab() + + def setRefresh(self, index): + self.r = index + self.killTimers() + if index and not self.grabbing: + #print "st:", timer[index] + self.startTimer(timer[index]) + + def save(self): + if not self.p.isNull(): + self.killTimers() + fn = TQFileDialog.getSaveFileName() + if not fn.isEmpty(): + self.p.save(fn, "BMP") + if self.r: + self.startTimer(timer[self.r]) + + def grab(self): + if not self.isVisible() or self.grabx < 0 or self.graby < 0: + return + + w = (self.width() + self.z - 1) / self.z + h = (self.height() + self.z - 1 - self.yoffset) / self.z + + if w < 1 or h < 1: + return + + x = self.grabx - w / 2 + y = self.graby - h / 2 + + if x + w > TQApplication.desktop().width(): + x = TQApplication.desktop().width() - w + elif x < 0: + x = 0 + + if y + h > TQApplication.desktop().height(): + y = TQApplication.desktop().height() - h + elif y < 0: + y = 0 + + self.p = TQPixmap.grabWindow(TQApplication.desktop().winId(), x, y, w, h) + self.image = self.p.convertToImage() + m = TQWMatrix() + #print "z:", self.z + m.scale(float(self.z), float(self.z)) + self.pm = self.p.xForm(m) + self.repaint(FALSE) + + def paintEvent(self, e): + if not self.pm.isNull(): + paint = TQPainter(self) + paint.drawPixmap(0, self.zoom.height() + 4, self.pm, + 0, 0, self.width(), self.height() - self.yoffset) + + def mousePressEvent(self, e): + if not self.grabbing: + self.grabbing = TRUE + self.killTimers() + self.grabMouse(TQt.crossCursor) + self.grabx = -1 + self.graby = -1 + else: + self.grabx = self.mapToGlobal(e.pos()).x() + self.graby = self.mapToGlobal(e.pos()).y() + + def mouseReleaseEvent(self, e): + if self.grabbing and self.grabx >= 0 and self.graby >= 0: + self.grabbing = FALSE + self.grabAround(e.pos()) + self.releaseMouse() + + def grabAround(self, pos): + rx = self.mapToGlobal(pos).x() + ry = self.mapToGlobal(pos).y() + w = abs(rx - self.grabx) + h = abs(ry - self.graby) + if w > 10 and h > 10: + pz = 1 + while w*pz*h*pz < self.width()*(self.height()-self.yoffset) and \ + w*pz < TQApplication.desktop().width() and \ + h*pz < TQApplication.desktop().height(): + pz += 1 + if (w*pz*h*pz - self.width()*(self.height()-self.yoffset)) > \ + (self.width()*(self.height()-self.yoffset) - w*(pz-1)*h*(pz-1)): + pz -= 1 + if pz < 1: + pz = 1 + elif pz > 8: + pz = 8 + self.zoom.setCurrentItem(pz-1) + self.z = pz + self.grabx = min(rx, self.grabx) + w / 2 + self.graby = min(ry, self.graby) + h / 2 + #self.resize(w*self.z, h*self.z*self.yoffset) + self.grab() + + def mouseMoveEvent(self, e): + if self.grabbing or self.pm.isNull() or \ + e.pos().y() > self.height() - self.zoom.fontMetrics().height() - 4 or \ + e.pos().y() < self.zoom.height() + 4: + self.rgb.setText("") + else: + x = e.pos().x() / self.z + y = (e.pos().y() - self.zoom.height() - 4) / self.z + pixelinfo = "" + if self.image.valid(x, y): + px = self.image.pixel(x, y) + pixelinfo = "%3d,%3d,%3d #%02x%02x%02x" % ( + tqRed(px), tqGreen(px), tqBlue(px), + tqRed(px), tqGreen(px), tqBlue(px)) + self.rgb.setText("x=%d, y=%d %s" % \ + (x + self.grabx, y + self.graby, pixelinfo)) + + def focusOutEvent(self, e): + self.rgb.setText("") + + def timerEvent(self, e): + self.grab() + + def resizeEvent(self, e): + self.rgb.setGeometry(0, self.height() - self.rgb.height(), + self.width(), self.rgb.height()) + +if __name__=='__main__': + app = TQApplication( sys.argv ) + m = MagWidget(app) + app.setMainWidget(m) + m.show() + app.exec_loop() diff --git a/examples/tqt.png b/examples/tqt.png new file mode 100644 index 0000000..d63e16f Binary files /dev/null and b/examples/tqt.png differ diff --git a/examples/tqtlogo.png b/examples/tqtlogo.png new file mode 100644 index 0000000..c83c7b2 Binary files /dev/null and b/examples/tqtlogo.png differ diff --git a/examples/tut1.py b/examples/tut1.py index c38a1ff..0f3d9a1 100755 --- a/examples/tut1.py +++ b/examples/tut1.py @@ -3,12 +3,12 @@ # TQt tutorial 1. import sys -from PyTQt import qt +from PyTQt import tqt -a = qt.TQApplication(sys.argv) +a = tqt.TQApplication(sys.argv) -hello = qt.TQPushButton("Hello world!", None) +hello = tqt.TQPushButton("Hello world!", None) hello.resize(100, 30) a.setMainWidget(hello) diff --git a/examples/tut10.py b/examples/tut10.py index 6b21e47..507c979 100755 --- a/examples/tut10.py +++ b/examples/tut10.py @@ -3,19 +3,19 @@ # TQt tutorial 10. import sys -from PyTQt import qt +from PyTQt import tqt -class LCDRange(qt.TQVBox): +class LCDRange(tqt.TQVBox): def __init__(self, parent=None, name=None): - qt.TQVBox.__init__(self, parent, name) + tqt.TQVBox.__init__(self, parent, name) - lcd = qt.TQLCDNumber(2, self, "lcd") - self.slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") + lcd = tqt.TQLCDNumber(2, self, "lcd") + self.slider = tqt.TQSlider(tqt.TQt.Horizontal, self, "slider") self.slider.setRange(0, 99) self.slider.setValue(0) - self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) - self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) + self.connect(self.slider, tqt.SIGNAL("valueChanged(int)"), lcd, tqt.SLOT("display(int)")) + self.connect(self.slider, tqt.SIGNAL("valueChanged(int)"), self, tqt.PYSIGNAL("valueChanged(int)")) self.setFocusProxy(self.slider) @@ -31,13 +31,13 @@ class LCDRange(qt.TQVBox): self.slider.setRange(minVal, maxVal) -class CannonField(qt.TQWidget): +class CannonField(tqt.TQWidget): def __init__(self, parent=None, name=None): - qt.TQWidget.__init__(self, parent, name) + tqt.TQWidget.__init__(self, parent, name) self.ang = 45 self.f = 0 - self.setPalette(qt.TQPalette(qt.TQColor(250, 250, 200))) + self.setPalette(tqt.TQPalette(tqt.TQColor(250, 250, 200))) def angle(self): return self.ang @@ -51,7 +51,7 @@ class CannonField(qt.TQWidget): return self.ang = degrees self.repaint(self.cannonRect(), 0) - self.emit(qt.PYSIGNAL("angleChanged(int)"), (self.ang, )) + self.emit(tqt.PYSIGNAL("angleChanged(int)"), (self.ang, )) def force(self): return self.f @@ -62,46 +62,46 @@ class CannonField(qt.TQWidget): if self.f == newton: return self.f = newton - self.emit(qt.PYSIGNAL("forceChanged(int)"), (self.f, )) + self.emit(tqt.PYSIGNAL("forceChanged(int)"), (self.f, )) def paintEvent(self, ev): if not ev.rect().intersects(self.cannonRect()): return cr = self.cannonRect() - pix = qt.TQPixmap(cr.size()) + pix = tqt.TQPixmap(cr.size()) pix.fill(self, cr.topLeft()) - p = qt.TQPainter(pix) + p = tqt.TQPainter(pix) - p.setBrush(qt.TQt.blue) - p.setPen(qt.TQt.NoPen) + p.setBrush(tqt.TQt.blue) + p.setPen(tqt.TQt.NoPen) p.translate(0, pix.height() - 1) - p.drawPie(qt.TQRect(-35, -35, 70, 70), 0, 90 * 16) + p.drawPie(tqt.TQRect(-35, -35, 70, 70), 0, 90 * 16) p.rotate(-self.ang) - p.drawRect(qt.TQRect(33, -4, 15, 8)) + p.drawRect(tqt.TQRect(33, -4, 15, 8)) p.end() p.begin(self) p.drawPixmap(cr.topLeft(), pix) def cannonRect(self): - r = qt.TQRect(0, 0, 50, 50) + r = tqt.TQRect(0, 0, 50, 50) r.moveBottomLeft(self.rect().bottomLeft()) return r def sizePolicy(self): - return qt.TQSizePolicy(qt.TQSizePolicy.Expanding, qt.TQSizePolicy.Expanding) + return tqt.TQSizePolicy(tqt.TQSizePolicy.Expanding, tqt.TQSizePolicy.Expanding) -class MyWidget(qt.TQWidget): +class MyWidget(tqt.TQWidget): def __init__(self, parent=None, name=None): - qt.TQWidget.__init__(self, parent, name) + tqt.TQWidget.__init__(self, parent, name) - quit = qt.TQPushButton("&Quit", self, "quit") - quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) - self.connect(quit, qt.SIGNAL("clicked()"), qt.tqApp, qt.SLOT("quit()")) + quit = tqt.TQPushButton("&Quit", self, "quit") + quit.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) + self.connect(quit, tqt.SIGNAL("clicked()"), tqt.tqApp, tqt.SLOT("quit()")) self.angle = LCDRange(self, "angle") self.angle.setRange(5, 70) @@ -111,19 +111,19 @@ class MyWidget(qt.TQWidget): self.cannonField = CannonField(self, "cannonField") - self.connect(self.angle, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) - self.connect(self.cannonField, qt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) + self.connect(self.angle, tqt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) + self.connect(self.cannonField, tqt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) - self.connect(self.force, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce) - self.connect(self.cannonField, qt.PYSIGNAL("forceChanged(int)"), self.force.setValue) + self.connect(self.force, tqt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce) + self.connect(self.cannonField, tqt.PYSIGNAL("forceChanged(int)"), self.force.setValue) - grid = qt.TQGridLayout(self, 2, 2, 10) + grid = tqt.TQGridLayout(self, 2, 2, 10) grid.addWidget(quit, 0, 0) grid.addWidget(self.cannonField, 1, 1) grid.setColStretch(1, 10) - leftBox = qt.TQVBoxLayout() + leftBox = tqt.TQVBoxLayout() grid.addLayout(leftBox, 1, 0) @@ -135,8 +135,8 @@ class MyWidget(qt.TQWidget): self.angle.setFocus() -qt.TQApplication.setColorSpec(qt.TQApplication.CustomColor) -a = qt.TQApplication(sys.argv) +qt.TQApplication.setColorSpec(tqt.TQApplication.CustomColor) +a = tqt.TQApplication(sys.argv) w = MyWidget() w.setGeometry(100, 100, 500, 355) diff --git a/examples/tut11.py b/examples/tut11.py index f5a9930..a71ff03 100755 --- a/examples/tut11.py +++ b/examples/tut11.py @@ -4,19 +4,19 @@ import sys import math -from PyTQt import qt +from PyTQt import tqt -class LCDRange(qt.TQVBox): +class LCDRange(tqt.TQVBox): def __init__(self, parent=None, name=None): - qt.TQVBox.__init__(self, parent, name) + tqt.TQVBox.__init__(self, parent, name) - lcd = qt.TQLCDNumber(2, self, "lcd") - self.slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") + lcd = tqt.TQLCDNumber(2, self, "lcd") + self.slider = tqt.TQSlider(tqt.TQt.Horizontal, self, "slider") self.slider.setRange(0, 99) self.slider.setValue(0) - self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) - self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) + self.connect(self.slider, tqt.SIGNAL("valueChanged(int)"), lcd, tqt.SLOT("display(int)")) + self.connect(self.slider, tqt.SIGNAL("valueChanged(int)"), self, tqt.PYSIGNAL("valueChanged(int)")) self.setFocusProxy(self.slider) @@ -32,23 +32,23 @@ class LCDRange(qt.TQVBox): self.slider.setRange(minVal, maxVal) -class CannonField(qt.TQWidget): +class CannonField(tqt.TQWidget): def __init__(self, parent=None, name=None): - qt.TQWidget.__init__(self, parent, name) + tqt.TQWidget.__init__(self, parent, name) self.ang = 45 self.f = 0 self.timerCount = 0 - self.autoShootTimer = qt.TQTimer(self, "movement handler") - self.connect(self.autoShootTimer, qt.SIGNAL("timeout()"), self.moveShot) + self.autoShootTimer = tqt.TQTimer(self, "movement handler") + self.connect(self.autoShootTimer, tqt.SIGNAL("timeout()"), self.moveShot) self.shoot_ang = 0 self.shoot_f = 0 - self.setPalette(qt.TQPalette(qt.TQColor(250, 250, 200))) + self.setPalette(tqt.TQPalette(tqt.TQColor(250, 250, 200))) - self.barrelRect = qt.TQRect(33, -4, 15, 8) + self.barrelRect = tqt.TQRect(33, -4, 15, 8) def angle(self): return self.ang @@ -62,7 +62,7 @@ class CannonField(qt.TQWidget): return self.ang = degrees self.repaint(self.cannonRect(), 0) - self.emit(qt.PYSIGNAL("angleChanged(int)"), (self.ang, )) + self.emit(tqt.PYSIGNAL("angleChanged(int)"), (self.ang, )) def force(self): return self.f @@ -73,7 +73,7 @@ class CannonField(qt.TQWidget): if self.f == newton: return self.f = newton - self.emit(qt.PYSIGNAL("forceChanged(int)"), (self.f, )) + self.emit(tqt.PYSIGNAL("forceChanged(int)"), (self.f, )) def shoot(self): if self.autoShootTimer.isActive(): @@ -85,7 +85,7 @@ class CannonField(qt.TQWidget): self.autoShootTimer.start(50) def moveShot(self): - r = qt.TQRegion(self.shotRect()) + r = tqt.TQRegion(self.shotRect()) self.timerCount = self.timerCount + 1 shotR = self.shotRect() @@ -93,13 +93,13 @@ class CannonField(qt.TQWidget): if shotR.x() > self.width() or shotR.y() > self.height(): self.autoShootTimer.stop() else: - r = r.unite(qt.TQRegion(shotR)) + r = r.unite(tqt.TQRegion(shotR)) self.repaint(r) def paintEvent(self, ev): updateR = ev.rect() - p = qt.TQPainter(self) + p = tqt.TQPainter(self) if updateR.intersects(self.cannonRect()): self.paintCannon(p) @@ -108,21 +108,21 @@ class CannonField(qt.TQWidget): self.paintShot(p) def paintShot(self, p): - p.setBrush(qt.TQt.black) - p.setPen(qt.TQt.NoPen) + p.setBrush(tqt.TQt.black) + p.setPen(tqt.TQt.NoPen) p.drawRect(self.shotRect()) def paintCannon(self, p): cr = self.cannonRect() - pix = qt.TQPixmap(cr.size()) + pix = tqt.TQPixmap(cr.size()) pix.fill(self, cr.topLeft()) - tmp = qt.TQPainter(pix) - tmp.setBrush(qt.TQt.blue) - tmp.setPen(qt.TQt.NoPen) + tmp = tqt.TQPainter(pix) + tmp.setBrush(tqt.TQt.blue) + tmp.setPen(tqt.TQt.NoPen) tmp.translate(0, pix.height() - 1) - tmp.drawPie(qt.TQRect(-35, -35, 70, 70), 0, 90 * 16) + tmp.drawPie(tqt.TQRect(-35, -35, 70, 70), 0, 90 * 16) tmp.rotate(-self.ang) tmp.drawRect(self.barrelRect) tmp.end() @@ -130,7 +130,7 @@ class CannonField(qt.TQWidget): p.drawPixmap(cr.topLeft(), pix) def cannonRect(self): - r = qt.TQRect(0, 0, 50, 50) + r = tqt.TQRect(0, 0, 50, 50) r.moveBottomLeft(self.rect().bottomLeft()) return r @@ -148,21 +148,21 @@ class CannonField(qt.TQWidget): x = x0 + velx * time y = y0 + vely * time - 0.5 * gravity * time * time - r = qt.TQRect(0, 0, 6, 6) - r.moveCenter(qt.TQPoint(int(x), int(self.height() - 1 - y))) + r = tqt.TQRect(0, 0, 6, 6) + r.moveCenter(tqt.TQPoint(int(x), int(self.height() - 1 - y))) return r def sizePolicy(self): - return qt.TQSizePolicy(qt.TQSizePolicy.Expanding, qt.TQSizePolicy.Expanding) + return tqt.TQSizePolicy(tqt.TQSizePolicy.Expanding, tqt.TQSizePolicy.Expanding) -class MyWidget(qt.TQWidget): +class MyWidget(tqt.TQWidget): def __init__(self, parent=None, name=None): - qt.TQWidget.__init__(self, parent, name) + tqt.TQWidget.__init__(self, parent, name) - quit = qt.TQPushButton("&Quit", self, "quit") - quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) - self.connect(quit, qt.SIGNAL("clicked()"), qt.tqApp, qt.SLOT("quit()")) + quit = tqt.TQPushButton("&Quit", self, "quit") + quit.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) + self.connect(quit, tqt.SIGNAL("clicked()"), tqt.tqApp, tqt.SLOT("quit()")) self.angle = LCDRange(self, "angle") self.angle.setRange(5, 70) @@ -172,28 +172,28 @@ class MyWidget(qt.TQWidget): self.cannonField = CannonField(self, "cannonField") - self.connect(self.angle, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) - self.connect(self.cannonField, qt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) + self.connect(self.angle, tqt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) + self.connect(self.cannonField, tqt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) - self.connect(self.force, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce) - self.connect(self.cannonField, qt.PYSIGNAL("forceChanged(int)"), self.force.setValue) + self.connect(self.force, tqt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce) + self.connect(self.cannonField, tqt.PYSIGNAL("forceChanged(int)"), self.force.setValue) - shoot = qt.TQPushButton("&Shoot", self, "shoot") - shoot.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) - self.connect(shoot, qt.SIGNAL("clicked()"), self.cannonField.shoot) + shoot = tqt.TQPushButton("&Shoot", self, "shoot") + shoot.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) + self.connect(shoot, tqt.SIGNAL("clicked()"), self.cannonField.shoot) - grid = qt.TQGridLayout(self, 2, 2, 10) + grid = tqt.TQGridLayout(self, 2, 2, 10) grid.addWidget(quit, 0, 0) grid.addWidget(self.cannonField, 1, 1) grid.setColStretch(1, 10) - leftBox = qt.TQVBoxLayout() + leftBox = tqt.TQVBoxLayout() grid.addLayout(leftBox, 1, 0) leftBox.addWidget(self.angle) leftBox.addWidget(self.force) - topBox = qt.TQHBoxLayout() + topBox = tqt.TQHBoxLayout() grid.addLayout(topBox, 0, 1) topBox.addWidget(shoot) topBox.addStretch(1) @@ -203,8 +203,8 @@ class MyWidget(qt.TQWidget): self.angle.setFocus() -qt.TQApplication.setColorSpec(qt.TQApplication.CustomColor) -a = qt.TQApplication(sys.argv) +qt.TQApplication.setColorSpec(tqt.TQApplication.CustomColor) +a = tqt.TQApplication(sys.argv) w = MyWidget() w.setGeometry(100, 100, 500, 355) diff --git a/examples/tut12.py b/examples/tut12.py index d0370f8..f901b70 100755 --- a/examples/tut12.py +++ b/examples/tut12.py @@ -5,23 +5,23 @@ import sys import math import random -from PyTQt import qt +from PyTQt import tqt -class LCDRange(qt.TQVBox): +class LCDRange(tqt.TQVBox): def __init__(self, s=None, parent=None, name=None): - qt.TQVBox.__init__(self, parent, name) + tqt.TQVBox.__init__(self, parent, name) - lcd = qt.TQLCDNumber(2, self, "lcd") - self.slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") + lcd = tqt.TQLCDNumber(2, self, "lcd") + self.slider = tqt.TQSlider(tqt.TQt.Horizontal, self, "slider") self.slider.setRange(0, 99) self.slider.setValue(0) - self.label = qt.TQLabel(" ", self, "label") - self.label.setAlignment(qt.TQt.AlignCenter) + self.label = tqt.TQLabel(" ", self, "label") + self.label.setAlignment(tqt.TQt.AlignCenter) - self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) - self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) + self.connect(self.slider, tqt.SIGNAL("valueChanged(int)"), lcd, tqt.SLOT("display(int)")) + self.connect(self.slider, tqt.SIGNAL("valueChanged(int)"), self, tqt.PYSIGNAL("valueChanged(int)")) self.setFocusProxy(self.slider) @@ -47,24 +47,24 @@ class LCDRange(qt.TQVBox): self.label.setText(s) -class CannonField(qt.TQWidget): +class CannonField(tqt.TQWidget): def __init__(self, parent=None, name=None): - qt.TQWidget.__init__(self, parent, name) + tqt.TQWidget.__init__(self, parent, name) self.ang = 45 self.f = 0 self.timerCount = 0 - self.autoShootTimer = qt.TQTimer(self, "movement handler") - self.connect(self.autoShootTimer, qt.SIGNAL("timeout()"), self.moveShot) + self.autoShootTimer = tqt.TQTimer(self, "movement handler") + self.connect(self.autoShootTimer, tqt.SIGNAL("timeout()"), self.moveShot) self.shoot_ang = 0 self.shoot_f = 0 - self.target = qt.TQPoint(0, 0) + self.target = tqt.TQPoint(0, 0) - self.setPalette(qt.TQPalette(qt.TQColor(250, 250, 200))) + self.setPalette(tqt.TQPalette(tqt.TQColor(250, 250, 200))) - self.barrelRect = qt.TQRect(33, -4, 15, 8) + self.barrelRect = tqt.TQRect(33, -4, 15, 8) self.newTarget() @@ -80,7 +80,7 @@ class CannonField(qt.TQWidget): return self.ang = degrees self.repaint(self.cannonRect(), 0) - self.emit(qt.PYSIGNAL("angleChanged(int)"), (self.ang, )) + self.emit(tqt.PYSIGNAL("angleChanged(int)"), (self.ang, )) def force(self): return self.f @@ -91,7 +91,7 @@ class CannonField(qt.TQWidget): if self.f == newton: return self.f = newton - self.emit(qt.PYSIGNAL("forceChanged(int)"), (self.f, )) + self.emit(tqt.PYSIGNAL("forceChanged(int)"), (self.f, )) def shoot(self): if self.autoShootTimer.isActive(): @@ -103,30 +103,30 @@ class CannonField(qt.TQWidget): self.autoShootTimer.start(50) def newTarget(self): - r = qt.TQRegion(self.targetRect()) - self.target = qt.TQPoint(random.randint(200, 390), random.randint(10, 265)) - self.repaint(r.unite(qt.TQRegion(self.targetRect()))) + r = tqt.TQRegion(self.targetRect()) + self.target = tqt.TQPoint(random.randint(200, 390), random.randint(10, 265)) + self.repaint(r.unite(tqt.TQRegion(self.targetRect()))) def moveShot(self): - r = qt.TQRegion(self.shotRect()) + r = tqt.TQRegion(self.shotRect()) self.timerCount = self.timerCount + 1 shotR = self.shotRect() if shotR.intersects(self.targetRect()): self.autoShootTimer.stop() - self.emit(qt.PYSIGNAL("hit()"), ()) + self.emit(tqt.PYSIGNAL("hit()"), ()) elif shotR.x() > self.width() or shotR.y() > self.height(): self.autoShootTimer.stop() - self.emit(qt.PYSIGNAL("missed()"), ()) + self.emit(tqt.PYSIGNAL("missed()"), ()) else: - r = r.unite(qt.TQRegion(shotR)) + r = r.unite(tqt.TQRegion(shotR)) self.repaint(r) def paintEvent(self, ev): updateR = ev.rect() - p = qt.TQPainter(self) + p = tqt.TQPainter(self) if updateR.intersects(self.cannonRect()): self.paintCannon(p) @@ -138,26 +138,26 @@ class CannonField(qt.TQWidget): self.paintTarget(p) def paintShot(self, p): - p.setBrush(qt.TQt.black) - p.setPen(qt.TQt.NoPen) + p.setBrush(tqt.TQt.black) + p.setPen(tqt.TQt.NoPen) p.drawRect(self.shotRect()) def paintTarget(self, p): - p.setBrush(qt.TQt.red) - p.setPen(qt.TQt.black) + p.setBrush(tqt.TQt.red) + p.setPen(tqt.TQt.black) p.drawRect(self.targetRect()) def paintCannon(self, p): cr = self.cannonRect() - pix = qt.TQPixmap(cr.size()) + pix = tqt.TQPixmap(cr.size()) pix.fill(self, cr.topLeft()) - tmp = qt.TQPainter(pix) - tmp.setBrush(qt.TQt.blue) - tmp.setPen(qt.TQt.NoPen) + tmp = tqt.TQPainter(pix) + tmp.setBrush(tqt.TQt.blue) + tmp.setPen(tqt.TQt.NoPen) tmp.translate(0, pix.height() - 1) - tmp.drawPie(qt.TQRect(-35, -35, 70, 70), 0, 90 * 16) + tmp.drawPie(tqt.TQRect(-35, -35, 70, 70), 0, 90 * 16) tmp.rotate(-self.ang) tmp.drawRect(self.barrelRect) tmp.end() @@ -165,7 +165,7 @@ class CannonField(qt.TQWidget): p.drawPixmap(cr.topLeft(), pix) def cannonRect(self): - r = qt.TQRect(0, 0, 50, 50) + r = tqt.TQRect(0, 0, 50, 50) r.moveBottomLeft(self.rect().bottomLeft()) return r @@ -183,26 +183,26 @@ class CannonField(qt.TQWidget): x = x0 + velx * time y = y0 + vely * time - 0.5 * gravity * time * time - r = qt.TQRect(0, 0, 6, 6) - r.moveCenter(qt.TQPoint(int(x), int(self.height() - 1 - y))) + r = tqt.TQRect(0, 0, 6, 6) + r.moveCenter(tqt.TQPoint(int(x), int(self.height() - 1 - y))) return r def targetRect(self): - r = qt.TQRect(0, 0, 20, 10) - r.moveCenter(qt.TQPoint(self.target.x(), self.height() - 1 - self.target.y())) + r = tqt.TQRect(0, 0, 20, 10) + r.moveCenter(tqt.TQPoint(self.target.x(), self.height() - 1 - self.target.y())) return r def sizePolicy(self): - return qt.TQSizePolicy(qt.TQSizePolicy.Expanding, qt.TQSizePolicy.Expanding) + return tqt.TQSizePolicy(tqt.TQSizePolicy.Expanding, tqt.TQSizePolicy.Expanding) -class MyWidget(qt.TQWidget): +class MyWidget(tqt.TQWidget): def __init__(self, parent=None, name=None): - qt.TQWidget.__init__(self, parent, name) + tqt.TQWidget.__init__(self, parent, name) - quit = qt.TQPushButton("&Quit", self, "quit") - quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) - self.connect(quit, qt.SIGNAL("clicked()"), qt.tqApp, qt.SLOT("quit()")) + quit = tqt.TQPushButton("&Quit", self, "quit") + quit.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) + self.connect(quit, tqt.SIGNAL("clicked()"), tqt.tqApp, tqt.SLOT("quit()")) self.angle = LCDRange("ANGLE", self, "angle") self.angle.setRange(5, 70) @@ -212,28 +212,28 @@ class MyWidget(qt.TQWidget): self.cannonField = CannonField(self, "cannonField") - self.connect(self.angle, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) - self.connect(self.cannonField, qt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) + self.connect(self.angle, tqt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) + self.connect(self.cannonField, tqt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) - self.connect(self.force, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce) - self.connect(self.cannonField, qt.PYSIGNAL("forceChanged(int)"), self.force.setValue) + self.connect(self.force, tqt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce) + self.connect(self.cannonField, tqt.PYSIGNAL("forceChanged(int)"), self.force.setValue) - shoot = qt.TQPushButton("&Shoot", self, "shoot") - shoot.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) - self.connect(shoot, qt.SIGNAL("clicked()"), self.cannonField.shoot) + shoot = tqt.TQPushButton("&Shoot", self, "shoot") + shoot.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) + self.connect(shoot, tqt.SIGNAL("clicked()"), self.cannonField.shoot) - grid = qt.TQGridLayout(self, 2, 2, 10) + grid = tqt.TQGridLayout(self, 2, 2, 10) grid.addWidget(quit, 0, 0) grid.addWidget(self.cannonField, 1, 1) grid.setColStretch(1, 10) - leftBox = qt.TQVBoxLayout() + leftBox = tqt.TQVBoxLayout() grid.addLayout(leftBox, 1, 0) leftBox.addWidget(self.angle) leftBox.addWidget(self.force) - topBox = qt.TQHBoxLayout() + topBox = tqt.TQHBoxLayout() grid.addLayout(topBox, 0, 1) topBox.addWidget(shoot) topBox.addStretch(1) @@ -243,8 +243,8 @@ class MyWidget(qt.TQWidget): self.angle.setFocus() -qt.TQApplication.setColorSpec(qt.TQApplication.CustomColor) -a = qt.TQApplication(sys.argv) +qt.TQApplication.setColorSpec(tqt.TQApplication.CustomColor) +a = tqt.TQApplication(sys.argv) w = MyWidget() w.setGeometry(100, 100, 500, 355) diff --git a/examples/tut13.py b/examples/tut13.py index b8b2d82..8bade61 100755 --- a/examples/tut13.py +++ b/examples/tut13.py @@ -5,27 +5,27 @@ import sys import math import random -from PyTQt import qt +from PyTQt import tqt -class LCDRange(qt.TQWidget): +class LCDRange(tqt.TQWidget): def __init__(self, s=None, parent=None, name=None): - qt.TQWidget.__init__(self, parent, name) + tqt.TQWidget.__init__(self, parent, name) - lcd = qt.TQLCDNumber(2, self, "lcd") - self.slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") + lcd = tqt.TQLCDNumber(2, self, "lcd") + self.slider = tqt.TQSlider(tqt.TQt.Horizontal, self, "slider") self.slider.setRange(0, 99) self.slider.setValue(0) - self.label = qt.TQLabel(" ", self, "label") - self.label.setAlignment(qt.TQt.AlignCenter) + self.label = tqt.TQLabel(" ", self, "label") + self.label.setAlignment(tqt.TQt.AlignCenter) - self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) - self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) + self.connect(self.slider, tqt.SIGNAL("valueChanged(int)"), lcd, tqt.SLOT("display(int)")) + self.connect(self.slider, tqt.SIGNAL("valueChanged(int)"), self, tqt.PYSIGNAL("valueChanged(int)")) self.setFocusProxy(self.slider) - l = qt.TQVBoxLayout(self) + l = tqt.TQVBoxLayout(self) l.addWidget(lcd, 1) l.addWidget(self.slider) l.addWidget(self.label) @@ -52,25 +52,25 @@ class LCDRange(qt.TQWidget): self.label.setText(s) -class CannonField(qt.TQWidget): +class CannonField(tqt.TQWidget): def __init__(self, parent=None, name=None): - qt.TQWidget.__init__(self, parent, name) + tqt.TQWidget.__init__(self, parent, name) self.ang = 45 self.f = 0 self.timerCount = 0 - self.autoShootTimer = qt.TQTimer(self, "movement handler") - self.connect(self.autoShootTimer, qt.SIGNAL("timeout()"), self.moveShot) + self.autoShootTimer = tqt.TQTimer(self, "movement handler") + self.connect(self.autoShootTimer, tqt.SIGNAL("timeout()"), self.moveShot) self.shoot_ang = 0 self.shoot_f = 0 - self.target = qt.TQPoint(0, 0) + self.target = tqt.TQPoint(0, 0) self.gameEnded = 0 - self.setPalette(qt.TQPalette(qt.TQColor(250, 250, 200))) + self.setPalette(tqt.TQPalette(tqt.TQColor(250, 250, 200))) - self.barrelRect = qt.TQRect(33, -4, 15, 8) + self.barrelRect = tqt.TQRect(33, -4, 15, 8) self.newTarget() @@ -86,7 +86,7 @@ class CannonField(qt.TQWidget): return self.ang = degrees self.repaint(self.cannonRect(), 0) - self.emit(qt.PYSIGNAL("angleChanged(int)"), (self.ang, )) + self.emit(tqt.PYSIGNAL("angleChanged(int)"), (self.ang, )) def force(self): return self.f @@ -97,7 +97,7 @@ class CannonField(qt.TQWidget): if self.f == newton: return self.f = newton - self.emit(qt.PYSIGNAL("forceChanged(int)"), (self.f, )) + self.emit(tqt.PYSIGNAL("forceChanged(int)"), (self.f, )) def shoot(self): if self.isShooting(): @@ -107,12 +107,12 @@ class CannonField(qt.TQWidget): self.shoot_ang = self.ang self.shoot_f = self.f self.autoShootTimer.start(50) - self.emit(qt.PYSIGNAL("canShoot(bool)"), (0, )) + self.emit(tqt.PYSIGNAL("canShoot(bool)"), (0, )) def newTarget(self): - r = qt.TQRegion(self.targetRect()) - self.target = qt.TQPoint(random.randint(200, 390), random.randint(10, 265)) - self.repaint(r.unite(qt.TQRegion(self.targetRect()))) + r = tqt.TQRegion(self.targetRect()) + self.target = tqt.TQPoint(random.randint(200, 390), random.randint(10, 265)) + self.repaint(r.unite(tqt.TQRegion(self.targetRect()))) def gameOver(self): return self.gameEnded @@ -130,35 +130,35 @@ class CannonField(qt.TQWidget): self.autoShootTime.stop() self.gameEnded = 0 self.repaint() - self.emit(qt.PYSIGNAL("canShoot(bool)"), (1, )) + self.emit(tqt.PYSIGNAL("canShoot(bool)"), (1, )) def moveShot(self): - r = qt.TQRegion(self.shotRect()) + r = tqt.TQRegion(self.shotRect()) self.timerCount = self.timerCount + 1 shotR = self.shotRect() if shotR.intersects(self.targetRect()): self.autoShootTimer.stop() - self.emit(qt.PYSIGNAL("hit()"), ()) - self.emit(qt.PYSIGNAL("canShoot(bool)"), (1, )) + self.emit(tqt.PYSIGNAL("hit()"), ()) + self.emit(tqt.PYSIGNAL("canShoot(bool)"), (1, )) elif shotR.x() > self.width() or shotR.y() > self.height(): self.autoShootTimer.stop() - self.emit(qt.PYSIGNAL("missed()"), ()) - self.emit(qt.PYSIGNAL("canShoot(bool)"), (1, )) + self.emit(tqt.PYSIGNAL("missed()"), ()) + self.emit(tqt.PYSIGNAL("canShoot(bool)"), (1, )) else: - r = r.unite(qt.TQRegion(shotR)) + r = r.unite(tqt.TQRegion(shotR)) self.repaint(r) def paintEvent(self, ev): updateR = ev.rect() - p = qt.TQPainter(self) + p = tqt.TQPainter(self) if self.gameEnded: - p.setPen(qt.TQt.black) - p.setFont(qt.TQFont("Courier", 48, qt.TQFont.Bold)) - p.drawText(self.rect(), qt.TQt.AlignCenter, "Game Over") + p.setPen(tqt.TQt.black) + p.setFont(tqt.TQFont("Courier", 48, tqt.TQFont.Bold)) + p.drawText(self.rect(), tqt.TQt.AlignCenter, "Game Over") if updateR.intersects(self.cannonRect()): self.paintCannon(p) @@ -170,26 +170,26 @@ class CannonField(qt.TQWidget): self.paintTarget(p) def paintShot(self, p): - p.setBrush(qt.TQt.black) - p.setPen(qt.TQt.NoPen) + p.setBrush(tqt.TQt.black) + p.setPen(tqt.TQt.NoPen) p.drawRect(self.shotRect()) def paintTarget(self, p): - p.setBrush(qt.TQt.red) - p.setPen(qt.TQt.black) + p.setBrush(tqt.TQt.red) + p.setPen(tqt.TQt.black) p.drawRect(self.targetRect()) def paintCannon(self, p): cr = self.cannonRect() - pix = qt.TQPixmap(cr.size()) + pix = tqt.TQPixmap(cr.size()) pix.fill(self, cr.topLeft()) - tmp = qt.TQPainter(pix) - tmp.setBrush(qt.TQt.blue) - tmp.setPen(qt.TQt.NoPen) + tmp = tqt.TQPainter(pix) + tmp.setBrush(tqt.TQt.blue) + tmp.setPen(tqt.TQt.NoPen) tmp.translate(0, pix.height() - 1) - tmp.drawPie(qt.TQRect(-35, -35, 70, 70), 0, 90 * 16) + tmp.drawPie(tqt.TQRect(-35, -35, 70, 70), 0, 90 * 16) tmp.rotate(-self.ang) tmp.drawRect(self.barrelRect) tmp.end() @@ -197,7 +197,7 @@ class CannonField(qt.TQWidget): p.drawPixmap(cr.topLeft(), pix) def cannonRect(self): - r = qt.TQRect(0, 0, 50, 50) + r = tqt.TQRect(0, 0, 50, 50) r.moveBottomLeft(self.rect().bottomLeft()) return r @@ -215,29 +215,29 @@ class CannonField(qt.TQWidget): x = x0 + velx * time y = y0 + vely * time - 0.5 * gravity * time * time - r = qt.TQRect(0, 0, 6, 6) - r.moveCenter(qt.TQPoint(int(x), int(self.height() - 1 - y))) + r = tqt.TQRect(0, 0, 6, 6) + r.moveCenter(tqt.TQPoint(int(x), int(self.height() - 1 - y))) return r def targetRect(self): - r = qt.TQRect(0, 0, 20, 10) - r.moveCenter(qt.TQPoint(self.target.x(), self.height() - 1 - self.target.y())) + r = tqt.TQRect(0, 0, 20, 10) + r.moveCenter(tqt.TQPoint(self.target.x(), self.height() - 1 - self.target.y())) return r def isShooting(self): return self.autoShootTimer.isActive() def sizePolicy(self): - return qt.TQSizePolicy(qt.TQSizePolicy.Expanding, qt.TQSizePolicy.Expanding) + return tqt.TQSizePolicy(tqt.TQSizePolicy.Expanding, tqt.TQSizePolicy.Expanding) -class GameBoard(qt.TQWidget): +class GameBoard(tqt.TQWidget): def __init__(self, parent=None, name=None): - qt.TQWidget.__init__(self, parent, name) + tqt.TQWidget.__init__(self, parent, name) - quit = qt.TQPushButton("&Quit", self, "quit") - quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) - self.connect(quit, qt.SIGNAL("clicked()"), qt.tqApp, qt.SLOT("quit()")) + quit = tqt.TQPushButton("&Quit", self, "quit") + quit.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) + self.connect(quit, tqt.SIGNAL("clicked()"), tqt.tqApp, tqt.SLOT("quit()")) self.angle = LCDRange("ANGLE", self, "angle") self.angle.setRange(5, 70) @@ -247,40 +247,40 @@ class GameBoard(qt.TQWidget): self.cannonField = CannonField(self, "cannonField") - self.connect(self.angle, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) - self.connect(self.cannonField, qt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) + self.connect(self.angle, tqt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) + self.connect(self.cannonField, tqt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) - self.connect(self.force, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce) - self.connect(self.cannonField, qt.PYSIGNAL("forceChanged(int)"), self.force.setValue) + self.connect(self.force, tqt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce) + self.connect(self.cannonField, tqt.PYSIGNAL("forceChanged(int)"), self.force.setValue) - self.connect(self.cannonField, qt.PYSIGNAL("hit()"), self.hit) - self.connect(self.cannonField, qt.PYSIGNAL("missed()"), self.missed) + self.connect(self.cannonField, tqt.PYSIGNAL("hit()"), self.hit) + self.connect(self.cannonField, tqt.PYSIGNAL("missed()"), self.missed) - self.shoot = qt.TQPushButton("&Shoot", self, "shoot") - self.shoot.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) - self.connect(self.shoot, qt.SIGNAL("clicked()"), self.fire) - self.connect(self.cannonField, qt.PYSIGNAL("canShoot(bool)"), self.shoot, qt.SLOT("setEnabled(bool)")) + self.shoot = tqt.TQPushButton("&Shoot", self, "shoot") + self.shoot.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) + self.connect(self.shoot, tqt.SIGNAL("clicked()"), self.fire) + self.connect(self.cannonField, tqt.PYSIGNAL("canShoot(bool)"), self.shoot, tqt.SLOT("setEnabled(bool)")) - restart = qt.TQPushButton("&New Game", self, "newgame") - restart.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) - self.connect(restart, qt.SIGNAL("clicked()"), self.newGame) + restart = tqt.TQPushButton("&New Game", self, "newgame") + restart.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) + self.connect(restart, tqt.SIGNAL("clicked()"), self.newGame) - self.hits = qt.TQLCDNumber(2, self, "hits") - self.shotsLeft = qt.TQLCDNumber(2, self, "shotsleft") - hitsL = qt.TQLabel("HITS", self, "hitsLabel") - shotsLeftL = qt.TQLabel("SHOTS LEFT", self, "shotsleftLabel") + self.hits = tqt.TQLCDNumber(2, self, "hits") + self.shotsLeft = tqt.TQLCDNumber(2, self, "shotsleft") + hitsL = tqt.TQLabel("HITS", self, "hitsLabel") + shotsLeftL = tqt.TQLabel("SHOTS LEFT", self, "shotsleftLabel") - grid = qt.TQGridLayout(self, 2, 2, 10) + grid = tqt.TQGridLayout(self, 2, 2, 10) grid.addWidget(quit, 0, 0) grid.addWidget(self.cannonField, 1, 1) grid.setColStretch(1, 10) - leftBox = qt.TQVBoxLayout() + leftBox tqt.TQVBoxLayout() grid.addLayout(leftBox, 1, 0) leftBox.addWidget(self.angle) leftBox.addWidget(self.force) - topBox = qt.TQHBoxLayout() + topBox = tqt.TQHBoxLayout() grid.addLayout(topBox, 0, 1) topBox.addWidget(self.shoot) topBox.addWidget(self.hits) @@ -320,8 +320,8 @@ class GameBoard(qt.TQWidget): self.cannonField.newTarget() -qt.TQApplication.setColorSpec(qt.TQApplication.CustomColor) -a = qt.TQApplication(sys.argv) +qt.TQApplication.setColorSpec(tqt.TQApplication.CustomColor) +a = tqt.TQApplication(sys.argv) gb = GameBoard() gb.setGeometry(100, 100, 500, 355) diff --git a/examples/tut14.py b/examples/tut14.py index 41d2631..0111cab 100755 --- a/examples/tut14.py +++ b/examples/tut14.py @@ -5,27 +5,27 @@ import sys import math import random -from PyTQt import qt +from PyTQt import tqt -class LCDRange(qt.TQWidget): +class LCDRange(tqt.TQWidget): def __init__(self, s=None, parent=None, name=None): - qt.TQWidget.__init__(self, parent, name) + tqt.TQWidget.__init__(self, parent, name) - lcd = qt.TQLCDNumber(2, self, "lcd") - self.slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") + lcd = tqt.TQLCDNumber(2, self, "lcd") + self.slider = tqt.TQSlider(tqt.TQt.Horizontal, self, "slider") self.slider.setRange(0, 99) self.slider.setValue(0) - self.label = qt.TQLabel(" ", self, "label") - self.label.setAlignment(qt.TQt.AlignCenter) + self.label = tqt.TQLabel(" ", self, "label") + self.label.setAlignment(tqt.TQt.AlignCenter) - self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) - self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) + self.connect(self.slider, tqt.SIGNAL("valueChanged(int)"), lcd, tqt.SLOT("display(int)")) + self.connect(self.slider, tqt.SIGNAL("valueChanged(int)"), self, tqt.PYSIGNAL("valueChanged(int)")) self.setFocusProxy(self.slider) - l = qt.TQVBoxLayout(self) + l = tqt.TQVBoxLayout(self) l.addWidget(lcd, 1) l.addWidget(self.slider) l.addWidget(self.label) @@ -52,26 +52,26 @@ class LCDRange(qt.TQWidget): self.label.setText(s) -class CannonField(qt.TQWidget): +class CannonField(tqt.TQWidget): def __init__(self, parent=None, name=None): - qt.TQWidget.__init__(self, parent, name) + tqt.TQWidget.__init__(self, parent, name) self.ang = 45 self.f = 0 self.timerCount = 0 - self.autoShootTimer = qt.TQTimer(self, "movement handler") - self.connect(self.autoShootTimer, qt.SIGNAL("timeout()"), self.moveShot) + self.autoShootTimer = tqt.TQTimer(self, "movement handler") + self.connect(self.autoShootTimer, tqt.SIGNAL("timeout()"), self.moveShot) self.shoot_ang = 0 self.shoot_f = 0 - self.target = qt.TQPoint(0, 0) + self.target = tqt.TQPoint(0, 0) self.gameEnded = 0 self.barrelPressed = 0 - self.setPalette(qt.TQPalette(qt.TQColor(250, 250, 200))) + self.setPalette(tqt.TQPalette(tqt.TQColor(250, 250, 200))) - self.barrelRect = qt.TQRect(33, -4, 15, 8) + self.barrelRect = tqt.TQRect(33, -4, 15, 8) self.newTarget() @@ -87,7 +87,7 @@ class CannonField(qt.TQWidget): return self.ang = degrees self.repaint(self.cannonRect(), 0) - self.emit(qt.PYSIGNAL("angleChanged(int)"), (self.ang, )) + self.emit(tqt.PYSIGNAL("angleChanged(int)"), (self.ang, )) def force(self): return self.f @@ -98,7 +98,7 @@ class CannonField(qt.TQWidget): if self.f == newton: return self.f = newton - self.emit(qt.PYSIGNAL("forceChanged(int)"), (self.f, )) + self.emit(tqt.PYSIGNAL("forceChanged(int)"), (self.f, )) def shoot(self): if self.isShooting(): @@ -108,12 +108,12 @@ class CannonField(qt.TQWidget): self.shoot_ang = self.ang self.shoot_f = self.f self.autoShootTimer.start(50) - self.emit(qt.PYSIGNAL("canShoot(bool)"), (0, )) + self.emit(tqt.PYSIGNAL("canShoot(bool)"), (0, )) def newTarget(self): - r = qt.TQRegion(self.targetRect()) - self.target = qt.TQPoint(random.randint(200, 390), random.randint(10, 265)) - self.repaint(r.unite(qt.TQRegion(self.targetRect()))) + r = tqt.TQRegion(self.targetRect()) + self.target = tqt.TQPoint(random.randint(200, 390), random.randint(10, 265)) + self.repaint(r.unite(tqt.TQRegion(self.targetRect()))) def gameOver(self): return self.gameEnded @@ -131,29 +131,29 @@ class CannonField(qt.TQWidget): self.autoShootTime.stop() self.gameEnded = 0 self.repaint() - self.emit(qt.PYSIGNAL("canShoot(bool)"), (1, )) + self.emit(tqt.PYSIGNAL("canShoot(bool)"), (1, )) def moveShot(self): - r = qt.TQRegion(self.shotRect()) + r = tqt.TQRegion(self.shotRect()) self.timerCount = self.timerCount + 1 shotR = self.shotRect() if shotR.intersects(self.targetRect()): self.autoShootTimer.stop() - self.emit(qt.PYSIGNAL("hit()"), ()) - self.emit(qt.PYSIGNAL("canShoot(bool)"), (1, )) + self.emit(tqt.PYSIGNAL("hit()"), ()) + self.emit(tqt.PYSIGNAL("canShoot(bool)"), (1, )) elif shotR.x() > self.width() or shotR.y() > self.height() or shotR.intersects(self.barrierRect()): self.autoShootTimer.stop() - self.emit(qt.PYSIGNAL("missed()"), ()) - self.emit(qt.PYSIGNAL("canShoot(bool)"), (1, )) + self.emit(tqt.PYSIGNAL("missed()"), ()) + self.emit(tqt.PYSIGNAL("canShoot(bool)"), (1, )) else: - r = r.unite(qt.TQRegion(shotR)) + r = r.unite(tqt.TQRegion(shotR)) self.repaint(r) def mousePressEvent(self, ev): - if ev.button() != qt.TQt.LeftButton: + if ev.button() != tqt.TQt.LeftButton: return if self.barrelHit(ev.pos()): self.barrelPressed = 1 @@ -170,17 +170,17 @@ class CannonField(qt.TQWidget): self.setAngle(int(round(rad * 180 / math.pi))) def mouseReleaseEvent(self, ev): - if ev.button() == qt.TQt.LeftButton: + if ev.button() == tqt.TQt.LeftButton: self.barrelPressed = 0 def paintEvent(self, ev): updateR = ev.rect() - p = qt.TQPainter(self) + p = tqt.TQPainter(self) if self.gameEnded: - p.setPen(qt.TQt.black) - p.setFont(qt.TQFont("Courier", 48, qt.TQFont.Bold)) - p.drawText(self.rect(), qt.TQt.AlignCenter, "Game Over") + p.setPen(tqt.TQt.black) + p.setFont(tqt.TQFont("Courier", 48, tqt.TQFont.Bold)) + p.drawText(self.rect(), tqt.TQt.AlignCenter, "Game Over") if updateR.intersects(self.cannonRect()): self.paintCannon(p) @@ -195,31 +195,31 @@ class CannonField(qt.TQWidget): self.paintTarget(p) def paintShot(self, p): - p.setBrush(qt.TQt.black) - p.setPen(qt.TQt.NoPen) + p.setBrush(tqt.TQt.black) + p.setPen(tqt.TQt.NoPen) p.drawRect(self.shotRect()) def paintTarget(self, p): - p.setBrush(qt.TQt.red) - p.setPen(qt.TQt.black) + p.setBrush(tqt.TQt.red) + p.setPen(tqt.TQt.black) p.drawRect(self.targetRect()) def paintBarrier(self, p): - p.setBrush(qt.TQt.yellow) - p.setPen(qt.TQt.black) + p.setBrush(tqt.TQt.yellow) + p.setPen(tqt.TQt.black) p.drawRect(self.barrierRect()) def paintCannon(self, p): cr = self.cannonRect() - pix = qt.TQPixmap(cr.size()) + pix = tqt.TQPixmap(cr.size()) pix.fill(self, cr.topLeft()) - tmp = qt.TQPainter(pix) - tmp.setBrush(qt.TQt.blue) - tmp.setPen(qt.TQt.NoPen) + tmp = tqt.TQPainter(pix) + tmp.setBrush(tqt.TQt.blue) + tmp.setPen(tqt.TQt.NoPen) tmp.translate(0, pix.height() - 1) - tmp.drawPie(qt.TQRect(-35, -35, 70, 70), 0, 90 * 16) + tmp.drawPie(tqt.TQRect(-35, -35, 70, 70), 0, 90 * 16) tmp.rotate(-self.ang) tmp.drawRect(self.barrelRect) tmp.end() @@ -227,7 +227,7 @@ class CannonField(qt.TQWidget): p.drawPixmap(cr.topLeft(), pix) def cannonRect(self): - r = qt.TQRect(0, 0, 50, 50) + r = tqt.TQRect(0, 0, 50, 50) r.moveBottomLeft(self.rect().bottomLeft()) return r @@ -245,20 +245,20 @@ class CannonField(qt.TQWidget): x = x0 + velx * time y = y0 + vely * time - 0.5 * gravity * time * time - r = qt.TQRect(0, 0, 6, 6) - r.moveCenter(qt.TQPoint(int(x), int(self.height() - 1 - y))) + r = tqt.TQRect(0, 0, 6, 6) + r.moveCenter(tqt.TQPoint(int(x), int(self.height() - 1 - y))) return r def targetRect(self): - r = qt.TQRect(0, 0, 20, 10) - r.moveCenter(qt.TQPoint(self.target.x(), self.height() - 1 - self.target.y())) + r = tqt.TQRect(0, 0, 20, 10) + r.moveCenter(tqt.TQPoint(self.target.x(), self.height() - 1 - self.target.y())) return r def barrierRect(self): - return qt.TQRect(145, self.height() - 100, 15, 100) + return tqt.TQRect(145, self.height() - 100, 15, 100) def barrelHit(self, p): - mtx = qt.TQWMatrix() + mtx = tqt.TQWMatrix() mtx.translate(0, self.height() - 1) mtx.rotate(-self.ang) (mtx, invertable) = mtx.invert() @@ -268,16 +268,16 @@ class CannonField(qt.TQWidget): return self.autoShootTimer.isActive() def sizePolicy(self): - return qt.TQSizePolicy(qt.TQSizePolicy.Expanding, qt.TQSizePolicy.Expanding) + return tqt.TQSizePolicy(tqt.TQSizePolicy.Expanding, tqt.TQSizePolicy.Expanding) -class GameBoard(qt.TQWidget): +class GameBoard(tqt.TQWidget): def __init__(self, parent=None, name=None): - qt.TQWidget.__init__(self, parent, name) + tqt.TQWidget.__init__(self, parent, name) - quit = qt.TQPushButton("&Quit", self, "quit") - quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) - self.connect(quit, qt.SIGNAL("clicked()"), qt.tqApp, qt.SLOT("quit()")) + quit = tqt.TQPushButton("&Quit", self, "quit") + quit.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) + self.connect(quit, tqt.SIGNAL("clicked()"), tqt.tqApp, tqt.SLOT("quit()")) self.angle = LCDRange("ANGLE", self, "angle") self.angle.setRange(5, 70) @@ -285,50 +285,50 @@ class GameBoard(qt.TQWidget): self.force = LCDRange("FORCE", self, "force") self.force.setRange(10, 50) - box = qt.TQVBox(self, "cannonFrame") - box.setFrameStyle(qt.TQFrame.WinPanel | qt.TQFrame.Sunken) + box = tqt.TQVBox(self, "cannonFrame") + box.setFrameStyle(tqt.TQFrame.WinPanel | tqt.TQFrame.Sunken) self.cannonField = CannonField(box, "cannonField") - self.connect(self.angle, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) - self.connect(self.cannonField, qt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) + self.connect(self.angle, tqt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) + self.connect(self.cannonField, tqt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) - self.connect(self.force, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce) - self.connect(self.cannonField, qt.PYSIGNAL("forceChanged(int)"), self.force.setValue) + self.connect(self.force, tqt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce) + self.connect(self.cannonField, tqt.PYSIGNAL("forceChanged(int)"), self.force.setValue) - self.connect(self.cannonField, qt.PYSIGNAL("hit()"), self.hit) - self.connect(self.cannonField, qt.PYSIGNAL("missed()"), self.missed) + self.connect(self.cannonField, tqt.PYSIGNAL("hit()"), self.hit) + self.connect(self.cannonField, tqt.PYSIGNAL("missed()"), self.missed) - self.shoot = qt.TQPushButton("&Shoot", self, "shoot") - self.shoot.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) - self.connect(self.shoot, qt.SIGNAL("clicked()"), self.fire) - self.connect(self.cannonField, qt.PYSIGNAL("canShoot(bool)"), self.shoot, qt.SLOT("setEnabled(bool)")) + self.shoot = tqt.TQPushButton("&Shoot", self, "shoot") + self.shoot.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) + self.connect(self.shoot, tqt.SIGNAL("clicked()"), self.fire) + self.connect(self.cannonField, tqt.PYSIGNAL("canShoot(bool)"), self.shoot, tqt.SLOT("setEnabled(bool)")) - restart = qt.TQPushButton("&New Game", self, "newgame") - restart.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) - self.connect(restart, qt.SIGNAL("clicked()"), self.newGame) + restart = tqt.TQPushButton("&New Game", self, "newgame") + restart.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) + self.connect(restart, tqt.SIGNAL("clicked()"), self.newGame) - self.hits = qt.TQLCDNumber(2, self, "hits") - self.shotsLeft = qt.TQLCDNumber(2, self, "shotsleft") - hitsL = qt.TQLabel("HITS", self, "hitsLabel") - shotsLeftL = qt.TQLabel("SHOTS LEFT", self, "shotsleftLabel") + self.hits = tqt.TQLCDNumber(2, self, "hits") + self.shotsLeft = tqt.TQLCDNumber(2, self, "shotsleft") + hitsL = tqt.TQLabel("HITS", self, "hitsLabel") + shotsLeftL = tqt.TQLabel("SHOTS LEFT", self, "shotsleftLabel") - accel = qt.TQAccel(self) - accel.connectItem(accel.insertItem(qt.TQt.Key_Enter), self.fire) - accel.connectItem(accel.insertItem(qt.TQt.Key_Return), self.fire) - accel.connectItem(accel.insertItem(qt.TQt.CTRL + qt.TQt.Key_Q), qt.tqApp, qt.SLOT("quit()")) + accel = tqt.TQAccel(self) + accel.connectItem(accel.insertItem(tqt.TQt.Key_Enter), self.fire) + accel.connectItem(accel.insertItem(tqt.TQt.Key_Return), self.fire) + accel.connectItem(accel.insertItem(tqt.TQt.CTRL + tqt.TQt.Key_Q), tqt.tqApp, tqt.SLOT("quit()")) - grid = qt.TQGridLayout(self, 2, 2, 10) + grid = tqt.TQGridLayout(self, 2, 2, 10) grid.addWidget(quit, 0, 0) grid.addWidget(box, 1, 1) grid.setColStretch(1, 10) - leftBox = qt.TQVBoxLayout() + leftBox = tqt.TQVBoxLayout() grid.addLayout(leftBox, 1, 0) leftBox.addWidget(self.angle) leftBox.addWidget(self.force) - topBox = qt.TQHBoxLayout() + topBox = tqt.TQHBoxLayout() grid.addLayout(topBox, 0, 1) topBox.addWidget(self.shoot) topBox.addWidget(self.hits) @@ -368,8 +368,8 @@ class GameBoard(qt.TQWidget): self.cannonField.newTarget() -qt.TQApplication.setColorSpec(qt.TQApplication.CustomColor) -a = qt.TQApplication(sys.argv) +qt.TQApplication.setColorSpec(tqt.TQApplication.CustomColor) +a = tqt.TQApplication(sys.argv) gb = GameBoard() gb.setGeometry(100, 100, 500, 355) diff --git a/examples/tut2.py b/examples/tut2.py index e74101e..0f34b16 100755 --- a/examples/tut2.py +++ b/examples/tut2.py @@ -3,16 +3,16 @@ # TQt tutorial 2. import sys -from PyTQt import qt +from PyTQt import tqt -a = qt.TQApplication(sys.argv) +a = tqt.TQApplication(sys.argv) -quit = qt.TQPushButton("Quit", None) +quit = tqt.TQPushButton("Quit", None) quit.resize(75, 30) -quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) +quit.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) -qt.TQObject.connect(quit, qt.SIGNAL("clicked()"), a, qt.SLOT("quit()")) +qt.TQObject.connect(quit, tqt.SIGNAL("clicked()"), a, tqt.SLOT("quit()")) a.setMainWidget(quit) quit.show() diff --git a/examples/tut3.py b/examples/tut3.py index 85c3dc6..6cb1305 100755 --- a/examples/tut3.py +++ b/examples/tut3.py @@ -3,18 +3,18 @@ # TQt tutorial 3. import sys -from PyTQt import qt +from PyTQt import tqt -a = qt.TQApplication(sys.argv) +a = tqt.TQApplication(sys.argv) -box = qt.TQVBox() +box = tqt.TQVBox() box.resize(200, 120) -quit = qt.TQPushButton("Quit", box) -quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) +quit = tqt.TQPushButton("Quit", box) +quit.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) -qt.TQObject.connect(quit, qt.SIGNAL("clicked()"), a, qt.SLOT("quit()")) +qt.TQObject.connect(quit, tqt.SIGNAL("clicked()"), a, tqt.SLOT("quit()")) a.setMainWidget(box) box.show() diff --git a/examples/tut4.py b/examples/tut4.py index 04e0a61..f61a054 100755 --- a/examples/tut4.py +++ b/examples/tut4.py @@ -3,24 +3,24 @@ # TQt tutorial 4. import sys -from PyTQt import qt +from PyTQt import tqt -class MyWidget(qt.TQWidget): +class MyWidget(tqt.TQWidget): def __init__(self, parent=None, name=None): - qt.TQWidget.__init__(self, parent, name) + tqt.TQWidget.__init__(self, parent, name) self.setMinimumSize(200, 120) self.setMaximumSize(200, 120) - quit = qt.TQPushButton("Quit", self, "quit") + quit = tqt.TQPushButton("Quit", self, "quit") quit.setGeometry(62, 40, 75, 30) - quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) + quit.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) - self.connect(quit, qt.SIGNAL("clicked()"), qt.tqApp, qt.SLOT("quit()")) + self.connect(quit, tqt.SIGNAL("clicked()"), tqt.tqApp, tqt.SLOT("quit()")) -a = qt.TQApplication(sys.argv) +a = tqt.TQApplication(sys.argv) w = MyWidget() w.setGeometry(100, 100, 200, 120) diff --git a/examples/tut5.py b/examples/tut5.py index a56c216..fe12295 100755 --- a/examples/tut5.py +++ b/examples/tut5.py @@ -3,28 +3,28 @@ # TQt tutorial 5. import sys -from PyTQt import qt +from PyTQt import tqt -class MyWidget(qt.TQVBox): +class MyWidget(tqt.TQVBox): def __init__(self, parent=None, name=None): - qt.TQVBox.__init__(self, parent, name) + tqt.TQVBox.__init__(self, parent, name) - quit = qt.TQPushButton("Quit", self, "quit") - quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) + quit = tqt.TQPushButton("Quit", self, "quit") + quit.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) - self.connect(quit, qt.SIGNAL("clicked()"), qt.tqApp, qt.SLOT("quit()")) + self.connect(quit, tqt.SIGNAL("clicked()"), tqt.tqApp, tqt.SLOT("quit()")) - lcd = qt.TQLCDNumber(2, self, "lcd") + lcd = tqt.TQLCDNumber(2, self, "lcd") - slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") + slider = tqt.TQSlider(tqt.TQt.Horizontal, self, "slider") slider.setRange(0, 99) slider.setValue(0) - self.connect(slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) + self.connect(slider, tqt.SIGNAL("valueChanged(int)"), lcd, tqt.SLOT("display(int)")) -a = qt.TQApplication(sys.argv) +a = tqt.TQApplication(sys.argv) w = MyWidget() a.setMainWidget(w) diff --git a/examples/tut6.py b/examples/tut6.py index ab98c09..7c6c682 100755 --- a/examples/tut6.py +++ b/examples/tut6.py @@ -3,37 +3,37 @@ # TQt tutorial 6. import sys -from PyTQt import qt +from PyTQt import tqt -class LCDRange(qt.TQVBox): +class LCDRange(tqt.TQVBox): def __init__(self, parent=None, name=None): - qt.TQVBox.__init__(self, parent, name) + tqt.TQVBox.__init__(self, parent, name) - lcd = qt.TQLCDNumber(2, self, "lcd") - slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") + lcd = tqt.TQLCDNumber(2, self, "lcd") + slider = tqt.TQSlider(tqt.TQt.Horizontal, self, "slider") slider.setRange(0, 99) slider.setValue(0) - self.connect(slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) + self.connect(slider, tqt.SIGNAL("valueChanged(int)"), lcd, tqt.SLOT("display(int)")) -class MyWidget(qt.TQVBox): +class MyWidget(tqt.TQVBox): def __init__(self, parent=None, name=None): - qt.TQVBox.__init__(self, parent, name) + tqt.TQVBox.__init__(self, parent, name) - quit = qt.TQPushButton("Quit", self, "quit") - quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) + quit = tqt.TQPushButton("Quit", self, "quit") + quit.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) - self.connect(quit, qt.SIGNAL("clicked()"), qt.tqApp, qt.SLOT("quit()")) + self.connect(quit, tqt.SIGNAL("clicked()"), tqt.tqApp, tqt.SLOT("quit()")) - grid = qt.TQGrid(4, self) + grid = tqt.TQGrid(4, self) for c in range(4): for r in range(4): LCDRange(grid) -a = qt.TQApplication(sys.argv) +a = tqt.TQApplication(sys.argv) w = MyWidget() a.setMainWidget(w) diff --git a/examples/tut7.py b/examples/tut7.py index 1df3f4e..ed8da51 100755 --- a/examples/tut7.py +++ b/examples/tut7.py @@ -3,19 +3,19 @@ # TQt tutorial 7. import sys -from PyTQt import qt +from PyTQt import tqt -class LCDRange(qt.TQVBox): +class LCDRange(tqt.TQVBox): def __init__(self, parent=None, name=None): - qt.TQVBox.__init__(self, parent, name) + tqt.TQVBox.__init__(self, parent, name) - lcd = qt.TQLCDNumber(2, self, "lcd") - self.slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") + lcd = tqt.TQLCDNumber(2, self, "lcd") + self.slider = tqt.TQSlider(tqt.TQt.Horizontal, self, "slider") self.slider.setRange(0, 99) self.slider.setValue(0) - self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) - self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) + self.connect(self.slider, tqt.SIGNAL("valueChanged(int)"), lcd, tqt.SLOT("display(int)")) + self.connect(self.slider, tqt.SIGNAL("valueChanged(int)"), self, tqt.PYSIGNAL("valueChanged(int)")) def value(self): return self.slider.value() @@ -24,16 +24,16 @@ class LCDRange(qt.TQVBox): self.slider.setValue(value) -class MyWidget(qt.TQVBox): +class MyWidget(tqt.TQVBox): def __init__(self, parent=None, name=None): - qt.TQVBox.__init__(self, parent, name) + tqt.TQVBox.__init__(self, parent, name) - quit = qt.TQPushButton("Quit", self, "quit") - quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) + quit = tqt.TQPushButton("Quit", self, "quit") + quit.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) - self.connect(quit, qt.SIGNAL("clicked()"), qt.tqApp, qt.SLOT("quit()")) + self.connect(quit, tqt.SIGNAL("clicked()"), tqt.tqApp, tqt.SLOT("quit()")) - grid = qt.TQGrid(4, self) + grid = tqt.TQGrid(4, self) self.lcdlist = [] previous = None @@ -43,13 +43,13 @@ class MyWidget(qt.TQVBox): lr = LCDRange(grid) if previous: - self.connect(lr, qt.PYSIGNAL("valueChanged(int)"), previous.setValue) + self.connect(lr, tqt.PYSIGNAL("valueChanged(int)"), previous.setValue) previous = lr self.lcdlist.append(lr) -a = qt.TQApplication(sys.argv) +a = tqt.TQApplication(sys.argv) w = MyWidget() a.setMainWidget(w) diff --git a/examples/tut8.py b/examples/tut8.py index 24f91c2..ca4a912 100755 --- a/examples/tut8.py +++ b/examples/tut8.py @@ -3,19 +3,19 @@ # TQt tutorial 8. import sys -from PyTQt import qt +from PyTQt import tqt -class LCDRange(qt.TQVBox): +class LCDRange(tqt.TQVBox): def __init__(self, parent=None, name=None): - qt.TQVBox.__init__(self, parent, name) + tqt.TQVBox.__init__(self, parent, name) - lcd = qt.TQLCDNumber(2, self, "lcd") - self.slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") + lcd = tqt.TQLCDNumber(2, self, "lcd") + self.slider = tqt.TQSlider(tqt.TQt.Horizontal, self, "slider") self.slider.setRange(0, 99) self.slider.setValue(0) - self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) - self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) + self.connect(self.slider, tqt.SIGNAL("valueChanged(int)"), lcd, tqt.SLOT("display(int)")) + self.connect(self.slider, tqt.SIGNAL("valueChanged(int)"), self, tqt.PYSIGNAL("valueChanged(int)")) self.setFocusProxy(self.slider) @@ -32,12 +32,12 @@ class LCDRange(qt.TQVBox): self.slider.setRange(minVal, maxVal) -class CannonField(qt.TQWidget): +class CannonField(tqt.TQWidget): def __init__(self, parent=None, name=None): - qt.TQWidget.__init__(self, parent, name) + tqt.TQWidget.__init__(self, parent, name) self.ang = 45 - self.setPalette(qt.TQPalette(qt.TQColor(250, 250, 200))) + self.setPalette(tqt.TQPalette(tqt.TQColor(250, 250, 200))) def angle(self): return self.ang @@ -51,36 +51,36 @@ class CannonField(qt.TQWidget): return self.ang = degrees self.repaint() - self.emit(qt.PYSIGNAL("angleChanged(int)"), (self.ang, )) + self.emit(tqt.PYSIGNAL("angleChanged(int)"), (self.ang, )) def paintEvent(self, ev): - p = qt.TQPainter(self) + p = tqt.TQPainter(self) p.drawText(200, 200, "Angle = %d" % (self.ang)) def sizePolicy(self): - return qt.TQSizePolicy(qt.TQSizePolicy.Expanding, qt.TQSizePolicy.Expanding) + return tqt.TQSizePolicy(tqt.TQSizePolicy.Expanding, tqt.TQSizePolicy.Expanding) -class MyWidget(qt.TQWidget): +class MyWidget(tqt.TQWidget): def __init__(self, parent=None, name=None): - qt.TQWidget.__init__(self, parent, name) + tqt.TQWidget.__init__(self, parent, name) - quit = qt.TQPushButton("Quit", self, "quit") - quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) - self.connect(quit, qt.SIGNAL("clicked()"), qt.tqApp, qt.SLOT("quit()")) + quit = tqt.TQPushButton("Quit", self, "quit") + quit.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) + self.connect(quit, tqt.SIGNAL("clicked()"), tqt.tqApp, tqt.SLOT("quit()")) self.angle = LCDRange(self, "angle") self.angle.setRange(5, 70) self.cannonField = CannonField(self, "cannonField") - self.connect(self.angle, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) - self.connect(self.cannonField, qt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) + self.connect(self.angle, tqt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) + self.connect(self.cannonField, tqt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) - grid = qt.TQGridLayout(self, 2, 2, 10) + grid = tqt.TQGridLayout(self, 2, 2, 10) grid.addWidget(quit, 0, 0) - grid.addWidget(self.angle, 1, 0, qt.TQt.AlignTop) + grid.addWidget(self.angle, 1, 0, tqt.TQt.AlignTop) grid.addWidget(self.cannonField, 1, 1) grid.setColStretch(1, 10) @@ -88,7 +88,7 @@ class MyWidget(qt.TQWidget): self.angle.setFocus() -a = qt.TQApplication(sys.argv) +a = tqt.TQApplication(sys.argv) w = MyWidget() w.setGeometry(100, 100, 500, 355) diff --git a/examples/tut9.py b/examples/tut9.py index e45b0e4..df0de2c 100755 --- a/examples/tut9.py +++ b/examples/tut9.py @@ -3,19 +3,19 @@ # TQt tutorial 9. import sys -from PyTQt import qt +from PyTQt import tqt -class LCDRange(qt.TQVBox): +class LCDRange(tqt.TQVBox): def __init__(self, parent=None, name=None): - qt.TQVBox.__init__(self, parent, name) + tqt.TQVBox.__init__(self, parent, name) - lcd = qt.TQLCDNumber(2, self, "lcd") - self.slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") + lcd = tqt.TQLCDNumber(2, self, "lcd") + self.slider = tqt.TQSlider(tqt.TQt.Horizontal, self, "slider") self.slider.setRange(0, 99) self.slider.setValue(0) - self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) - self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) + self.connect(self.slider, tqt.SIGNAL("valueChanged(int)"), lcd, tqt.SLOT("display(int)")) + self.connect(self.slider, tqt.SIGNAL("valueChanged(int)"), self, tqt.PYSIGNAL("valueChanged(int)")) self.setFocusProxy(self.slider) @@ -31,12 +31,12 @@ class LCDRange(qt.TQVBox): self.slider.setRange(minVal, maxVal) -class CannonField(qt.TQWidget): +class CannonField(tqt.TQWidget): def __init__(self, parent=None, name=None): - qt.TQWidget.__init__(self, parent, name) + tqt.TQWidget.__init__(self, parent, name) self.ang = 45 - self.setPalette(qt.TQPalette(qt.TQColor(250, 250, 200))) + self.setPalette(tqt.TQPalette(tqt.TQColor(250, 250, 200))) def angle(self): return self.ang @@ -50,43 +50,43 @@ class CannonField(qt.TQWidget): return self.ang = degrees self.repaint() - self.emit(qt.PYSIGNAL("angleChanged(int)"), (self.ang, )) + self.emit(tqt.PYSIGNAL("angleChanged(int)"), (self.ang, )) def paintEvent(self, ev): - p = qt.TQPainter(self) + p = tqt.TQPainter(self) - p.setBrush(qt.TQt.blue) - p.setPen(qt.TQt.NoPen) + p.setBrush(tqt.TQt.blue) + p.setPen(tqt.TQt.NoPen) p.translate(0, self.rect().bottom()) - p.drawPie(qt.TQRect(-35, -35, 70, 70), 0, 90 * 16) + p.drawPie(tqt.TQRect(-35, -35, 70, 70), 0, 90 * 16) p.rotate(-self.ang) - p.drawRect(qt.TQRect(33, -4, 15, 8)) + p.drawRect(tqt.TQRect(33, -4, 15, 8)) def sizePolicy(self): - return qt.TQSizePolicy(qt.TQSizePolicy.Expanding, qt.TQSizePolicy.Expanding) + return tqt.TQSizePolicy(tqt.TQSizePolicy.Expanding, tqt.TQSizePolicy.Expanding) -class MyWidget(qt.TQWidget): +class MyWidget(tqt.TQWidget): def __init__(self, parent=None, name=None): - qt.TQWidget.__init__(self, parent, name) + tqt.TQWidget.__init__(self, parent, name) - quit = qt.TQPushButton("&Quit", self, "quit") - quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) - self.connect(quit, qt.SIGNAL("clicked()"), qt.tqApp, qt.SLOT("quit()")) + quit = tqt.TQPushButton("&Quit", self, "quit") + quit.setFont(tqt.TQFont("Times", 18, tqt.TQFont.Bold)) + self.connect(quit, tqt.SIGNAL("clicked()"), tqt.tqApp, tqt.SLOT("quit()")) self.angle = LCDRange(self, "angle") self.angle.setRange(5, 70) self.cannonField = CannonField(self, "cannonField") - self.connect(self.angle, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) - self.connect(self.cannonField, qt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) + self.connect(self.angle, tqt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) + self.connect(self.cannonField, tqt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) - grid = qt.TQGridLayout(self, 2, 2, 10) + grid = tqt.TQGridLayout(self, 2, 2, 10) grid.addWidget(quit, 0, 0) - grid.addWidget(self.angle, 1, 0, qt.TQt.AlignTop) + grid.addWidget(self.angle, 1, 0, tqt.TQt.AlignTop) grid.addWidget(self.cannonField, 1, 1) grid.setColStretch(1, 10) @@ -94,8 +94,8 @@ class MyWidget(qt.TQWidget): self.angle.setFocus() -qt.TQApplication.setColorSpec(qt.TQApplication.CustomColor) -a = qt.TQApplication(sys.argv) +qt.TQApplication.setColorSpec(tqt.TQApplication.CustomColor) +a = tqt.TQApplication(sys.argv) w = MyWidget() w.setGeometry(100, 100, 500, 355) diff --git a/examples/webbrowser/mainwindow.py b/examples/webbrowser/mainwindow.py index 24ca188..2d4e740 100644 --- a/examples/webbrowser/mainwindow.py +++ b/examples/webbrowser/mainwindow.py @@ -3,13 +3,13 @@ # Form implementation generated from reading ui file 'mainwindow.ui' # # Created: Sun Dec 5 14:50:47 2004 -# by: The PyTQt User Interface Compiler (pyuic) snapshot-20041203 +# by: The PyTQt User Interface Compiler (pytquic) snapshot-20041203 # # WARNING! All changes made in this file will be lost! -from PyTQt.qt import * -from PyTQt.qtaxcontainer import TQAxWidget +from PyTQt.tqt import * +from PyTQt.tqtaxcontainer import TQAxWidget image0_data = [ "32 32 3 1", @@ -925,7 +925,7 @@ class MainWindow(TQMainWindow): self.setName("MainWindow") - self.setCentralWidget(TQWidget(self,"qt_central_widget")) + self.setCentralWidget(TQWidget(self,"tqt_central_widget")) MainWindowLayout = TQHBoxLayout(self.centralWidget(),0,6,"MainWindowLayout") self.Frame3 = TQFrame(self.centralWidget(),"Frame3") diff --git a/examples/webbrowser/webbrowser.py b/examples/webbrowser/webbrowser.py index 44d3488..0ae8702 100644 --- a/examples/webbrowser/webbrowser.py +++ b/examples/webbrowser/webbrowser.py @@ -7,21 +7,21 @@ import sys -from PyTQt import qt -from PyTQt import qtaxcontainer +from PyTQt import tqt +from PyTQt import tqtaxcontainer import mainwindow class MainWindowImpl(mainwindow.MainWindow): def init(self): - self.pb = qt.TQProgressBar(self.statusBar()) + self.pb = tqt.TQProgressBar(self.statusBar()) self.pb.setPercentageVisible(False) self.pb.hide() self.statusBar().addWidget(self.pb, 0, True) - self.connect(self.WebBrowser, qt.SIGNAL("ProgressChange(int,int)"), self.setProgress) - self.connect(self.WebBrowser, qt.SIGNAL("StatusTextChange(const TQString&)"), self.statusBar(), qt.SLOT("message(const TQString&)")) + self.connect(self.WebBrowser, tqt.SIGNAL("ProgressChange(int,int)"), self.setProgress) + self.connect(self.WebBrowser, tqt.SIGNAL("StatusTextChange(const TQString&)"), self.statusBar(), tqt.SLOT("message(const TQString&)")) self.WebBrowser.dynamicCall("GoHome()"); @@ -29,7 +29,7 @@ class MainWindowImpl(mainwindow.MainWindow): def go(self): self.actionStop.setEnabled(True) - self.WebBrowser.dynamicCall("Navigate(const TQString&)", qt.TQVariant(self.addressEdit.text())) + self.WebBrowser.dynamicCall("Navigate(const TQString&)", tqt.TQVariant(self.addressEdit.text())) def setTitle(self, title): self.setCaption("TQt WebBrowser - " + title.latin1()) @@ -69,17 +69,17 @@ class MainWindowImpl(mainwindow.MainWindow): self.subwindows += window def aboutSlot(self): - qt.TQMessageBox.about(self, self.tr("About WebBrowser"), self.tr( + tqt.TQMessageBox.about(self, self.tr("About WebBrowser"), self.tr( """This Example has been created using the ActiveTQt integration into TQt Designer. It demonstrates the use of TQAxWidget to embed the Internet Explorer ActiveX control into a TQt application.""")) def aboutTQtSlot(self): - qt.TQMessageBox.aboutTQt(self, self.tr("About TQt")) + tqt.TQMessageBox.aboutTQt(self, self.tr("About TQt")) def main(args): - a = qt.TQApplication(args) + a = tqt.TQApplication(args) w = MainWindowImpl() a.setMainWidget(w) w.show() diff --git a/examples/widgets.py b/examples/widgets.py index d9f554d..59a44c4 100755 --- a/examples/widgets.py +++ b/examples/widgets.py @@ -2,7 +2,7 @@ import sys, string -from PyTQt.qt import * +from PyTQt.tqt import * # ## Constructs an analog clock widget that uses an internal TQTimer. @@ -36,7 +36,7 @@ class AnalogClock( TQWidget ): # ## The clock is painted using a 1000x1000 square coordinate system. # - def paintEvent( self, qe ): # paint clock + def paintEvent( self, tqe ): # paint clock if not self.isVisible(): # is is invisible return self.time = TQTime.currentTime() # save current time @@ -192,10 +192,10 @@ class WidgetView ( TQWidget ): self.connect( self.pb, SIGNAL("clicked()"), self.button1Clicked ) TQToolTip.add( self.pb, "push button 1" ) self.pm = TQPixmap() - self.pix = self.pm.load( "qt.png" ) # load pixmap for button 2 + self.pix = self.pm.load( "tqt.png" ) # load pixmap for button 2 if not self.pix: TQMessageBox.information( None, "TQt Widgets Example", - "Could not load the file \"qt.png\", which\n" + "Could not load the file \"tqt.png\", which\n" "contains an icon used...\n\n" "The text \"line 42\" will be substituted.", TQMessageBox.Ok + TQMessageBox.Default ) diff --git a/module-init.py b/module-init.py index 404ec4b..0f08cbd 100644 --- a/module-init.py +++ b/module-init.py @@ -7,8 +7,8 @@ for m_path in sys.path: m_sip_dir = os.path.join(m_path, 'sip4_tqt') tqt_modules.insert(0, m_sip_dir) if os.path.exists(os.path.join(m_path, 'PyTQt')): - m_pyqt_dir = os.path.join(m_path, 'PyTQt') - tqt_modules.insert(0, m_pyqt_dir) + m_pytqt_dir = os.path.join(m_path, 'PyTQt') + tqt_modules.insert(0, m_pytqt_dir) for m_path in tqt_modules: sys.path.insert(0, m_path) @@ -31,22 +31,22 @@ def is_module_available(module_name): # Base modules __all__ = [ - 'qt', - 'qtcanvas', - 'qtnetwork', - 'qttable', - 'qtsql', - 'qtui', - 'qtxml', + 'tqt', + 'tqtcanvas', + 'tqtnetwork', + 'tqttable', + 'tqtsql', + 'tqtui', + 'tqtxml', ] # Optional modules -if is_module_available('qtaxcontainer'): - __all__.append('qtaxcontainer') -if is_module_available('qtext'): - __all__.append('qtext') -if is_module_available('qtgl'): - __all__.append('qtgl') +if is_module_available('tqtaxcontainer'): + __all__.append('tqtaxcontainer') +if is_module_available('tqtext'): + __all__.append('tqtext') +if is_module_available('tqtgl'): + __all__.append('tqtgl') # Import namespaces from PyTQt import * diff --git a/pylupdate3/LICENSE.GPL b/pylupdate3/LICENSE.GPL deleted file mode 100644 index c7aea18..0000000 --- a/pylupdate3/LICENSE.GPL +++ /dev/null @@ -1,280 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/pylupdate3/fetchtr.cpp b/pylupdate3/fetchtr.cpp deleted file mode 100644 index 96978cd..0000000 --- a/pylupdate3/fetchtr.cpp +++ /dev/null @@ -1,455 +0,0 @@ -/********************************************************************** -** Copyright (C) 2002 Detlev Offenbach -** -** This is a modified version of lupdate. The original is part of TQt-Linguist. -** The copyright of the original file can be found below. -** -** This version is modified to handle python sources. -** -** The file is provided AS IS with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. -** -**********************************************************************/ - - -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** fetchtr.cpp -** -** This file is part of TQt Linguist. -** -** See the file LICENSE included in the distribution for the usage -** and distribution terms. -** -** The file is provided AS IS with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. -** -**********************************************************************/ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -/*#include */ - - -static const char MagicComment[] = "TRANSLATOR "; - -static TQMap needs_Q_OBJECT; -static TQMap lacks_Q_OBJECT; - -/* - The first part of this source file is the python tokenizer. We skip - most of python; the only tokens that interest us are defined here. -*/ - -enum { Tok_Eof, Tok_class, Tok_return, Tok_tr, - Tok_trUtf8, Tok_translate, Tok_Ident, - Tok_Comment, Tok_Dot, Tok_String, - Tok_LeftParen, Tok_RightParen, - Tok_Comma}; - -/* - The tokenizer maintains the following global variables. The names - should be self-explanatory. -*/ -static TQCString yyFileName; -static int yyCh; -static char yyIdent[128]; -static size_t yyIdentLen; -static char yyComment[65536]; -static size_t yyCommentLen; -static char yyString[16384]; -static size_t yyStringLen; -static int yyParenDepth; -static int yyLineNo; -static int yyCurLineNo; - -// the file to read from (if reading from a file) -static FILE *yyInFile; - -// the string to read from and current position in the string (otherwise) -static TQString yyInStr; -static int yyInPos; -static int buf; - -static int (*getChar)(); -static int (*peekChar)(); - -static int getCharFromFile() -{ - int c; - - if ( buf < 0 ) - c = getc( yyInFile ); - else { - c = buf; - buf = -1; - } - if ( c == '\n' ) - yyCurLineNo++; - return c; -} - -static int peekCharFromFile() -{ - int c = getc( yyInFile ); - buf = c; - return c; -} - -static void startTokenizer( const char *fileName, int (*getCharFunc)(), - int (*peekCharFunc)() ) -{ - yyInPos = 0; - buf = -1; - getChar = getCharFunc; - peekChar = peekCharFunc; - - yyFileName = fileName; - yyCh = getChar(); - yyParenDepth = 0; - yyCurLineNo = 1; -} - -static int getToken() -{ - const char tab[] = "abfnrtv"; - const char backTab[] = "\a\b\f\n\r\t\v"; - uint n; - - yyIdentLen = 0; - yyCommentLen = 0; - yyStringLen = 0; - - while ( yyCh != EOF ) { - yyLineNo = yyCurLineNo; - - if ( isalpha(yyCh) || yyCh == '_' ) { - do { - if ( yyIdentLen < sizeof(yyIdent) - 1 ) - yyIdent[yyIdentLen++] = (char) yyCh; - yyCh = getChar(); - } while ( isalnum(yyCh) || yyCh == '_' ); - yyIdent[yyIdentLen] = '\0'; - - switch ( yyIdent[0] ) { - case 'Q': - if ( strcmp(yyIdent + 1, "T_TR_NOOP") == 0 ) { - return Tok_tr; - } else if ( strcmp(yyIdent + 1, "T_TRANSLATE_NOOP") == 0 ) { - return Tok_translate; - } - break; - case 'c': - if ( strcmp(yyIdent + 1, "lass") == 0 ) - return Tok_class; - break; - case 'r': - if ( strcmp(yyIdent + 1, "eturn") == 0 ) - return Tok_return; - break; - case 't': - if ( strcmp(yyIdent + 1, "r") == 0 ) - return Tok_tr; - else if ( strcmp(yyIdent + 1, "rUtf8") == 0 ) - return Tok_trUtf8; - else if ( strcmp(yyIdent + 1, "ranslate") == 0 ) - return Tok_translate; - case '_': - if ( strcmp(yyIdent + 1, "_tr") == 0 ) - return Tok_tr; - else if ( strcmp(yyIdent + 1, "_trUtf8") == 0 ) - return Tok_trUtf8; - } - return Tok_Ident; - } else { - switch ( yyCh ) { - case '#': - yyCh = getChar(); - do { - yyCh = getChar(); - } while ( yyCh != EOF && yyCh != '\n' ); - break; - case '"': - case '\'': - int quoteChar; - int trippelQuote, singleQuote; - int in; - - quoteChar = yyCh; - trippelQuote = 0; - singleQuote = 1; - in = 0; - yyCh = getChar(); - - while ( yyCh != EOF ) { - if ( singleQuote && (yyCh == '\n' || (in && yyCh == quoteChar)) ) - break; - - if ( yyCh == quoteChar ) { - if (peekChar() == quoteChar) { - yyCh = getChar(); - if (!trippelQuote) { - trippelQuote = 1; - singleQuote = 0; - in = 1; - yyCh = getChar(); - } else { - yyCh = getChar(); - if (yyCh == quoteChar) { - trippelQuote = 0; - break; - } - } - } else if (trippelQuote) { - if ( yyStringLen < sizeof(yyString) - 1 ) - yyString[yyStringLen++] = (char) yyCh; - yyCh = getChar(); - continue; - } else - break; - } else - in = 1; - - if ( yyCh == '\\' ) { - yyCh = getChar(); - - if ( yyCh == 'x' ) { - TQCString hex = "0"; - - yyCh = getChar(); - while ( isxdigit(yyCh) ) { - hex += (char) yyCh; - yyCh = getChar(); - } - sscanf( hex, "%x", &n ); - if ( yyStringLen < sizeof(yyString) - 1 ) - yyString[yyStringLen++] = (char) n; - } else if ( yyCh >= '0' && yyCh < '8' ) { - TQCString oct = ""; - - do { - oct += (char) yyCh; - yyCh = getChar(); - } while ( yyCh >= '0' && yyCh < '8' ); - sscanf( oct, "%o", &n ); - if ( yyStringLen < sizeof(yyString) - 1 ) - yyString[yyStringLen++] = (char) n; - } else { - const char *p = strchr( tab, yyCh ); - if ( yyStringLen < sizeof(yyString) - 1 ) - yyString[yyStringLen++] = ( p == 0 ) ? - (char) yyCh : backTab[p - tab]; - yyCh = getChar(); - } - } else { - if ( yyStringLen < sizeof(yyString) - 1 ) - yyString[yyStringLen++] = (char) yyCh; - yyCh = getChar(); - } - } - yyString[yyStringLen] = '\0'; - - if ( yyCh != quoteChar ) { - printf("%c\n", yyCh); - tqWarning( "%s:%d: Unterminated string", - (const char *) yyFileName, yyLineNo ); - } - - if ( yyCh == EOF ) { - return Tok_Eof; - } else { - yyCh = getChar(); - return Tok_String; - } - break; - case '(': - yyParenDepth++; - yyCh = getChar(); - return Tok_LeftParen; - case ')': - yyParenDepth--; - yyCh = getChar(); - return Tok_RightParen; - case ',': - yyCh = getChar(); - return Tok_Comma; - case '.': - yyCh = getChar(); - return Tok_Dot; - default: - yyCh = getChar(); - } - } - } - return Tok_Eof; -} - -/* - The second part of this source file is the parser. It accomplishes - a very easy task: It finds all strings inside a tr() or translate() - call, and possibly finds out the context of the call. It supports - three cases: - (1) the context is specified, as in FunnyDialog.tr("Hello") or - translate("FunnyDialog", "Hello"); - (2) the call appears within an inlined function; - (3) the call appears within a function defined outside the class definition. -*/ - -static int yyTok; - -static bool match( int t ) -{ - bool matches = ( yyTok == t ); - if ( matches ) - yyTok = getToken(); - return matches; -} - -static bool matchString( TQCString *s ) -{ - bool matches = ( yyTok == Tok_String ); - *s = ""; - while ( yyTok == Tok_String ) { - *s += yyString; - yyTok = getToken(); - } - return matches; -} - -static bool matchEncoding( bool *utf8 ) -{ - if ( yyTok == Tok_Ident ) { - if ( strcmp(yyIdent, "TQApplication") == 0 ) { - yyTok = getToken(); - } - *utf8 = TQString( yyIdent ).endsWith( TQString("UTF8") ); - yyTok = getToken(); - return TRUE; - } else { - return FALSE; - } -} - -static void parse( MetaTranslator *tor, const char *initialContext, - const char *defaultContext ) -{ - TQMap qualifiedContexts; - TQCString context; - TQCString text; - TQCString com; - TQCString functionContext = initialContext; - TQCString prefix; - bool utf8 = FALSE; - - yyTok = getToken(); - while ( yyTok != Tok_Eof ) { - switch ( yyTok ) { - case Tok_class: - yyTok = getToken(); - functionContext = yyIdent; - yyTok = getToken(); - break; - case Tok_tr: - case Tok_trUtf8: - utf8 = ( yyTok == Tok_trUtf8 ); - yyTok = getToken(); - if ( match(Tok_LeftParen) && matchString(&text) ) { - com = ""; - if ( match(Tok_RightParen) || (match(Tok_Comma) && - matchString(&com) && match(Tok_RightParen)) ) { - if ( prefix.isNull() ) { - context = defaultContext; - } else if ( qstrcmp(prefix, "self") == 0 ) { - context = functionContext; - } else { - context = prefix; - } - prefix = (const char *) 0; - - if ( qualifiedContexts.contains(context) ) - context = qualifiedContexts[context]; - tor->insert( MetaTranslatorMessage(context, text, com, - TQString::null, utf8) ); - } - } - break; - case Tok_translate: - utf8 = FALSE; - yyTok = getToken(); - if ( match(Tok_LeftParen) && - matchString(&context) && - match(Tok_Comma) && - matchString(&text) ) { - com = ""; - if ( match(Tok_RightParen) || - (match(Tok_Comma) && - matchString(&com) && - (match(Tok_RightParen) || - match(Tok_Comma) && - matchEncoding(&utf8) && - match(Tok_RightParen))) ) - tor->insert( MetaTranslatorMessage(context, text, com, - TQString::null, utf8) ); - } - break; - case Tok_Ident: - if ( !prefix.isNull() ) - prefix += "."; - prefix += yyIdent; - yyTok = getToken(); - if ( yyTok != Tok_Dot ) - prefix = (const char *) 0; - break; - case Tok_Comment: - com = yyComment; - com = com.simplifyWhiteSpace(); - if ( com.left(sizeof(MagicComment) - 1) == MagicComment ) { - com.remove( 0, sizeof(MagicComment) - 1 ); - int k = com.find( ' ' ); - if ( k == -1 ) { - context = com; - } else { - context = com.left( k ); - com.remove( 0, k + 1 ); - tor->insert( MetaTranslatorMessage(context, "", com, - TQString::null, FALSE) ); - } - } - yyTok = getToken(); - break; - default: - yyTok = getToken(); - } - } - - if ( yyParenDepth != 0 ) - tqWarning( "%s: Unbalanced parentheses in Python code", - (const char *) yyFileName ); -} - -void fetchtr_py( const char *fileName, MetaTranslator *tor, - const char *defaultContext, bool mustExist ) -{ - yyInFile = fopen( fileName, "r" ); - if ( yyInFile == 0 ) { - if ( mustExist ) - tqWarning( "pylupdate error: cannot open Python source file '%s': %s", - fileName, strerror(errno) ); - return; - } - - startTokenizer( fileName, getCharFromFile, peekCharFromFile ); - parse( tor, 0, defaultContext ); - fclose( yyInFile ); -} diff --git a/pylupdate3/main.cpp b/pylupdate3/main.cpp deleted file mode 100644 index a3a0f3f..0000000 --- a/pylupdate3/main.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/********************************************************************** -** Copyright (C) 2002 Detlev Offenbach -** -** This is a modified version of lupdate. The original is part of TQt-Linguist. -** The copyright of the original file can be found below. -** -** This version is modified to handle python sources. -** -** The file is provided AS IS with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. -** -**********************************************************************/ - - -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** main.cpp -** -** This file is part of TQt Linguist. -** -** See the file LICENSE included in the distribution for the usage -** and distribution terms. -** -** The file is provided AS IS with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. -** -**********************************************************************/ - -#include -#include -#include -#include - -#include -#include -#include -#include - -// defined in fetchtr.cpp -extern void fetchtr_py( const char *fileName, MetaTranslator *tor, - const char *defaultContext, bool mustExist ); - -// defined in merge.cpp -extern void merge( MetaTranslator *tor, const MetaTranslator *virginTor, - bool verbose ); - -typedef TQValueList TML; - -static void printUsage() -{ - tqWarning( "Usage: pylupdate [options] file.pro...\n" - "Options:\n" - " -help Display this information and exits\n" - " -noobsolete\n" - " Drop all obsolete strings\n" - " -verbose\n" - " Explain what is being done\n" - " -version\n" - " Display the version of pylupdate and exits" ); -} - -int main( int argc, char **argv ) -{ - bool verbose = FALSE; - bool noObsolete = FALSE; - bool metSomething = FALSE; - int numProFiles = 0; - - for ( int i = 1; i < argc; i++ ) { - if ( qstrcmp(argv[i], "-help") == 0 ) { - printUsage(); - return 0; - } else if ( qstrcmp(argv[i], "-noobsolete") == 0 ) { - noObsolete = TRUE; - continue; - } else if ( qstrcmp(argv[i], "-verbose") == 0 ) { - verbose = TRUE; - continue; - } else if ( qstrcmp(argv[i], "-version") == 0 ) { - tqWarning( "pylupdate version %s", TQT_VERSION_STR ); - return 0; - } - - numProFiles++; - TQFile f( argv[i] ); - if ( !f.open(IO_ReadOnly) ) { - tqWarning( "pylupdate error: Cannot open project file '%s': %s", - argv[i], strerror(errno) ); - return 1; - } - - TQTextStream t( &f ); - TQString fullText = t.read(); - f.close(); - - MetaTranslator fetchedTor; - TQString defaultContext = "@default"; - TQCString codec; - TQStringList translatorFiles; - TQStringList::Iterator tf; - - TQMap tagMap = proFileTagMap( fullText ); - TQMap::Iterator it; - - for ( it = tagMap.begin(); it != tagMap.end(); ++it ) { - TQStringList toks = TQStringList::split( TQChar(' '), it.data() ); - TQStringList::Iterator t; - - for ( t = toks.begin(); t != toks.end(); ++t ) { - if ( it.key() == TQString("SOURCES") ) { - fetchtr_py( *t, &fetchedTor, - defaultContext, TRUE ); - metSomething = TRUE; - } else if ( it.key() == TQString("TRANSLATIONS") ) { - translatorFiles.append( *t ); - metSomething = TRUE; - } else if ( it.key() == TQString("CODEC") ) { - codec = (*t).utf8(); - } - } - } - - for ( tf = translatorFiles.begin(); tf != translatorFiles.end(); ++tf ) { - MetaTranslator tor; - tor.load( *tf ); - if ( !codec.isEmpty() ) - tor.setCodec( codec ); - if ( verbose ) - tqWarning( "Updating '%s'...", (*tf).utf8() ); - merge( &tor, &fetchedTor, verbose ); - if ( noObsolete ) - tor.stripObsoleteMessages(); - tor.stripEmptyContexts(); - if ( !tor.save(*tf) ) - tqWarning( "pylupdate error: Cannot save '%s': %s", (*tf).utf8(), - strerror(errno) ); - } - if ( !metSomething ) { - tqWarning( "pylupdate warning: File '%s' does not look like a project" - " file", argv[i] ); - } else if ( translatorFiles.isEmpty() ) { - tqWarning( "pylupdate warning: Met no 'TRANSLATIONS' entry in project" - " file '%s'", argv[i] ); - } - } - - if ( numProFiles == 0 ) { - printUsage(); - return 1; - } - return 0; -} diff --git a/pylupdate3/merge.cpp b/pylupdate3/merge.cpp deleted file mode 100644 index 8559830..0000000 --- a/pylupdate3/merge.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** merge.cpp -** -** This file is part of TQt Linguist. -** -** See the file LICENSE included in the distribution for the usage -** and distribution terms. -** -** The file is provided AS IS with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. -** -**********************************************************************/ - -#include - -// defined in numberh.cpp -extern void applyNumberHeuristic( MetaTranslator *tor, bool verbose ); -// defined in sametexth.cpp -extern void applySameTextHeuristic( MetaTranslator *tor, bool verbose ); - -typedef TQValueList TML; - -/* - Merges two MetaTranslator objects into the first one. The first one is a set - of source texts and translations for a previous version of the - internationalized program; the second one is a set of fresh source text newly - extracted from the source code, without any translation yet. -*/ - -void merge( MetaTranslator *tor, const MetaTranslator *virginTor, bool verbose ) -{ - int known = 0; - int neww = 0; - int obsoleted = 0; - TML all = tor->messages(); - TML::Iterator it; - - /* - The types of all the messages from the vernacular translator are updated - according to the virgin translator. - */ - for ( it = all.begin(); it != all.end(); ++it ) { - MetaTranslatorMessage::Type newType = MetaTranslatorMessage::Unfinished; - MetaTranslatorMessage m = *it; - - // skip context comment - if ( !TQCString((*it).sourceText()).isEmpty() ) { - if ( !virginTor->contains((*it).context(), (*it).sourceText(), - (*it).comment()) ) { - newType = MetaTranslatorMessage::Obsolete; - if ( m.type() != MetaTranslatorMessage::Obsolete ) - obsoleted++; - } else { - switch ( m.type() ) { - case MetaTranslatorMessage::Finished: - newType = MetaTranslatorMessage::Finished; - known++; - break; - case MetaTranslatorMessage::Unfinished: - newType = MetaTranslatorMessage::Unfinished; - known++; - break; - case MetaTranslatorMessage::Obsolete: - newType = MetaTranslatorMessage::Unfinished; - neww++; - } - } - - if ( newType != m.type() ) { - m.setType( newType ); - tor->insert( m ); - } - } - } - - /* - Messages found only in the virgin translator are added to the - vernacular translator. Among these are all the context comments. - */ - all = virginTor->messages(); - - for ( it = all.begin(); it != all.end(); ++it ) { - if ( !tor->contains((*it).context(), (*it).sourceText(), - (*it).comment()) ) { - tor->insert( *it ); - if ( !TQCString((*it).sourceText()).isEmpty() ) - neww++; - } - } - - /* - The same-text heuristic handles cases where a message has an - obsolete counterpart with a different context or comment. - */ - applySameTextHeuristic( tor, verbose ); - - /* - The number heuristic handles cases where a message has an - obsolete counterpart with mostly numbers differing in the - source text. - */ - applyNumberHeuristic( tor, verbose ); - - if ( verbose ) - tqWarning( " %d known, %d new and %d obsoleted messages", - known, neww, obsoleted ); -} diff --git a/pylupdate3/metatranslator.cpp b/pylupdate3/metatranslator.cpp deleted file mode 100644 index f46ee9a..0000000 --- a/pylupdate3/metatranslator.cpp +++ /dev/null @@ -1,557 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** metatranslator.cpp -** -** This file is part of TQt Linguist. -** -** See the file LICENSE included in the distribution for the usage -** and distribution terms. -** -** The file is provided AS IS with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. -** -**********************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "metatranslator.h" - -static bool encodingIsUtf8( const TQXmlAttributes& atts ) -{ - for ( int i = 0; i < atts.length(); i++ ) { - // utf8="true" is a pre-3.0 syntax - if ( atts.qName(i) == TQString("utf8") ) { - return ( atts.value(i) == TQString("true") ); - } else if ( atts.qName(i) == TQString("encoding") ) { - return ( atts.value(i) == TQString("UTF-8") ); - } - } - return FALSE; -} - -class TsHandler : public TQXmlDefaultHandler -{ -public: - TsHandler( MetaTranslator *translator ) - : tor( translator ), type( MetaTranslatorMessage::Finished ), - inMessage( FALSE ), ferrorCount( 0 ), contextIsUtf8( FALSE ), - messageIsUtf8( FALSE ) { } - - virtual bool startElement( const TQString& namespaceURI, - const TQString& localName, const TQString& qName, - const TQXmlAttributes& atts ); - virtual bool endElement( const TQString& namespaceURI, - const TQString& localName, const TQString& qName ); - virtual bool characters( const TQString& ch ); - virtual bool fatalError( const TQXmlParseException& exception ); - -private: - MetaTranslator *tor; - MetaTranslatorMessage::Type type; - bool inMessage; - TQString context; - TQString source; - TQString comment; - TQString translation; - - TQString accum; - int ferrorCount; - bool contextIsUtf8; - bool messageIsUtf8; -}; - -bool TsHandler::startElement( const TQString& /* namespaceURI */, - const TQString& /* localName */, - const TQString& qName, - const TQXmlAttributes& atts ) -{ - if ( qName == TQString("byte") ) { - for ( int i = 0; i < atts.length(); i++ ) { - if ( atts.qName(i) == TQString("value") ) { - TQString value = atts.value( i ); - int base = 10; - if ( value.startsWith("x") ) { - base = 16; - value = value.mid( 1 ); - } - int n = value.toUInt( 0, base ); - if ( n != 0 ) - accum += TQChar( n ); - } - } - } else { - if ( qName == TQString("context") ) { - context.truncate( 0 ); - source.truncate( 0 ); - comment.truncate( 0 ); - translation.truncate( 0 ); - contextIsUtf8 = encodingIsUtf8( atts ); - } else if ( qName == TQString("message") ) { - inMessage = TRUE; - type = MetaTranslatorMessage::Finished; - source.truncate( 0 ); - comment.truncate( 0 ); - translation.truncate( 0 ); - messageIsUtf8 = encodingIsUtf8( atts ); - } else if ( qName == TQString("translation") ) { - for ( int i = 0; i < atts.length(); i++ ) { - if ( atts.qName(i) == TQString("type") ) { - if ( atts.value(i) == TQString("unfinished") ) - type = MetaTranslatorMessage::Unfinished; - else if ( atts.value(i) == TQString("obsolete") ) - type = MetaTranslatorMessage::Obsolete; - else - type = MetaTranslatorMessage::Finished; - } - } - } - accum.truncate( 0 ); - } - return TRUE; -} - -bool TsHandler::endElement( const TQString& /* namespaceURI */, - const TQString& /* localName */, - const TQString& qName ) -{ - if ( qName == TQString("codec") || qName == TQString("defaultcodec") ) { - // "codec" is a pre-3.0 syntax - tor->setCodec( accum ); - } else if ( qName == TQString("name") ) { - context = accum; - } else if ( qName == TQString("source") ) { - source = accum; - } else if ( qName == TQString("comment") ) { - if ( inMessage ) { - comment = accum; - } else { - if ( contextIsUtf8 ) - tor->insert( MetaTranslatorMessage(context.utf8(), "", - accum.utf8(), TQString::null, TRUE, - MetaTranslatorMessage::Unfinished) ); - else - tor->insert( MetaTranslatorMessage(context.local8Bit(), "", - accum.local8Bit(), TQString::null, FALSE, - MetaTranslatorMessage::Unfinished) ); - } - } else if ( qName == TQString("translation") ) { - translation = accum; - } else if ( qName == TQString("message") ) { - if ( messageIsUtf8 ) - tor->insert( MetaTranslatorMessage(context.utf8(), source.utf8(), - comment.utf8(), translation, - TRUE, type) ); - else - tor->insert( MetaTranslatorMessage(context.local8Bit(), source.local8Bit(), - comment.local8Bit(), translation, - FALSE, type) ); - inMessage = FALSE; - } - return TRUE; -} - -bool TsHandler::characters( const TQString& ch ) -{ - TQString t = ch; - t.replace( TQRegExp(TQChar('\r')), "" ); - accum += t; - return TRUE; -} - -bool TsHandler::fatalError( const TQXmlParseException& exception ) -{ - if ( ferrorCount++ == 0 ) { - TQString msg; - msg.sprintf( "Parse error at line %d, column %d (%s).", - exception.lineNumber(), exception.columnNumber(), - exception.message().utf8() ); - if ( tqApp == 0 ) - tqWarning( "XML error: %s", msg.utf8() ); - else - TQMessageBox::information( tqApp->mainWidget(), - TQObject::tr("TQt Linguist"), msg ); - } - return FALSE; -} - -static TQString numericEntity( int ch ) -{ - return TQString( ch <= 0x20 ? "" : "&#x%1;" ) - .arg( ch, 0, 16 ); -} - -static TQString protect( const TQCString& str ) -{ - TQString result; - int len = (int) str.length(); - for ( int k = 0; k < len; k++ ) { - switch( str[k] ) { - case '\"': - result += TQString( """ ); - break; - case '&': - result += TQString( "&" ); - break; - case '>': - result += TQString( ">" ); - break; - case '<': - result += TQString( "<" ); - break; - case '\'': - result += TQString( "'" ); - break; - default: - if ( (uchar) str[k] < 0x20 && str[k] != '\n' ) - result += numericEntity( (uchar) str[k] ); - else - result += str[k]; - } - } - return result; -} - -static TQString evilBytes( const TQCString& str, bool utf8 ) -{ - if ( utf8 ) { - return protect( str ); - } else { - TQString result; - TQCString t = protect( str ).utf8(); - int len = (int) t.length(); - for ( int k = 0; k < len; k++ ) { - if ( (uchar) t[k] >= 0x7f ) - result += numericEntity( (uchar) t[k] ); - else - result += TQChar( t[k] ); - } - return result; - } -} - -MetaTranslatorMessage::MetaTranslatorMessage() - : utfeight( FALSE ), ty( Unfinished ) -{ -} - -MetaTranslatorMessage::MetaTranslatorMessage( const char *context, - const char *sourceText, - const char *comment, - const TQString& translation, - bool utf8, Type type ) - : TQTranslatorMessage( context, sourceText, comment, translation ), - utfeight( FALSE ), ty( type ) -{ - /* - Don't use UTF-8 if it makes no difference. UTF-8 should be - reserved for the real problematic case: non-ASCII (possibly - non-Latin-1) characters in .ui files. - */ - if ( utf8 ) { - if ( sourceText != 0 ) { - int i = 0; - while ( sourceText[i] != '\0' ) { - if ( (uchar) sourceText[i] >= 0x80 ) { - utfeight = TRUE; - break; - } - i++; - } - } - if ( !utfeight && comment != 0 ) { - int i = 0; - while ( comment[i] != '\0' ) { - if ( (uchar) comment[i] >= 0x80 ) { - utfeight = TRUE; - break; - } - i++; - } - } - } -} - -MetaTranslatorMessage::MetaTranslatorMessage( const MetaTranslatorMessage& m ) - : TQTranslatorMessage( m ), utfeight( m.utfeight ), ty( m.ty ) -{ -} - -MetaTranslatorMessage& MetaTranslatorMessage::operator=( - const MetaTranslatorMessage& m ) -{ - TQTranslatorMessage::operator=( m ); - utfeight = m.utfeight; - ty = m.ty; - return *this; -} - -bool MetaTranslatorMessage::operator==( const MetaTranslatorMessage& m ) const -{ - return qstrcmp( context(), m.context() ) == 0 && - qstrcmp( sourceText(), m.sourceText() ) == 0 && - qstrcmp( comment(), m.comment() ) == 0; -} - -bool MetaTranslatorMessage::operator<( const MetaTranslatorMessage& m ) const -{ - int delta = qstrcmp( context(), m.context() ); - if ( delta == 0 ) - delta = qstrcmp( sourceText(), m.sourceText() ); - if ( delta == 0 ) - delta = qstrcmp( comment(), m.comment() ); - return delta < 0; -} - -MetaTranslator::MetaTranslator() - : codecName( "ISO-8859-1" ), codec( 0 ) -{ -} - -MetaTranslator::MetaTranslator( const MetaTranslator& tor ) - : mm( tor.mm ), codecName( tor.codecName ), codec( tor.codec ) -{ - -} - -MetaTranslator& MetaTranslator::operator=( const MetaTranslator& tor ) -{ - mm = tor.mm; - codecName = tor.codecName; - codec = tor.codec; - return *this; -} - -bool MetaTranslator::load( const TQString& filename ) -{ - mm.clear(); - - TQFile f( filename ); - if ( !f.open(IO_ReadOnly) ) - return FALSE; - - TQTextStream t( &f ); - TQXmlInputSource in( t ); - TQXmlSimpleReader reader; - // don't click on these! - reader.setFeature( "http://xml.org/sax/features/namespaces", FALSE ); - reader.setFeature( "http://xml.org/sax/features/namespace-prefixes", TRUE ); - reader.setFeature( "http://trolltech.com/xml/features/report-whitespace" - "-only-CharData", FALSE ); - TQXmlDefaultHandler *hand = new TsHandler( this ); - reader.setContentHandler( hand ); - reader.setErrorHandler( hand ); - - bool ok = reader.parse( in ); - reader.setContentHandler( 0 ); - reader.setErrorHandler( 0 ); - delete hand; - f.close(); - if ( !ok ) - mm.clear(); - return ok; -} - -bool MetaTranslator::save( const TQString& filename ) const -{ - TQFile f( filename ); - if ( !f.open(IO_WriteOnly) ) - return FALSE; - - TQTextStream t( &f ); - t.setCodec( TQTextCodec::codecForName("ISO-8859-1") ); - - t << "\n"; - if ( codecName != "ISO-8859-1" ) - t << "" << codecName << "\n"; - TMM::ConstIterator m = mm.begin(); - while ( m != mm.end() ) { - TMMInv inv; - TMMInv::Iterator i; - bool contextIsUtf8 = m.key().utf8(); - TQCString context = m.key().context(); - TQCString comment = ""; - - do { - if ( TQCString(m.key().sourceText()).isEmpty() ) { - if ( m.key().type() != MetaTranslatorMessage::Obsolete ) { - contextIsUtf8 = m.key().utf8(); - comment = TQCString( m.key().comment() ); - } - } else { - inv.insert( *m, m.key() ); - } - } while ( ++m != mm.end() && TQCString(m.key().context()) == context ); - - t << "\n"; - t << " " << evilBytes( context, contextIsUtf8 ) - << "\n"; - if ( !comment.isEmpty() ) - t << " " << evilBytes( comment, contextIsUtf8 ) - << "\n"; - - for ( i = inv.begin(); i != inv.end(); ++i ) { - t << " \n" - << " " << evilBytes( (*i).sourceText(), - (*i).utf8() ) - << "\n"; - if ( !TQCString((*i).comment()).isEmpty() ) - t << " " << evilBytes( (*i).comment(), - (*i).utf8() ) - << "\n"; - t << " " << protect( (*i).translation().utf8() ) - << "\n"; - t << " \n"; - } - t << "\n"; - } - t << "\n"; - f.close(); - return TRUE; -} - -bool MetaTranslator::release( const TQString& filename, bool verbose ) const -{ - TQTranslator tor( 0 ); - int finished = 0; - int unfinished = 0; - int untranslated = 0; - TMM::ConstIterator m; - - for ( m = mm.begin(); m != mm.end(); ++m ) { - if ( m.key().type() != MetaTranslatorMessage::Obsolete ) { - if ( m.key().translation().isEmpty() ) { - untranslated++; - } else { - if ( m.key().type() == MetaTranslatorMessage::Unfinished ) - unfinished++; - else - finished++; - tor.insert( m.key() ); - } - } - } - - bool saved = tor.save( filename, TQTranslator::Stripped ); - if ( saved && verbose ) - tqWarning( " %d finished, %d unfinished and %d untranslated messages", - finished, unfinished, untranslated ); - - return saved; -} - -bool MetaTranslator::contains( const char *context, const char *sourceText, - const char *comment ) const -{ - return mm.find( MetaTranslatorMessage(context, sourceText, comment) ) != - mm.end(); -} - -void MetaTranslator::insert( const MetaTranslatorMessage& m ) -{ - int pos = mm.count(); - TMM::Iterator n = mm.find( m ); - if ( n != mm.end() ) - pos = *n; - mm.replace( m, pos ); -} - -void MetaTranslator::stripObsoleteMessages() -{ - TMM newmm; - - TMM::Iterator m = mm.begin(); - while ( m != mm.end() ) { - if ( m.key().type() != MetaTranslatorMessage::Obsolete ) - newmm.insert( m.key(), *m ); - ++m; - } - mm = newmm; -} - -void MetaTranslator::stripEmptyContexts() -{ - TMM newmm; - - TMM::Iterator m = mm.begin(); - while ( m != mm.end() ) { - if ( TQCString(m.key().sourceText()).isEmpty() ) { - TMM::Iterator n = m; - ++n; - // the context comment is followed by other messages - if ( n != newmm.end() && - qstrcmp(m.key().context(), n.key().context()) == 0 ) - newmm.insert( m.key(), *m ); - } else { - newmm.insert( m.key(), *m ); - } - ++m; - } - mm = newmm; -} - -void MetaTranslator::setCodec( const char *name ) -{ - const int latin1 = 4; - - codecName = name; - codec = TQTextCodec::codecForName( name ); - if ( codec == 0 || codec->mibEnum() == latin1 ) - codec = 0; -} - -TQString MetaTranslator::toUnicode( const char *str, bool utf8 ) const -{ - if ( utf8 ) - return TQString::fromUtf8( str ); - else if ( codec == 0 ) - return TQString( str ); - else - return codec->toUnicode( str ); -} - -TQValueList MetaTranslator::messages() const -{ - int n = mm.count(); - TMM::ConstIterator *t = new TMM::ConstIterator[n + 1]; - TMM::ConstIterator m; - for ( m = mm.begin(); m != mm.end(); ++m ) - t[*m] = m; - - TQValueList val; - for ( int i = 0; i < n; i++ ) - val.append( t[i].key() ); - - delete[] t; - return val; -} - -TQValueList MetaTranslator::translatedMessages() const -{ - TQValueList val; - TMM::ConstIterator m; - for ( m = mm.begin(); m != mm.end(); ++m ) { - if ( m.key().type() == MetaTranslatorMessage::Finished ) - val.append( m.key() ); - } - return val; -} diff --git a/pylupdate3/metatranslator.h b/pylupdate3/metatranslator.h deleted file mode 100644 index aab280f..0000000 --- a/pylupdate3/metatranslator.h +++ /dev/null @@ -1,95 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** metatranslator.h -** -** This file is part of TQt Linguist. -** -** See the file LICENSE included in the distribution for the usage -** and distribution terms. -** -** The file is provided AS IS with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. -** -**********************************************************************/ - -#ifndef METATRANSLATOR_H -#define METATRANSLATOR_H - -#include -#include -#include -#include - -class TQTextCodec; - -class MetaTranslatorMessage : public TQTranslatorMessage -{ -public: - enum Type { Unfinished, Finished, Obsolete }; - - MetaTranslatorMessage(); - MetaTranslatorMessage( const char *context, const char *sourceText, - const char *comment, - const TQString& translation = TQString::null, - bool utf8 = FALSE, Type type = Unfinished ); - MetaTranslatorMessage( const MetaTranslatorMessage& m ); - - MetaTranslatorMessage& operator=( const MetaTranslatorMessage& m ); - - void setType( Type nt ) { ty = nt; } - Type type() const { return ty; } - bool utf8() const { return utfeight; } - - bool operator==( const MetaTranslatorMessage& m ) const; - bool operator!=( const MetaTranslatorMessage& m ) const - { return !operator==( m ); } - bool operator<( const MetaTranslatorMessage& m ) const; - bool operator<=( const MetaTranslatorMessage& m ) - { return !operator>( m ); } - bool operator>( const MetaTranslatorMessage& m ) const - { return this->operator<( m ); } - bool operator>=( const MetaTranslatorMessage& m ) const - { return !operator<( m ); } - -private: - bool utfeight; - Type ty; -}; - -class MetaTranslator -{ -public: - MetaTranslator(); - MetaTranslator( const MetaTranslator& tor ); - - MetaTranslator& operator=( const MetaTranslator& tor ); - - bool load( const TQString& filename ); - bool save( const TQString& filename ) const; - bool release( const TQString& filename, bool verbose = FALSE ) const; - - bool contains( const char *context, const char *sourceText, - const char *comment ) const; - void insert( const MetaTranslatorMessage& m ); - - void stripObsoleteMessages(); - void stripEmptyContexts(); - - void setCodec( const char *name ); - TQString toUnicode( const char *str, bool utf8 ) const; - - TQValueList messages() const; - TQValueList translatedMessages() const; - -private: - typedef TQMap TMM; - typedef TQMap TMMInv; - - TMM mm; - TQCString codecName; - TQTextCodec *codec; -}; - -#endif diff --git a/pylupdate3/numberh.cpp b/pylupdate3/numberh.cpp deleted file mode 100644 index a52687b..0000000 --- a/pylupdate3/numberh.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** numberh.cpp -** -** This file is part of TQt Linguist. -** -** See the file LICENSE included in the distribution for the usage -** and distribution terms. -** -** The file is provided AS IS with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. -** -**********************************************************************/ - -#include -#include -#include -#include - -#include -#include - -typedef TQMap TMM; -typedef TQValueList TML; - -static bool isDigitFriendly( int c ) -{ - return ispunct( c ) || isspace( c ); -} - -static int numberLength( const char *s ) -{ - int i = 0; - - if ( isdigit(s[0]) ) { - do { - i++; - } while ( isdigit(s[i]) || - (isDigitFriendly(s[i]) && - (isdigit(s[i + 1]) || - (isDigitFriendly(s[i + 1]) && isdigit(s[i + 2])))) ); - } - return i; -} - -/* - Returns a version of 'key' where all numbers have been replaced by zeroes. If - there were none, returns "". -*/ -static TQCString zeroKey( const char *key ) -{ - TQCString zeroed( strlen(key) + 1 ); - char *z = zeroed.data(); - int i = 0, j = 0; - int len; - bool metSomething = FALSE; - - while ( key[i] != '\0' ) { - len = numberLength( key + i ); - if ( len > 0 ) { - i += len; - z[j++] = '0'; - metSomething = TRUE; - } else { - z[j++] = key[i++]; - } - } - z[j] = '\0'; - - if ( metSomething ) - return zeroed; - else - return ""; -} - -static TQString translationAttempt( const TQString& oldTranslation, - const char *oldSource, - const char *newSource ) -{ - int p = zeroKey( oldSource ).contains( '0' ); - int oldSourceLen = tqstrlen( oldSource ); - TQString attempt; - TQStringList oldNumbers; - TQStringList newNumbers; - TQMemArray met( p ); - TQMemArray matchedYet( p ); - int i, j; - int k = 0, ell, best; - int m, n; - int pass; - - /* - This algorithm is hard to follow, so we'll consider an example - all along: oldTranslation is "XeT 3.0", oldSource is "TeX 3.0" - and newSource is "XeT 3.1". - - First, we set up two tables: oldNumbers and newNumbers. In our - example, oldNumber[0] is "3.0" and newNumber[0] is "3.1". - */ - for ( i = 0, j = 0; i < oldSourceLen; i++, j++ ) { - m = numberLength( oldSource + i ); - n = numberLength( newSource + j ); - if ( m > 0 ) { - oldNumbers.append( TQCString(oldSource + i, m + 1) ); - newNumbers.append( TQCString(newSource + j, n + 1) ); - i += m; - j += n; - met[k] = FALSE; - matchedYet[k] = 0; - k++; - } - } - - /* - We now go over the old translation, "XeT 3.0", one letter at a - time, looking for numbers found in oldNumbers. Whenever such a - number is met, it is replaced with its newNumber equivalent. In - our example, the "3.0" of "XeT 3.0" becomes "3.1". - */ - for ( i = 0; i < (int) oldTranslation.length(); i++ ) { - attempt += oldTranslation[i]; - for ( k = 0; k < p; k++ ) { - if ( oldTranslation[i] == oldNumbers[k][matchedYet[k]] ) - matchedYet[k]++; - else - matchedYet[k] = 0; - } - - /* - Let's find out if the last character ended a match. We make - two passes over the data. In the first pass, we try to - match only numbers that weren't matched yet; if that fails, - the second pass does the trick. This is useful in some - suspicious cases, flagged below. - */ - for ( pass = 0; pass < 2; pass++ ) { - best = p; // an impossible value - for ( k = 0; k < p; k++ ) { - if ( (!met[k] || pass > 0) && - matchedYet[k] == (int) oldNumbers[k].length() && - numberLength(oldTranslation.utf8() + (i + 1) - - matchedYet[k]) == matchedYet[k] ) { - // the longer the better - if ( best == p || matchedYet[k] > matchedYet[best] ) - best = k; - } - } - if ( best != p ) { - attempt.truncate( attempt.length() - matchedYet[best] ); - attempt += newNumbers[best]; - met[best] = TRUE; - for ( k = 0; k < p; k++ ) - matchedYet[k] = 0; - break; - } - } - } - - /* - We flag two kinds of suspicious cases. They are identified as - such with comments such as "{2000?}" at the end. - - Example of the first kind: old source text "TeX 3.0" translated - as "XeT 2.0" is flagged "TeX 2.0 {3.0?}", no matter what the - new text is. - */ - for ( k = 0; k < p; k++ ) { - if ( !met[k] ) - attempt += TQString( " {" ) + newNumbers[k] + TQString( "?}" ); - } - - /* - Example of the second kind: "1 of 1" translated as "1 af 1", - with new source text "1 of 2", generates "1 af 2 {1 or 2?}" - because it's not clear which of "1 af 2" and "2 af 1" is right. - */ - for ( k = 0; k < p; k++ ) { - for ( ell = 0; ell < p; ell++ ) { - if ( k != ell && oldNumbers[k] == oldNumbers[ell] && - newNumbers[k] < newNumbers[ell] ) - attempt += TQString( " {" ) + newNumbers[k] + TQString( " or " ) + - newNumbers[ell] + TQString( "?}" ); - } - } - return attempt; -} - -/* - Augments a MetaTranslator with translations easily derived from - similar existing (probably obsolete) translations. - - For example, if "TeX 3.0" is translated as "XeT 3.0" and "TeX 3.1" - has no translation, "XeT 3.1" is added to the translator and is - marked Unfinished. -*/ -void applyNumberHeuristic( MetaTranslator *tor, bool verbose ) -{ - TMM translated, untranslated; - TMM::Iterator t, u; - TML all = tor->messages(); - TML::Iterator it; - int inserted = 0; - - for ( it = all.begin(); it != all.end(); ++it ) { - if ( (*it).type() == MetaTranslatorMessage::Unfinished ) { - if ( (*it).translation().isEmpty() ) - untranslated.insert( zeroKey((*it).sourceText()), *it ); - } else if ( !(*it).translation().isEmpty() ) { - translated.insert( zeroKey((*it).sourceText()), *it ); - } - } - - for ( u = untranslated.begin(); u != untranslated.end(); ++u ) { - t = translated.find( u.key() ); - if ( t != translated.end() && !t.key().isEmpty() && - qstrcmp((*t).sourceText(), (*u).sourceText()) != 0 ) { - MetaTranslatorMessage m( *u ); - m.setTranslation( translationAttempt((*t).translation(), - (*t).sourceText(), - (*u).sourceText()) ); - tor->insert( m ); - inserted++; - } - } - if ( verbose && inserted != 0 ) - tqWarning( " number heuristic provided %d translation%s", - inserted, inserted == 1 ? "" : "s" ); -} diff --git a/pylupdate3/proparser.cpp b/pylupdate3/proparser.cpp deleted file mode 100644 index 72256f3..0000000 --- a/pylupdate3/proparser.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** proparser.cpp -** -** This file is part of TQt Linguist. -** -** See the file LICENSE included in the distribution for the usage -** and distribution terms. -** -** The file is provided AS IS with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. -** -**********************************************************************/ - -#include -#include - -#include "proparser.h" - -TQMap proFileTagMap( const TQString& text ) -{ - TQString t = text; - - /* - Strip comments, merge lines ending with backslash, add - spaces around '=' and '+=', replace '\n' with ';', and - simplify white spaces. - */ - t.replace( TQRegExp(TQString("#[^\n]$")), TQString(" ") ); - t.replace( TQRegExp(TQString("\\\\\\s*\n")), TQString(" ") ); - t.replace( TQRegExp(TQString("=")), TQString(" = ") ); - t.replace( TQRegExp(TQString("\\+ =")), TQString(" += ") ); - t.replace( TQRegExp(TQString("\n")), TQString(";") ); - t = t.simplifyWhiteSpace(); - - TQMap tagMap; - - TQStringList lines = TQStringList::split( TQChar(';'), t ); - TQStringList::Iterator line; - for ( line = lines.begin(); line != lines.end(); ++line ) { - TQStringList toks = TQStringList::split( TQChar(' '), *line ); - - if ( toks.count() >= 3 && - (toks[1] == TQString("=") || toks[1] == TQString("+=")) ) { - TQString tag = toks.first(); - int k = tag.findRev( TQChar(':') ); // as in 'unix:' - if ( k != -1 ) - tag = tag.mid( k + 1 ); - toks.remove( toks.begin() ); - - TQString action = toks.first(); - toks.remove( toks.begin() ); - - if ( tagMap.contains(tag) ) { - if ( action == TQString("=") ) - tagMap.replace( tag, toks.join(TQChar(' ')) ); - else - tagMap[tag] += TQChar( ' ' ) + toks.join( TQChar(' ') ); - } else { - tagMap[tag] = toks.join( TQChar(' ') ); - } - } - } - - TQRegExp var( "\\$\\$[a-zA-Z0-9_]+" ); - TQMap::Iterator it; - for ( it = tagMap.begin(); it != tagMap.end(); ++it ) { - int i = 0; - - while ( (i = var.search(it.data(), i)) != -1 ) { - int len = var.matchedLength(); - (*it).replace( i, len, tagMap[(*it).mid(i + 2, len - 2)] ); - } - } - return tagMap; -} diff --git a/pylupdate3/proparser.h b/pylupdate3/proparser.h deleted file mode 100644 index 1cb7928..0000000 --- a/pylupdate3/proparser.h +++ /dev/null @@ -1,25 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** proparser.h -** -** This file is part of TQt Linguist. -** -** See the file LICENSE included in the distribution for the usage -** and distribution terms. -** -** The file is provided AS IS with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. -** -**********************************************************************/ - -#ifndef PROPARSER_H -#define PROPARSER_H - -#include -#include - -TQMap proFileTagMap( const TQString& text ); - -#endif diff --git a/pylupdate3/pylupdate-prof.sbf b/pylupdate3/pylupdate-prof.sbf deleted file mode 100644 index 2d74dfa..0000000 --- a/pylupdate3/pylupdate-prof.sbf +++ /dev/null @@ -1,24 +0,0 @@ -# This is the build file for pylupdate for TQt v3 Professional Edition. -# -# Copyright (c) 2007 -# Riverbank Computing Limited -# -# 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. - -target = pylupdate -sources = fetchtr.cpp main.cpp merge.cpp numberh.cpp sametexth.cpp metatranslator.cpp proparser.cpp qxml.cpp -headers = metatranslator.h proparser.h diff --git a/pylupdate3/pylupdate.pro.in b/pylupdate3/pylupdate.pro.in deleted file mode 100644 index 0a39857..0000000 --- a/pylupdate3/pylupdate.pro.in +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2002 -# Detlev Offenbach -# -# The project file pylupdate for TQt v3. - - -TEMPLATE = app -CONFIG += qt warn_on console release @PYQT_RBPROF@ -INCLUDEPATH = @BLX_INCLUDEPATH@ -DEFINES = QT_INTERNAL_XML @BLX_DEFINES@ - -DESTDIR = @PYQT_BINDIR@ -TARGET = pylupdate - -HEADERS = metatranslator.h \ - proparser.h - -SOURCES = fetchtr.cpp \ - main.cpp \ - merge.cpp \ - numberh.cpp \ - sametexth.cpp \ - metatranslator.cpp \ - proparser.cpp - -rbprof:exists($(TQTDIR)/src/qt_professional.pri) { - QT_SOURCE_TREE = $(TQTDIR) - include($(TQTDIR)/src/qt_professional.pri) -} diff --git a/pylupdate3/pylupdate.sbf b/pylupdate3/pylupdate.sbf deleted file mode 100644 index 248b7cb..0000000 --- a/pylupdate3/pylupdate.sbf +++ /dev/null @@ -1,24 +0,0 @@ -# This is the build file for pylupdate for TQt v3 Professional Edition. -# -# Copyright (c) 2007 -# Riverbank Computing Limited -# -# 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. - -target = pylupdate -sources = fetchtr.cpp main.cpp merge.cpp numberh.cpp sametexth.cpp metatranslator.cpp proparser.cpp -headers = metatranslator.h proparser.h diff --git a/pylupdate3/sametexth.cpp b/pylupdate3/sametexth.cpp deleted file mode 100644 index fd67a55..0000000 --- a/pylupdate3/sametexth.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** sametexth.cpp -** -** This file is part of TQt Linguist. -** -** See the file LICENSE included in the distribution for the usage -** and distribution terms. -** -** The file is provided AS IS with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. -** -**********************************************************************/ - -#include -#include - -#include - -typedef TQMap TMM; -typedef TQValueList TML; - -/* - Augments a MetaTranslator with trivially derived translations. - - For example, if "Enabled:" is consistendly translated as "Eingeschaltet:" no - matter the context or the comment, "Eingeschaltet:" is added as the - translation of any untranslated "Enabled:" text and is marked Unfinished. -*/ - -void applySameTextHeuristic( MetaTranslator *tor, bool verbose ) -{ - TMM translated, avoid; - TMM::Iterator t; - TML untranslated; - TML::Iterator u; - TML all = tor->messages(); - TML::Iterator it; - int inserted = 0; - - for ( it = all.begin(); it != all.end(); ++it ) { - if ( (*it).type() == MetaTranslatorMessage::Unfinished ) { - if ( (*it).translation().isEmpty() ) - untranslated.append( *it ); - } else { - TQCString key = (*it).sourceText(); - t = translated.find( key ); - if ( t != translated.end() ) { - /* - The same source text is translated at least two - different ways. Do nothing then. - */ - if ( (*t).translation() != (*it).translation() ) { - translated.remove( key ); - avoid.insert( key, *it ); - } - } else if ( !avoid.contains(key) ) { - translated.insert( key, *it ); - } - } - } - - for ( u = untranslated.begin(); u != untranslated.end(); ++u ) { - TQCString key = (*u).sourceText(); - t = translated.find( key ); - if ( t != translated.end() ) { - MetaTranslatorMessage m( *u ); - m.setTranslation( (*t).translation() ); - tor->insert( m ); - inserted++; - } - } - if ( verbose && inserted != 0 ) - tqWarning( " same-text heuristic provided %d translation%s", - inserted, inserted == 1 ? "" : "s" ); -} diff --git a/pyqtconfig.py.in b/pyqtconfig.py.in deleted file mode 100644 index b927751..0000000 --- a/pyqtconfig.py.in +++ /dev/null @@ -1,187 +0,0 @@ -# Copyright (c) 2007 -# Riverbank Computing Limited -# -# 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. -# -# This module is intended to be used by the configuration scripts of extension -# modules that %Import PyTQt modules. - - -import sip_tqt_config - - -# These are installation specific values created when PyTQt was configured. -# @SIP_CONFIGURATION@ - - -class Configuration(sip_tqt_config.Configuration): - """The class that represents PyTQt configuration values. - """ - def __init__(self, sub_cfg=None): - """Initialise an instance of the class. - - sub_cfg is the list of sub-class configurations. It should be None - when called normally. - """ - if sub_cfg: - cfg = sub_cfg - else: - cfg = [] - - cfg.append(_pkg_config) - - sip_tqt_config.Configuration.__init__(self, cfg) - - -class TQtModuleMakefile(sip_tqt_config.SIPModuleMakefile): - """The Makefile class for modules that %Import qt. - """ - def __init__(self, *args, **kw): - """Initialise an instance of a module Makefile. - """ - kw["qt"] = 1 - apply(sip_tqt_config.SIPModuleMakefile.__init__, (self, ) + args, kw) - - def finalise(self): - """Finalise the macros. - """ - if self.config.sip_version < 0x040000: - # Note that we don't use self.extra_lib_dirs because we don't want - # it to be added to the rpath. - self.LIBDIR.append(self.config.pyqt_mod_dir) - self.extra_libs.append(self.module_as_lib("qt")) - - sip_tqt_config.SIPModuleMakefile.finalise(self) - - -class TQtAxContainerModuleMakefile(TQtModuleMakefile): - """The Makefile class for modules that %Import qtaxcontainer. - """ - def finalise(self): - """Finalise the macros. - """ - if self.config.sip_version < 0x040000: - self.extra_libs.append(self.module_as_lib("qtaxcontainer")) - - TQtModuleMakefile.finalise(self) - - -class TQtCanvasModuleMakefile(TQtModuleMakefile): - """The Makefile class for modules that %Import qtcanvas. - """ - def finalise(self): - """Finalise the macros. - """ - if self.config.sip_version < 0x040000: - self.extra_libs.append(self.module_as_lib("qtcanvas")) - - TQtModuleMakefile.finalise(self) - - -class TQtExtModuleMakefile(TQtModuleMakefile): - """The Makefile class for modules that %Import qtext. - """ - def finalise(self): - """Finalise the macros. - """ - if self.config.sip_version < 0x040000: - self.extra_libs.append(self.module_as_lib("qtext")) - - self.extra_defines.extend(self.config._pyqt_qscintilla_defines) - self.extra_include_dirs.append(self.config._pyqt_qscintilla_inc_dir) - self.extra_lib_dirs.append(self.config._pyqt_qscintilla_lib_dir) - self.extra_libs.append("tqscintilla") - - TQtModuleMakefile.finalise(self) - - -class TQtGLModuleMakefile(TQtModuleMakefile): - """The Makefile class for modules that %Import qtgl. - """ - def __init__(self, *args, **kw): - """Initialise an instance of a module Makefile. - """ - kw["opengl"] = 1 - apply(TQtModuleMakefile.__init__, (self, ) + args, kw) - - def finalise(self): - """Finalise the macros. - """ - if self.config.sip_version < 0x040000: - self.extra_libs.append(self.module_as_lib("qtgl")) - - TQtModuleMakefile.finalise(self) - - -class TQtNetworkModuleMakefile(TQtModuleMakefile): - """The Makefile class for modules that %Import qtnetwork. - """ - def finalise(self): - """Finalise the macros. - """ - if self.config.sip_version < 0x040000: - self.extra_libs.append(self.module_as_lib("qtnetwork")) - - TQtModuleMakefile.finalise(self) - - -class TQtTableModuleMakefile(TQtModuleMakefile): - """The Makefile class for modules that %Import qttable. - """ - def finalise(self): - """Finalise the macros. - """ - if self.config.sip_version < 0x040000: - self.extra_libs.append(self.module_as_lib("qttable")) - - TQtModuleMakefile.finalise(self) - - -class TQtSQLModuleMakefile(TQtTableModuleMakefile): - """The Makefile class for modules that %Import qtsql. - """ - def finalise(self): - """Finalise the macros. - """ - if self.config.sip_version < 0x040000: - self.extra_libs.append(self.module_as_lib("qtsql")) - - TQtTableModuleMakefile.finalise(self) - - -class TQtUIModuleMakefile(TQtModuleMakefile): - """The Makefile class for modules that %Import qtui. - """ - def finalise(self): - """Finalise the macros. - """ - if self.config.sip_version < 0x040000: - self.extra_libs.append(self.module_as_lib("qtui")) - - TQtModuleMakefile.finalise(self) - - -class TQtXMLModuleMakefile(TQtModuleMakefile): - """The Makefile class for modules that %Import qtxml. - """ - def finalise(self): - """Finalise the macros. - """ - if self.config.sip_version < 0x040000: - self.extra_libs.append(self.module_as_lib("qtxml")) - - TQtModuleMakefile.finalise(self) diff --git a/pytqlupdate3/LICENSE.GPL b/pytqlupdate3/LICENSE.GPL new file mode 100644 index 0000000..c7aea18 --- /dev/null +++ b/pytqlupdate3/LICENSE.GPL @@ -0,0 +1,280 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/pytqlupdate3/fetchtr.cpp b/pytqlupdate3/fetchtr.cpp new file mode 100644 index 0000000..4fe5bc5 --- /dev/null +++ b/pytqlupdate3/fetchtr.cpp @@ -0,0 +1,455 @@ +/********************************************************************** +** Copyright (C) 2002 Detlev Offenbach +** +** This is a modified version of lupdate. The original is part of TQt-Linguist. +** The copyright of the original file can be found below. +** +** This version is modified to handle python sources. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + + +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** fetchtr.cpp +** +** This file is part of TQt Linguist. +** +** See the file LICENSE included in the distribution for the usage +** and distribution terms. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +/*#include */ + + +static const char MagicComment[] = "TRANSLATOR "; + +static TQMap needs_Q_OBJECT; +static TQMap lacks_Q_OBJECT; + +/* + The first part of this source file is the python tokenizer. We skip + most of python; the only tokens that interest us are defined here. +*/ + +enum { Tok_Eof, Tok_class, Tok_return, Tok_tr, + Tok_trUtf8, Tok_translate, Tok_Ident, + Tok_Comment, Tok_Dot, Tok_String, + Tok_LeftParen, Tok_RightParen, + Tok_Comma}; + +/* + The tokenizer maintains the following global variables. The names + should be self-explanatory. +*/ +static TQCString yyFileName; +static int yyCh; +static char yyIdent[128]; +static size_t yyIdentLen; +static char yyComment[65536]; +static size_t yyCommentLen; +static char yyString[16384]; +static size_t yyStringLen; +static int yyParenDepth; +static int yyLineNo; +static int yyCurLineNo; + +// the file to read from (if reading from a file) +static FILE *yyInFile; + +// the string to read from and current position in the string (otherwise) +static TQString yyInStr; +static int yyInPos; +static int buf; + +static int (*getChar)(); +static int (*peekChar)(); + +static int getCharFromFile() +{ + int c; + + if ( buf < 0 ) + c = getc( yyInFile ); + else { + c = buf; + buf = -1; + } + if ( c == '\n' ) + yyCurLineNo++; + return c; +} + +static int peekCharFromFile() +{ + int c = getc( yyInFile ); + buf = c; + return c; +} + +static void startTokenizer( const char *fileName, int (*getCharFunc)(), + int (*peekCharFunc)() ) +{ + yyInPos = 0; + buf = -1; + getChar = getCharFunc; + peekChar = peekCharFunc; + + yyFileName = fileName; + yyCh = getChar(); + yyParenDepth = 0; + yyCurLineNo = 1; +} + +static int getToken() +{ + const char tab[] = "abfnrtv"; + const char backTab[] = "\a\b\f\n\r\t\v"; + uint n; + + yyIdentLen = 0; + yyCommentLen = 0; + yyStringLen = 0; + + while ( yyCh != EOF ) { + yyLineNo = yyCurLineNo; + + if ( isalpha(yyCh) || yyCh == '_' ) { + do { + if ( yyIdentLen < sizeof(yyIdent) - 1 ) + yyIdent[yyIdentLen++] = (char) yyCh; + yyCh = getChar(); + } while ( isalnum(yyCh) || yyCh == '_' ); + yyIdent[yyIdentLen] = '\0'; + + switch ( yyIdent[0] ) { + case 'Q': + if ( strcmp(yyIdent + 1, "T_TR_NOOP") == 0 ) { + return Tok_tr; + } else if ( strcmp(yyIdent + 1, "T_TRANSLATE_NOOP") == 0 ) { + return Tok_translate; + } + break; + case 'c': + if ( strcmp(yyIdent + 1, "lass") == 0 ) + return Tok_class; + break; + case 'r': + if ( strcmp(yyIdent + 1, "eturn") == 0 ) + return Tok_return; + break; + case 't': + if ( strcmp(yyIdent + 1, "r") == 0 ) + return Tok_tr; + else if ( strcmp(yyIdent + 1, "rUtf8") == 0 ) + return Tok_trUtf8; + else if ( strcmp(yyIdent + 1, "ranslate") == 0 ) + return Tok_translate; + case '_': + if ( strcmp(yyIdent + 1, "_tr") == 0 ) + return Tok_tr; + else if ( strcmp(yyIdent + 1, "_trUtf8") == 0 ) + return Tok_trUtf8; + } + return Tok_Ident; + } else { + switch ( yyCh ) { + case '#': + yyCh = getChar(); + do { + yyCh = getChar(); + } while ( yyCh != EOF && yyCh != '\n' ); + break; + case '"': + case '\'': + int quoteChar; + int trippelQuote, singleQuote; + int in; + + quoteChar = yyCh; + trippelQuote = 0; + singleQuote = 1; + in = 0; + yyCh = getChar(); + + while ( yyCh != EOF ) { + if ( singleQuote && (yyCh == '\n' || (in && yyCh == quoteChar)) ) + break; + + if ( yyCh == quoteChar ) { + if (peekChar() == quoteChar) { + yyCh = getChar(); + if (!trippelQuote) { + trippelQuote = 1; + singleQuote = 0; + in = 1; + yyCh = getChar(); + } else { + yyCh = getChar(); + if (yyCh == quoteChar) { + trippelQuote = 0; + break; + } + } + } else if (trippelQuote) { + if ( yyStringLen < sizeof(yyString) - 1 ) + yyString[yyStringLen++] = (char) yyCh; + yyCh = getChar(); + continue; + } else + break; + } else + in = 1; + + if ( yyCh == '\\' ) { + yyCh = getChar(); + + if ( yyCh == 'x' ) { + TQCString hex = "0"; + + yyCh = getChar(); + while ( isxdigit(yyCh) ) { + hex += (char) yyCh; + yyCh = getChar(); + } + sscanf( hex, "%x", &n ); + if ( yyStringLen < sizeof(yyString) - 1 ) + yyString[yyStringLen++] = (char) n; + } else if ( yyCh >= '0' && yyCh < '8' ) { + TQCString oct = ""; + + do { + oct += (char) yyCh; + yyCh = getChar(); + } while ( yyCh >= '0' && yyCh < '8' ); + sscanf( oct, "%o", &n ); + if ( yyStringLen < sizeof(yyString) - 1 ) + yyString[yyStringLen++] = (char) n; + } else { + const char *p = strchr( tab, yyCh ); + if ( yyStringLen < sizeof(yyString) - 1 ) + yyString[yyStringLen++] = ( p == 0 ) ? + (char) yyCh : backTab[p - tab]; + yyCh = getChar(); + } + } else { + if ( yyStringLen < sizeof(yyString) - 1 ) + yyString[yyStringLen++] = (char) yyCh; + yyCh = getChar(); + } + } + yyString[yyStringLen] = '\0'; + + if ( yyCh != quoteChar ) { + printf("%c\n", yyCh); + tqWarning( "%s:%d: Unterminated string", + (const char *) yyFileName, yyLineNo ); + } + + if ( yyCh == EOF ) { + return Tok_Eof; + } else { + yyCh = getChar(); + return Tok_String; + } + break; + case '(': + yyParenDepth++; + yyCh = getChar(); + return Tok_LeftParen; + case ')': + yyParenDepth--; + yyCh = getChar(); + return Tok_RightParen; + case ',': + yyCh = getChar(); + return Tok_Comma; + case '.': + yyCh = getChar(); + return Tok_Dot; + default: + yyCh = getChar(); + } + } + } + return Tok_Eof; +} + +/* + The second part of this source file is the parser. It accomplishes + a very easy task: It finds all strings inside a tr() or translate() + call, and possibly finds out the context of the call. It supports + three cases: + (1) the context is specified, as in FunnyDialog.tr("Hello") or + translate("FunnyDialog", "Hello"); + (2) the call appears within an inlined function; + (3) the call appears within a function defined outside the class definition. +*/ + +static int yyTok; + +static bool match( int t ) +{ + bool matches = ( yyTok == t ); + if ( matches ) + yyTok = getToken(); + return matches; +} + +static bool matchString( TQCString *s ) +{ + bool matches = ( yyTok == Tok_String ); + *s = ""; + while ( yyTok == Tok_String ) { + *s += yyString; + yyTok = getToken(); + } + return matches; +} + +static bool matchEncoding( bool *utf8 ) +{ + if ( yyTok == Tok_Ident ) { + if ( strcmp(yyIdent, "TQApplication") == 0 ) { + yyTok = getToken(); + } + *utf8 = TQString( yyIdent ).endsWith( TQString("UTF8") ); + yyTok = getToken(); + return TRUE; + } else { + return FALSE; + } +} + +static void parse( MetaTranslator *tor, const char *initialContext, + const char *defaultContext ) +{ + TQMap qualifiedContexts; + TQCString context; + TQCString text; + TQCString com; + TQCString functionContext = initialContext; + TQCString prefix; + bool utf8 = FALSE; + + yyTok = getToken(); + while ( yyTok != Tok_Eof ) { + switch ( yyTok ) { + case Tok_class: + yyTok = getToken(); + functionContext = yyIdent; + yyTok = getToken(); + break; + case Tok_tr: + case Tok_trUtf8: + utf8 = ( yyTok == Tok_trUtf8 ); + yyTok = getToken(); + if ( match(Tok_LeftParen) && matchString(&text) ) { + com = ""; + if ( match(Tok_RightParen) || (match(Tok_Comma) && + matchString(&com) && match(Tok_RightParen)) ) { + if ( prefix.isNull() ) { + context = defaultContext; + } else if ( qstrcmp(prefix, "self") == 0 ) { + context = functionContext; + } else { + context = prefix; + } + prefix = (const char *) 0; + + if ( qualifiedContexts.contains(context) ) + context = qualifiedContexts[context]; + tor->insert( MetaTranslatorMessage(context, text, com, + TQString::null, utf8) ); + } + } + break; + case Tok_translate: + utf8 = FALSE; + yyTok = getToken(); + if ( match(Tok_LeftParen) && + matchString(&context) && + match(Tok_Comma) && + matchString(&text) ) { + com = ""; + if ( match(Tok_RightParen) || + (match(Tok_Comma) && + matchString(&com) && + (match(Tok_RightParen) || + match(Tok_Comma) && + matchEncoding(&utf8) && + match(Tok_RightParen))) ) + tor->insert( MetaTranslatorMessage(context, text, com, + TQString::null, utf8) ); + } + break; + case Tok_Ident: + if ( !prefix.isNull() ) + prefix += "."; + prefix += yyIdent; + yyTok = getToken(); + if ( yyTok != Tok_Dot ) + prefix = (const char *) 0; + break; + case Tok_Comment: + com = yyComment; + com = com.simplifyWhiteSpace(); + if ( com.left(sizeof(MagicComment) - 1) == MagicComment ) { + com.remove( 0, sizeof(MagicComment) - 1 ); + int k = com.find( ' ' ); + if ( k == -1 ) { + context = com; + } else { + context = com.left( k ); + com.remove( 0, k + 1 ); + tor->insert( MetaTranslatorMessage(context, "", com, + TQString::null, FALSE) ); + } + } + yyTok = getToken(); + break; + default: + yyTok = getToken(); + } + } + + if ( yyParenDepth != 0 ) + tqWarning( "%s: Unbalanced parentheses in Python code", + (const char *) yyFileName ); +} + +void fetchtr_py( const char *fileName, MetaTranslator *tor, + const char *defaultContext, bool mustExist ) +{ + yyInFile = fopen( fileName, "r" ); + if ( yyInFile == 0 ) { + if ( mustExist ) + tqWarning( "pytqlupdate error: cannot open Python source file '%s': %s", + fileName, strerror(errno) ); + return; + } + + startTokenizer( fileName, getCharFromFile, peekCharFromFile ); + parse( tor, 0, defaultContext ); + fclose( yyInFile ); +} diff --git a/pytqlupdate3/main.cpp b/pytqlupdate3/main.cpp new file mode 100644 index 0000000..6c708fe --- /dev/null +++ b/pytqlupdate3/main.cpp @@ -0,0 +1,155 @@ +/********************************************************************** +** Copyright (C) 2002 Detlev Offenbach +** +** This is a modified version of lupdate. The original is part of TQt-Linguist. +** The copyright of the original file can be found below. +** +** This version is modified to handle python sources. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + + +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** main.cpp +** +** This file is part of TQt Linguist. +** +** See the file LICENSE included in the distribution for the usage +** and distribution terms. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#include +#include +#include +#include + +#include +#include +#include +#include + +// defined in fetchtr.cpp +extern void fetchtr_py( const char *fileName, MetaTranslator *tor, + const char *defaultContext, bool mustExist ); + +// defined in merge.cpp +extern void merge( MetaTranslator *tor, const MetaTranslator *virginTor, + bool verbose ); + +typedef TQValueList TML; + +static void printUsage() +{ + tqWarning( "Usage: pytqlupdate [options] file.pro...\n" + "Options:\n" + " -help Display this information and exits\n" + " -noobsolete\n" + " Drop all obsolete strings\n" + " -verbose\n" + " Explain what is being done\n" + " -version\n" + " Display the version of pytqlupdate and exits" ); +} + +int main( int argc, char **argv ) +{ + bool verbose = FALSE; + bool noObsolete = FALSE; + bool metSomething = FALSE; + int numProFiles = 0; + + for ( int i = 1; i < argc; i++ ) { + if ( qstrcmp(argv[i], "-help") == 0 ) { + printUsage(); + return 0; + } else if ( qstrcmp(argv[i], "-noobsolete") == 0 ) { + noObsolete = TRUE; + continue; + } else if ( qstrcmp(argv[i], "-verbose") == 0 ) { + verbose = TRUE; + continue; + } else if ( qstrcmp(argv[i], "-version") == 0 ) { + tqWarning( "pytqlupdate version %s", TQT_VERSION_STR ); + return 0; + } + + numProFiles++; + TQFile f( argv[i] ); + if ( !f.open(IO_ReadOnly) ) { + tqWarning( "pytqlupdate error: Cannot open project file '%s': %s", + argv[i], strerror(errno) ); + return 1; + } + + TQTextStream t( &f ); + TQString fullText = t.read(); + f.close(); + + MetaTranslator fetchedTor; + TQString defaultContext = "@default"; + TQCString codec; + TQStringList translatorFiles; + TQStringList::Iterator tf; + + TQMap tagMap = proFileTagMap( fullText ); + TQMap::Iterator it; + + for ( it = tagMap.begin(); it != tagMap.end(); ++it ) { + TQStringList toks = TQStringList::split( TQChar(' '), it.data() ); + TQStringList::Iterator t; + + for ( t = toks.begin(); t != toks.end(); ++t ) { + if ( it.key() == TQString("SOURCES") ) { + fetchtr_py( *t, &fetchedTor, + defaultContext, TRUE ); + metSomething = TRUE; + } else if ( it.key() == TQString("TRANSLATIONS") ) { + translatorFiles.append( *t ); + metSomething = TRUE; + } else if ( it.key() == TQString("CODEC") ) { + codec = (*t).utf8(); + } + } + } + + for ( tf = translatorFiles.begin(); tf != translatorFiles.end(); ++tf ) { + MetaTranslator tor; + tor.load( *tf ); + if ( !codec.isEmpty() ) + tor.setCodec( codec ); + if ( verbose ) + tqWarning( "Updating '%s'...", (*tf).utf8() ); + merge( &tor, &fetchedTor, verbose ); + if ( noObsolete ) + tor.stripObsoleteMessages(); + tor.stripEmptyContexts(); + if ( !tor.save(*tf) ) + tqWarning( "pytqlupdate error: Cannot save '%s': %s", (*tf).utf8(), + strerror(errno) ); + } + if ( !metSomething ) { + tqWarning( "pytqlupdate warning: File '%s' does not look like a project" + " file", argv[i] ); + } else if ( translatorFiles.isEmpty() ) { + tqWarning( "pytqlupdate warning: Met no 'TRANSLATIONS' entry in project" + " file '%s'", argv[i] ); + } + } + + if ( numProFiles == 0 ) { + printUsage(); + return 1; + } + return 0; +} diff --git a/pytqlupdate3/merge.cpp b/pytqlupdate3/merge.cpp new file mode 100644 index 0000000..8559830 --- /dev/null +++ b/pytqlupdate3/merge.cpp @@ -0,0 +1,110 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** merge.cpp +** +** This file is part of TQt Linguist. +** +** See the file LICENSE included in the distribution for the usage +** and distribution terms. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#include + +// defined in numberh.cpp +extern void applyNumberHeuristic( MetaTranslator *tor, bool verbose ); +// defined in sametexth.cpp +extern void applySameTextHeuristic( MetaTranslator *tor, bool verbose ); + +typedef TQValueList TML; + +/* + Merges two MetaTranslator objects into the first one. The first one is a set + of source texts and translations for a previous version of the + internationalized program; the second one is a set of fresh source text newly + extracted from the source code, without any translation yet. +*/ + +void merge( MetaTranslator *tor, const MetaTranslator *virginTor, bool verbose ) +{ + int known = 0; + int neww = 0; + int obsoleted = 0; + TML all = tor->messages(); + TML::Iterator it; + + /* + The types of all the messages from the vernacular translator are updated + according to the virgin translator. + */ + for ( it = all.begin(); it != all.end(); ++it ) { + MetaTranslatorMessage::Type newType = MetaTranslatorMessage::Unfinished; + MetaTranslatorMessage m = *it; + + // skip context comment + if ( !TQCString((*it).sourceText()).isEmpty() ) { + if ( !virginTor->contains((*it).context(), (*it).sourceText(), + (*it).comment()) ) { + newType = MetaTranslatorMessage::Obsolete; + if ( m.type() != MetaTranslatorMessage::Obsolete ) + obsoleted++; + } else { + switch ( m.type() ) { + case MetaTranslatorMessage::Finished: + newType = MetaTranslatorMessage::Finished; + known++; + break; + case MetaTranslatorMessage::Unfinished: + newType = MetaTranslatorMessage::Unfinished; + known++; + break; + case MetaTranslatorMessage::Obsolete: + newType = MetaTranslatorMessage::Unfinished; + neww++; + } + } + + if ( newType != m.type() ) { + m.setType( newType ); + tor->insert( m ); + } + } + } + + /* + Messages found only in the virgin translator are added to the + vernacular translator. Among these are all the context comments. + */ + all = virginTor->messages(); + + for ( it = all.begin(); it != all.end(); ++it ) { + if ( !tor->contains((*it).context(), (*it).sourceText(), + (*it).comment()) ) { + tor->insert( *it ); + if ( !TQCString((*it).sourceText()).isEmpty() ) + neww++; + } + } + + /* + The same-text heuristic handles cases where a message has an + obsolete counterpart with a different context or comment. + */ + applySameTextHeuristic( tor, verbose ); + + /* + The number heuristic handles cases where a message has an + obsolete counterpart with mostly numbers differing in the + source text. + */ + applyNumberHeuristic( tor, verbose ); + + if ( verbose ) + tqWarning( " %d known, %d new and %d obsoleted messages", + known, neww, obsoleted ); +} diff --git a/pytqlupdate3/metatranslator.cpp b/pytqlupdate3/metatranslator.cpp new file mode 100644 index 0000000..f46ee9a --- /dev/null +++ b/pytqlupdate3/metatranslator.cpp @@ -0,0 +1,557 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** metatranslator.cpp +** +** This file is part of TQt Linguist. +** +** See the file LICENSE included in the distribution for the usage +** and distribution terms. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "metatranslator.h" + +static bool encodingIsUtf8( const TQXmlAttributes& atts ) +{ + for ( int i = 0; i < atts.length(); i++ ) { + // utf8="true" is a pre-3.0 syntax + if ( atts.qName(i) == TQString("utf8") ) { + return ( atts.value(i) == TQString("true") ); + } else if ( atts.qName(i) == TQString("encoding") ) { + return ( atts.value(i) == TQString("UTF-8") ); + } + } + return FALSE; +} + +class TsHandler : public TQXmlDefaultHandler +{ +public: + TsHandler( MetaTranslator *translator ) + : tor( translator ), type( MetaTranslatorMessage::Finished ), + inMessage( FALSE ), ferrorCount( 0 ), contextIsUtf8( FALSE ), + messageIsUtf8( FALSE ) { } + + virtual bool startElement( const TQString& namespaceURI, + const TQString& localName, const TQString& qName, + const TQXmlAttributes& atts ); + virtual bool endElement( const TQString& namespaceURI, + const TQString& localName, const TQString& qName ); + virtual bool characters( const TQString& ch ); + virtual bool fatalError( const TQXmlParseException& exception ); + +private: + MetaTranslator *tor; + MetaTranslatorMessage::Type type; + bool inMessage; + TQString context; + TQString source; + TQString comment; + TQString translation; + + TQString accum; + int ferrorCount; + bool contextIsUtf8; + bool messageIsUtf8; +}; + +bool TsHandler::startElement( const TQString& /* namespaceURI */, + const TQString& /* localName */, + const TQString& qName, + const TQXmlAttributes& atts ) +{ + if ( qName == TQString("byte") ) { + for ( int i = 0; i < atts.length(); i++ ) { + if ( atts.qName(i) == TQString("value") ) { + TQString value = atts.value( i ); + int base = 10; + if ( value.startsWith("x") ) { + base = 16; + value = value.mid( 1 ); + } + int n = value.toUInt( 0, base ); + if ( n != 0 ) + accum += TQChar( n ); + } + } + } else { + if ( qName == TQString("context") ) { + context.truncate( 0 ); + source.truncate( 0 ); + comment.truncate( 0 ); + translation.truncate( 0 ); + contextIsUtf8 = encodingIsUtf8( atts ); + } else if ( qName == TQString("message") ) { + inMessage = TRUE; + type = MetaTranslatorMessage::Finished; + source.truncate( 0 ); + comment.truncate( 0 ); + translation.truncate( 0 ); + messageIsUtf8 = encodingIsUtf8( atts ); + } else if ( qName == TQString("translation") ) { + for ( int i = 0; i < atts.length(); i++ ) { + if ( atts.qName(i) == TQString("type") ) { + if ( atts.value(i) == TQString("unfinished") ) + type = MetaTranslatorMessage::Unfinished; + else if ( atts.value(i) == TQString("obsolete") ) + type = MetaTranslatorMessage::Obsolete; + else + type = MetaTranslatorMessage::Finished; + } + } + } + accum.truncate( 0 ); + } + return TRUE; +} + +bool TsHandler::endElement( const TQString& /* namespaceURI */, + const TQString& /* localName */, + const TQString& qName ) +{ + if ( qName == TQString("codec") || qName == TQString("defaultcodec") ) { + // "codec" is a pre-3.0 syntax + tor->setCodec( accum ); + } else if ( qName == TQString("name") ) { + context = accum; + } else if ( qName == TQString("source") ) { + source = accum; + } else if ( qName == TQString("comment") ) { + if ( inMessage ) { + comment = accum; + } else { + if ( contextIsUtf8 ) + tor->insert( MetaTranslatorMessage(context.utf8(), "", + accum.utf8(), TQString::null, TRUE, + MetaTranslatorMessage::Unfinished) ); + else + tor->insert( MetaTranslatorMessage(context.local8Bit(), "", + accum.local8Bit(), TQString::null, FALSE, + MetaTranslatorMessage::Unfinished) ); + } + } else if ( qName == TQString("translation") ) { + translation = accum; + } else if ( qName == TQString("message") ) { + if ( messageIsUtf8 ) + tor->insert( MetaTranslatorMessage(context.utf8(), source.utf8(), + comment.utf8(), translation, + TRUE, type) ); + else + tor->insert( MetaTranslatorMessage(context.local8Bit(), source.local8Bit(), + comment.local8Bit(), translation, + FALSE, type) ); + inMessage = FALSE; + } + return TRUE; +} + +bool TsHandler::characters( const TQString& ch ) +{ + TQString t = ch; + t.replace( TQRegExp(TQChar('\r')), "" ); + accum += t; + return TRUE; +} + +bool TsHandler::fatalError( const TQXmlParseException& exception ) +{ + if ( ferrorCount++ == 0 ) { + TQString msg; + msg.sprintf( "Parse error at line %d, column %d (%s).", + exception.lineNumber(), exception.columnNumber(), + exception.message().utf8() ); + if ( tqApp == 0 ) + tqWarning( "XML error: %s", msg.utf8() ); + else + TQMessageBox::information( tqApp->mainWidget(), + TQObject::tr("TQt Linguist"), msg ); + } + return FALSE; +} + +static TQString numericEntity( int ch ) +{ + return TQString( ch <= 0x20 ? "" : "&#x%1;" ) + .arg( ch, 0, 16 ); +} + +static TQString protect( const TQCString& str ) +{ + TQString result; + int len = (int) str.length(); + for ( int k = 0; k < len; k++ ) { + switch( str[k] ) { + case '\"': + result += TQString( """ ); + break; + case '&': + result += TQString( "&" ); + break; + case '>': + result += TQString( ">" ); + break; + case '<': + result += TQString( "<" ); + break; + case '\'': + result += TQString( "'" ); + break; + default: + if ( (uchar) str[k] < 0x20 && str[k] != '\n' ) + result += numericEntity( (uchar) str[k] ); + else + result += str[k]; + } + } + return result; +} + +static TQString evilBytes( const TQCString& str, bool utf8 ) +{ + if ( utf8 ) { + return protect( str ); + } else { + TQString result; + TQCString t = protect( str ).utf8(); + int len = (int) t.length(); + for ( int k = 0; k < len; k++ ) { + if ( (uchar) t[k] >= 0x7f ) + result += numericEntity( (uchar) t[k] ); + else + result += TQChar( t[k] ); + } + return result; + } +} + +MetaTranslatorMessage::MetaTranslatorMessage() + : utfeight( FALSE ), ty( Unfinished ) +{ +} + +MetaTranslatorMessage::MetaTranslatorMessage( const char *context, + const char *sourceText, + const char *comment, + const TQString& translation, + bool utf8, Type type ) + : TQTranslatorMessage( context, sourceText, comment, translation ), + utfeight( FALSE ), ty( type ) +{ + /* + Don't use UTF-8 if it makes no difference. UTF-8 should be + reserved for the real problematic case: non-ASCII (possibly + non-Latin-1) characters in .ui files. + */ + if ( utf8 ) { + if ( sourceText != 0 ) { + int i = 0; + while ( sourceText[i] != '\0' ) { + if ( (uchar) sourceText[i] >= 0x80 ) { + utfeight = TRUE; + break; + } + i++; + } + } + if ( !utfeight && comment != 0 ) { + int i = 0; + while ( comment[i] != '\0' ) { + if ( (uchar) comment[i] >= 0x80 ) { + utfeight = TRUE; + break; + } + i++; + } + } + } +} + +MetaTranslatorMessage::MetaTranslatorMessage( const MetaTranslatorMessage& m ) + : TQTranslatorMessage( m ), utfeight( m.utfeight ), ty( m.ty ) +{ +} + +MetaTranslatorMessage& MetaTranslatorMessage::operator=( + const MetaTranslatorMessage& m ) +{ + TQTranslatorMessage::operator=( m ); + utfeight = m.utfeight; + ty = m.ty; + return *this; +} + +bool MetaTranslatorMessage::operator==( const MetaTranslatorMessage& m ) const +{ + return qstrcmp( context(), m.context() ) == 0 && + qstrcmp( sourceText(), m.sourceText() ) == 0 && + qstrcmp( comment(), m.comment() ) == 0; +} + +bool MetaTranslatorMessage::operator<( const MetaTranslatorMessage& m ) const +{ + int delta = qstrcmp( context(), m.context() ); + if ( delta == 0 ) + delta = qstrcmp( sourceText(), m.sourceText() ); + if ( delta == 0 ) + delta = qstrcmp( comment(), m.comment() ); + return delta < 0; +} + +MetaTranslator::MetaTranslator() + : codecName( "ISO-8859-1" ), codec( 0 ) +{ +} + +MetaTranslator::MetaTranslator( const MetaTranslator& tor ) + : mm( tor.mm ), codecName( tor.codecName ), codec( tor.codec ) +{ + +} + +MetaTranslator& MetaTranslator::operator=( const MetaTranslator& tor ) +{ + mm = tor.mm; + codecName = tor.codecName; + codec = tor.codec; + return *this; +} + +bool MetaTranslator::load( const TQString& filename ) +{ + mm.clear(); + + TQFile f( filename ); + if ( !f.open(IO_ReadOnly) ) + return FALSE; + + TQTextStream t( &f ); + TQXmlInputSource in( t ); + TQXmlSimpleReader reader; + // don't click on these! + reader.setFeature( "http://xml.org/sax/features/namespaces", FALSE ); + reader.setFeature( "http://xml.org/sax/features/namespace-prefixes", TRUE ); + reader.setFeature( "http://trolltech.com/xml/features/report-whitespace" + "-only-CharData", FALSE ); + TQXmlDefaultHandler *hand = new TsHandler( this ); + reader.setContentHandler( hand ); + reader.setErrorHandler( hand ); + + bool ok = reader.parse( in ); + reader.setContentHandler( 0 ); + reader.setErrorHandler( 0 ); + delete hand; + f.close(); + if ( !ok ) + mm.clear(); + return ok; +} + +bool MetaTranslator::save( const TQString& filename ) const +{ + TQFile f( filename ); + if ( !f.open(IO_WriteOnly) ) + return FALSE; + + TQTextStream t( &f ); + t.setCodec( TQTextCodec::codecForName("ISO-8859-1") ); + + t << "\n"; + if ( codecName != "ISO-8859-1" ) + t << "" << codecName << "\n"; + TMM::ConstIterator m = mm.begin(); + while ( m != mm.end() ) { + TMMInv inv; + TMMInv::Iterator i; + bool contextIsUtf8 = m.key().utf8(); + TQCString context = m.key().context(); + TQCString comment = ""; + + do { + if ( TQCString(m.key().sourceText()).isEmpty() ) { + if ( m.key().type() != MetaTranslatorMessage::Obsolete ) { + contextIsUtf8 = m.key().utf8(); + comment = TQCString( m.key().comment() ); + } + } else { + inv.insert( *m, m.key() ); + } + } while ( ++m != mm.end() && TQCString(m.key().context()) == context ); + + t << "\n"; + t << " " << evilBytes( context, contextIsUtf8 ) + << "\n"; + if ( !comment.isEmpty() ) + t << " " << evilBytes( comment, contextIsUtf8 ) + << "\n"; + + for ( i = inv.begin(); i != inv.end(); ++i ) { + t << " \n" + << " " << evilBytes( (*i).sourceText(), + (*i).utf8() ) + << "\n"; + if ( !TQCString((*i).comment()).isEmpty() ) + t << " " << evilBytes( (*i).comment(), + (*i).utf8() ) + << "\n"; + t << " " << protect( (*i).translation().utf8() ) + << "\n"; + t << " \n"; + } + t << "\n"; + } + t << "\n"; + f.close(); + return TRUE; +} + +bool MetaTranslator::release( const TQString& filename, bool verbose ) const +{ + TQTranslator tor( 0 ); + int finished = 0; + int unfinished = 0; + int untranslated = 0; + TMM::ConstIterator m; + + for ( m = mm.begin(); m != mm.end(); ++m ) { + if ( m.key().type() != MetaTranslatorMessage::Obsolete ) { + if ( m.key().translation().isEmpty() ) { + untranslated++; + } else { + if ( m.key().type() == MetaTranslatorMessage::Unfinished ) + unfinished++; + else + finished++; + tor.insert( m.key() ); + } + } + } + + bool saved = tor.save( filename, TQTranslator::Stripped ); + if ( saved && verbose ) + tqWarning( " %d finished, %d unfinished and %d untranslated messages", + finished, unfinished, untranslated ); + + return saved; +} + +bool MetaTranslator::contains( const char *context, const char *sourceText, + const char *comment ) const +{ + return mm.find( MetaTranslatorMessage(context, sourceText, comment) ) != + mm.end(); +} + +void MetaTranslator::insert( const MetaTranslatorMessage& m ) +{ + int pos = mm.count(); + TMM::Iterator n = mm.find( m ); + if ( n != mm.end() ) + pos = *n; + mm.replace( m, pos ); +} + +void MetaTranslator::stripObsoleteMessages() +{ + TMM newmm; + + TMM::Iterator m = mm.begin(); + while ( m != mm.end() ) { + if ( m.key().type() != MetaTranslatorMessage::Obsolete ) + newmm.insert( m.key(), *m ); + ++m; + } + mm = newmm; +} + +void MetaTranslator::stripEmptyContexts() +{ + TMM newmm; + + TMM::Iterator m = mm.begin(); + while ( m != mm.end() ) { + if ( TQCString(m.key().sourceText()).isEmpty() ) { + TMM::Iterator n = m; + ++n; + // the context comment is followed by other messages + if ( n != newmm.end() && + qstrcmp(m.key().context(), n.key().context()) == 0 ) + newmm.insert( m.key(), *m ); + } else { + newmm.insert( m.key(), *m ); + } + ++m; + } + mm = newmm; +} + +void MetaTranslator::setCodec( const char *name ) +{ + const int latin1 = 4; + + codecName = name; + codec = TQTextCodec::codecForName( name ); + if ( codec == 0 || codec->mibEnum() == latin1 ) + codec = 0; +} + +TQString MetaTranslator::toUnicode( const char *str, bool utf8 ) const +{ + if ( utf8 ) + return TQString::fromUtf8( str ); + else if ( codec == 0 ) + return TQString( str ); + else + return codec->toUnicode( str ); +} + +TQValueList MetaTranslator::messages() const +{ + int n = mm.count(); + TMM::ConstIterator *t = new TMM::ConstIterator[n + 1]; + TMM::ConstIterator m; + for ( m = mm.begin(); m != mm.end(); ++m ) + t[*m] = m; + + TQValueList val; + for ( int i = 0; i < n; i++ ) + val.append( t[i].key() ); + + delete[] t; + return val; +} + +TQValueList MetaTranslator::translatedMessages() const +{ + TQValueList val; + TMM::ConstIterator m; + for ( m = mm.begin(); m != mm.end(); ++m ) { + if ( m.key().type() == MetaTranslatorMessage::Finished ) + val.append( m.key() ); + } + return val; +} diff --git a/pytqlupdate3/metatranslator.h b/pytqlupdate3/metatranslator.h new file mode 100644 index 0000000..aab280f --- /dev/null +++ b/pytqlupdate3/metatranslator.h @@ -0,0 +1,95 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** metatranslator.h +** +** This file is part of TQt Linguist. +** +** See the file LICENSE included in the distribution for the usage +** and distribution terms. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#ifndef METATRANSLATOR_H +#define METATRANSLATOR_H + +#include +#include +#include +#include + +class TQTextCodec; + +class MetaTranslatorMessage : public TQTranslatorMessage +{ +public: + enum Type { Unfinished, Finished, Obsolete }; + + MetaTranslatorMessage(); + MetaTranslatorMessage( const char *context, const char *sourceText, + const char *comment, + const TQString& translation = TQString::null, + bool utf8 = FALSE, Type type = Unfinished ); + MetaTranslatorMessage( const MetaTranslatorMessage& m ); + + MetaTranslatorMessage& operator=( const MetaTranslatorMessage& m ); + + void setType( Type nt ) { ty = nt; } + Type type() const { return ty; } + bool utf8() const { return utfeight; } + + bool operator==( const MetaTranslatorMessage& m ) const; + bool operator!=( const MetaTranslatorMessage& m ) const + { return !operator==( m ); } + bool operator<( const MetaTranslatorMessage& m ) const; + bool operator<=( const MetaTranslatorMessage& m ) + { return !operator>( m ); } + bool operator>( const MetaTranslatorMessage& m ) const + { return this->operator<( m ); } + bool operator>=( const MetaTranslatorMessage& m ) const + { return !operator<( m ); } + +private: + bool utfeight; + Type ty; +}; + +class MetaTranslator +{ +public: + MetaTranslator(); + MetaTranslator( const MetaTranslator& tor ); + + MetaTranslator& operator=( const MetaTranslator& tor ); + + bool load( const TQString& filename ); + bool save( const TQString& filename ) const; + bool release( const TQString& filename, bool verbose = FALSE ) const; + + bool contains( const char *context, const char *sourceText, + const char *comment ) const; + void insert( const MetaTranslatorMessage& m ); + + void stripObsoleteMessages(); + void stripEmptyContexts(); + + void setCodec( const char *name ); + TQString toUnicode( const char *str, bool utf8 ) const; + + TQValueList messages() const; + TQValueList translatedMessages() const; + +private: + typedef TQMap TMM; + typedef TQMap TMMInv; + + TMM mm; + TQCString codecName; + TQTextCodec *codec; +}; + +#endif diff --git a/pytqlupdate3/numberh.cpp b/pytqlupdate3/numberh.cpp new file mode 100644 index 0000000..a52687b --- /dev/null +++ b/pytqlupdate3/numberh.cpp @@ -0,0 +1,230 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** numberh.cpp +** +** This file is part of TQt Linguist. +** +** See the file LICENSE included in the distribution for the usage +** and distribution terms. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#include +#include +#include +#include + +#include +#include + +typedef TQMap TMM; +typedef TQValueList TML; + +static bool isDigitFriendly( int c ) +{ + return ispunct( c ) || isspace( c ); +} + +static int numberLength( const char *s ) +{ + int i = 0; + + if ( isdigit(s[0]) ) { + do { + i++; + } while ( isdigit(s[i]) || + (isDigitFriendly(s[i]) && + (isdigit(s[i + 1]) || + (isDigitFriendly(s[i + 1]) && isdigit(s[i + 2])))) ); + } + return i; +} + +/* + Returns a version of 'key' where all numbers have been replaced by zeroes. If + there were none, returns "". +*/ +static TQCString zeroKey( const char *key ) +{ + TQCString zeroed( strlen(key) + 1 ); + char *z = zeroed.data(); + int i = 0, j = 0; + int len; + bool metSomething = FALSE; + + while ( key[i] != '\0' ) { + len = numberLength( key + i ); + if ( len > 0 ) { + i += len; + z[j++] = '0'; + metSomething = TRUE; + } else { + z[j++] = key[i++]; + } + } + z[j] = '\0'; + + if ( metSomething ) + return zeroed; + else + return ""; +} + +static TQString translationAttempt( const TQString& oldTranslation, + const char *oldSource, + const char *newSource ) +{ + int p = zeroKey( oldSource ).contains( '0' ); + int oldSourceLen = tqstrlen( oldSource ); + TQString attempt; + TQStringList oldNumbers; + TQStringList newNumbers; + TQMemArray met( p ); + TQMemArray matchedYet( p ); + int i, j; + int k = 0, ell, best; + int m, n; + int pass; + + /* + This algorithm is hard to follow, so we'll consider an example + all along: oldTranslation is "XeT 3.0", oldSource is "TeX 3.0" + and newSource is "XeT 3.1". + + First, we set up two tables: oldNumbers and newNumbers. In our + example, oldNumber[0] is "3.0" and newNumber[0] is "3.1". + */ + for ( i = 0, j = 0; i < oldSourceLen; i++, j++ ) { + m = numberLength( oldSource + i ); + n = numberLength( newSource + j ); + if ( m > 0 ) { + oldNumbers.append( TQCString(oldSource + i, m + 1) ); + newNumbers.append( TQCString(newSource + j, n + 1) ); + i += m; + j += n; + met[k] = FALSE; + matchedYet[k] = 0; + k++; + } + } + + /* + We now go over the old translation, "XeT 3.0", one letter at a + time, looking for numbers found in oldNumbers. Whenever such a + number is met, it is replaced with its newNumber equivalent. In + our example, the "3.0" of "XeT 3.0" becomes "3.1". + */ + for ( i = 0; i < (int) oldTranslation.length(); i++ ) { + attempt += oldTranslation[i]; + for ( k = 0; k < p; k++ ) { + if ( oldTranslation[i] == oldNumbers[k][matchedYet[k]] ) + matchedYet[k]++; + else + matchedYet[k] = 0; + } + + /* + Let's find out if the last character ended a match. We make + two passes over the data. In the first pass, we try to + match only numbers that weren't matched yet; if that fails, + the second pass does the trick. This is useful in some + suspicious cases, flagged below. + */ + for ( pass = 0; pass < 2; pass++ ) { + best = p; // an impossible value + for ( k = 0; k < p; k++ ) { + if ( (!met[k] || pass > 0) && + matchedYet[k] == (int) oldNumbers[k].length() && + numberLength(oldTranslation.utf8() + (i + 1) - + matchedYet[k]) == matchedYet[k] ) { + // the longer the better + if ( best == p || matchedYet[k] > matchedYet[best] ) + best = k; + } + } + if ( best != p ) { + attempt.truncate( attempt.length() - matchedYet[best] ); + attempt += newNumbers[best]; + met[best] = TRUE; + for ( k = 0; k < p; k++ ) + matchedYet[k] = 0; + break; + } + } + } + + /* + We flag two kinds of suspicious cases. They are identified as + such with comments such as "{2000?}" at the end. + + Example of the first kind: old source text "TeX 3.0" translated + as "XeT 2.0" is flagged "TeX 2.0 {3.0?}", no matter what the + new text is. + */ + for ( k = 0; k < p; k++ ) { + if ( !met[k] ) + attempt += TQString( " {" ) + newNumbers[k] + TQString( "?}" ); + } + + /* + Example of the second kind: "1 of 1" translated as "1 af 1", + with new source text "1 of 2", generates "1 af 2 {1 or 2?}" + because it's not clear which of "1 af 2" and "2 af 1" is right. + */ + for ( k = 0; k < p; k++ ) { + for ( ell = 0; ell < p; ell++ ) { + if ( k != ell && oldNumbers[k] == oldNumbers[ell] && + newNumbers[k] < newNumbers[ell] ) + attempt += TQString( " {" ) + newNumbers[k] + TQString( " or " ) + + newNumbers[ell] + TQString( "?}" ); + } + } + return attempt; +} + +/* + Augments a MetaTranslator with translations easily derived from + similar existing (probably obsolete) translations. + + For example, if "TeX 3.0" is translated as "XeT 3.0" and "TeX 3.1" + has no translation, "XeT 3.1" is added to the translator and is + marked Unfinished. +*/ +void applyNumberHeuristic( MetaTranslator *tor, bool verbose ) +{ + TMM translated, untranslated; + TMM::Iterator t, u; + TML all = tor->messages(); + TML::Iterator it; + int inserted = 0; + + for ( it = all.begin(); it != all.end(); ++it ) { + if ( (*it).type() == MetaTranslatorMessage::Unfinished ) { + if ( (*it).translation().isEmpty() ) + untranslated.insert( zeroKey((*it).sourceText()), *it ); + } else if ( !(*it).translation().isEmpty() ) { + translated.insert( zeroKey((*it).sourceText()), *it ); + } + } + + for ( u = untranslated.begin(); u != untranslated.end(); ++u ) { + t = translated.find( u.key() ); + if ( t != translated.end() && !t.key().isEmpty() && + qstrcmp((*t).sourceText(), (*u).sourceText()) != 0 ) { + MetaTranslatorMessage m( *u ); + m.setTranslation( translationAttempt((*t).translation(), + (*t).sourceText(), + (*u).sourceText()) ); + tor->insert( m ); + inserted++; + } + } + if ( verbose && inserted != 0 ) + tqWarning( " number heuristic provided %d translation%s", + inserted, inserted == 1 ? "" : "s" ); +} diff --git a/pytqlupdate3/proparser.cpp b/pytqlupdate3/proparser.cpp new file mode 100644 index 0000000..72256f3 --- /dev/null +++ b/pytqlupdate3/proparser.cpp @@ -0,0 +1,78 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** proparser.cpp +** +** This file is part of TQt Linguist. +** +** See the file LICENSE included in the distribution for the usage +** and distribution terms. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#include +#include + +#include "proparser.h" + +TQMap proFileTagMap( const TQString& text ) +{ + TQString t = text; + + /* + Strip comments, merge lines ending with backslash, add + spaces around '=' and '+=', replace '\n' with ';', and + simplify white spaces. + */ + t.replace( TQRegExp(TQString("#[^\n]$")), TQString(" ") ); + t.replace( TQRegExp(TQString("\\\\\\s*\n")), TQString(" ") ); + t.replace( TQRegExp(TQString("=")), TQString(" = ") ); + t.replace( TQRegExp(TQString("\\+ =")), TQString(" += ") ); + t.replace( TQRegExp(TQString("\n")), TQString(";") ); + t = t.simplifyWhiteSpace(); + + TQMap tagMap; + + TQStringList lines = TQStringList::split( TQChar(';'), t ); + TQStringList::Iterator line; + for ( line = lines.begin(); line != lines.end(); ++line ) { + TQStringList toks = TQStringList::split( TQChar(' '), *line ); + + if ( toks.count() >= 3 && + (toks[1] == TQString("=") || toks[1] == TQString("+=")) ) { + TQString tag = toks.first(); + int k = tag.findRev( TQChar(':') ); // as in 'unix:' + if ( k != -1 ) + tag = tag.mid( k + 1 ); + toks.remove( toks.begin() ); + + TQString action = toks.first(); + toks.remove( toks.begin() ); + + if ( tagMap.contains(tag) ) { + if ( action == TQString("=") ) + tagMap.replace( tag, toks.join(TQChar(' ')) ); + else + tagMap[tag] += TQChar( ' ' ) + toks.join( TQChar(' ') ); + } else { + tagMap[tag] = toks.join( TQChar(' ') ); + } + } + } + + TQRegExp var( "\\$\\$[a-zA-Z0-9_]+" ); + TQMap::Iterator it; + for ( it = tagMap.begin(); it != tagMap.end(); ++it ) { + int i = 0; + + while ( (i = var.search(it.data(), i)) != -1 ) { + int len = var.matchedLength(); + (*it).replace( i, len, tagMap[(*it).mid(i + 2, len - 2)] ); + } + } + return tagMap; +} diff --git a/pytqlupdate3/proparser.h b/pytqlupdate3/proparser.h new file mode 100644 index 0000000..1cb7928 --- /dev/null +++ b/pytqlupdate3/proparser.h @@ -0,0 +1,25 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** proparser.h +** +** This file is part of TQt Linguist. +** +** See the file LICENSE included in the distribution for the usage +** and distribution terms. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#ifndef PROPARSER_H +#define PROPARSER_H + +#include +#include + +TQMap proFileTagMap( const TQString& text ); + +#endif diff --git a/pytqlupdate3/pytqlupdate-prof.sbf b/pytqlupdate3/pytqlupdate-prof.sbf new file mode 100644 index 0000000..2acf080 --- /dev/null +++ b/pytqlupdate3/pytqlupdate-prof.sbf @@ -0,0 +1,24 @@ +# This is the build file for pytqlupdate for TQt v3 Professional Edition. +# +# Copyright (c) 2007 +# Riverbank Computing Limited +# +# 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. + +target = pytqlupdate +sources = fetchtr.cpp main.cpp merge.cpp numberh.cpp sametexth.cpp metatranslator.cpp proparser.cpp qxml.cpp +headers = metatranslator.h proparser.h diff --git a/pytqlupdate3/pytqlupdate.pro.in b/pytqlupdate3/pytqlupdate.pro.in new file mode 100644 index 0000000..9dc855a --- /dev/null +++ b/pytqlupdate3/pytqlupdate.pro.in @@ -0,0 +1,29 @@ +# Copyright (c) 2002 +# Detlev Offenbach +# +# The project file pytqlupdate for TQt v3. + + +TEMPLATE = app +CONFIG += tqt warn_on console release @PYTQT_RBPROF@ +INCLUDEPATH = @BLX_INCLUDEPATH@ +DEFINES = TQT_INTERNAL_XML @BLX_DEFINES@ + +DESTDIR = @PYTQT_BINDIR@ +TARGET = pytqlupdate + +HEADERS = metatranslator.h \ + proparser.h + +SOURCES = fetchtr.cpp \ + main.cpp \ + merge.cpp \ + numberh.cpp \ + sametexth.cpp \ + metatranslator.cpp \ + proparser.cpp + +rbprof:exists($(TQTDIR)/src/qt_professional.pri) { + TQT_SOURCE_TREE = $(TQTDIR) + include($(TQTDIR)/src/qt_professional.pri) +} diff --git a/pytqlupdate3/pytqlupdate.sbf b/pytqlupdate3/pytqlupdate.sbf new file mode 100644 index 0000000..d97edd6 --- /dev/null +++ b/pytqlupdate3/pytqlupdate.sbf @@ -0,0 +1,24 @@ +# This is the build file for pytqlupdate for TQt v3 Professional Edition. +# +# Copyright (c) 2007 +# Riverbank Computing Limited +# +# 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. + +target = pytqlupdate +sources = fetchtr.cpp main.cpp merge.cpp numberh.cpp sametexth.cpp metatranslator.cpp proparser.cpp +headers = metatranslator.h proparser.h diff --git a/pytqlupdate3/sametexth.cpp b/pytqlupdate3/sametexth.cpp new file mode 100644 index 0000000..fd67a55 --- /dev/null +++ b/pytqlupdate3/sametexth.cpp @@ -0,0 +1,78 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** sametexth.cpp +** +** This file is part of TQt Linguist. +** +** See the file LICENSE included in the distribution for the usage +** and distribution terms. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#include +#include + +#include + +typedef TQMap TMM; +typedef TQValueList TML; + +/* + Augments a MetaTranslator with trivially derived translations. + + For example, if "Enabled:" is consistendly translated as "Eingeschaltet:" no + matter the context or the comment, "Eingeschaltet:" is added as the + translation of any untranslated "Enabled:" text and is marked Unfinished. +*/ + +void applySameTextHeuristic( MetaTranslator *tor, bool verbose ) +{ + TMM translated, avoid; + TMM::Iterator t; + TML untranslated; + TML::Iterator u; + TML all = tor->messages(); + TML::Iterator it; + int inserted = 0; + + for ( it = all.begin(); it != all.end(); ++it ) { + if ( (*it).type() == MetaTranslatorMessage::Unfinished ) { + if ( (*it).translation().isEmpty() ) + untranslated.append( *it ); + } else { + TQCString key = (*it).sourceText(); + t = translated.find( key ); + if ( t != translated.end() ) { + /* + The same source text is translated at least two + different ways. Do nothing then. + */ + if ( (*t).translation() != (*it).translation() ) { + translated.remove( key ); + avoid.insert( key, *it ); + } + } else if ( !avoid.contains(key) ) { + translated.insert( key, *it ); + } + } + } + + for ( u = untranslated.begin(); u != untranslated.end(); ++u ) { + TQCString key = (*u).sourceText(); + t = translated.find( key ); + if ( t != translated.end() ) { + MetaTranslatorMessage m( *u ); + m.setTranslation( (*t).translation() ); + tor->insert( m ); + inserted++; + } + } + if ( verbose && inserted != 0 ) + tqWarning( " same-text heuristic provided %d translation%s", + inserted, inserted == 1 ? "" : "s" ); +} diff --git a/pytqtconfig.py.in b/pytqtconfig.py.in new file mode 100644 index 0000000..bc725e2 --- /dev/null +++ b/pytqtconfig.py.in @@ -0,0 +1,187 @@ +# Copyright (c) 2007 +# Riverbank Computing Limited +# +# 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. +# +# This module is intended to be used by the configuration scripts of extension +# modules that %Import PyTQt modules. + + +import sip_tqt_config + + +# These are installation specific values created when PyTQt was configured. +# @SIP_CONFIGURATION@ + + +class Configuration(sip_tqt_config.Configuration): + """The class that represents PyTQt configuration values. + """ + def __init__(self, sub_cfg=None): + """Initialise an instance of the class. + + sub_cfg is the list of sub-class configurations. It should be None + when called normally. + """ + if sub_cfg: + cfg = sub_cfg + else: + cfg = [] + + cfg.append(_pkg_config) + + sip_tqt_config.Configuration.__init__(self, cfg) + + +class TQtModuleMakefile(sip_tqt_config.SIPModuleMakefile): + """The Makefile class for modules that %Import tqt. + """ + def __init__(self, *args, **kw): + """Initialise an instance of a module Makefile. + """ + kw["tqt"] = 1 + apply(sip_tqt_config.SIPModuleMakefile.__init__, (self, ) + args, kw) + + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + # Note that we don't use self.extra_lib_dirs because we don't want + # it to be added to the rpath. + self.LIBDIR.append(self.config.pytqt_mod_dir) + self.extra_libs.append(self.module_as_lib("tqt")) + + sip_tqt_config.SIPModuleMakefile.finalise(self) + + +class TQtAxContainerModuleMakefile(TQtModuleMakefile): + """The Makefile class for modules that %Import tqtaxcontainer. + """ + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + self.extra_libs.append(self.module_as_lib("tqtaxcontainer")) + + TQtModuleMakefile.finalise(self) + + +class TQtCanvasModuleMakefile(TQtModuleMakefile): + """The Makefile class for modules that %Import tqtcanvas. + """ + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + self.extra_libs.append(self.module_as_lib("tqtcanvas")) + + TQtModuleMakefile.finalise(self) + + +class TQtExtModuleMakefile(TQtModuleMakefile): + """The Makefile class for modules that %Import tqtext. + """ + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + self.extra_libs.append(self.module_as_lib("tqtext")) + + self.extra_defines.extend(self.config._pytqt_tqscintilla_defines) + self.extra_include_dirs.append(self.config._pytqt_tqscintilla_inc_dir) + self.extra_lib_dirs.append(self.config._pytqt_tqscintilla_lib_dir) + self.extra_libs.append("tqscintilla") + + TQtModuleMakefile.finalise(self) + + +class TQtGLModuleMakefile(TQtModuleMakefile): + """The Makefile class for modules that %Import tqtgl. + """ + def __init__(self, *args, **kw): + """Initialise an instance of a module Makefile. + """ + kw["opengl"] = 1 + apply(TQtModuleMakefile.__init__, (self, ) + args, kw) + + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + self.extra_libs.append(self.module_as_lib("tqtgl")) + + TQtModuleMakefile.finalise(self) + + +class TQtNetworkModuleMakefile(TQtModuleMakefile): + """The Makefile class for modules that %Import tqtnetwork. + """ + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + self.extra_libs.append(self.module_as_lib("tqtnetwork")) + + TQtModuleMakefile.finalise(self) + + +class TQtTableModuleMakefile(TQtModuleMakefile): + """The Makefile class for modules that %Import tqttable. + """ + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + self.extra_libs.append(self.module_as_lib("tqttable")) + + TQtModuleMakefile.finalise(self) + + +class TQtSQLModuleMakefile(TQtTableModuleMakefile): + """The Makefile class for modules that %Import tqtsql. + """ + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + self.extra_libs.append(self.module_as_lib("tqtsql")) + + TQtTableModuleMakefile.finalise(self) + + +class TQtUIModuleMakefile(TQtModuleMakefile): + """The Makefile class for modules that %Import tqtui. + """ + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + self.extra_libs.append(self.module_as_lib("tqtui")) + + TQtModuleMakefile.finalise(self) + + +class TQtXMLModuleMakefile(TQtModuleMakefile): + """The Makefile class for modules that %Import tqtxml. + """ + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + self.extra_libs.append(self.module_as_lib("tqtxml")) + + TQtModuleMakefile.finalise(self) diff --git a/pytquic3/LICENSE.GPL b/pytquic3/LICENSE.GPL new file mode 100644 index 0000000..c7aea18 --- /dev/null +++ b/pytquic3/LICENSE.GPL @@ -0,0 +1,280 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/pytquic3/domtool.cpp b/pytquic3/domtool.cpp new file mode 100644 index 0000000..740088e --- /dev/null +++ b/pytquic3/domtool.cpp @@ -0,0 +1,447 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of TQt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include "domtool.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/*! + \class DomTool domtool.h + \brief Tools for the dom + + A collection of static functions used by Resource (part of the + designer) and Uic. + +*/ + +/*! + Returns the contents of property \a name of object \a e as + variant or the variant passed as \a defValue if the property does + not exist. + + \sa hasProperty() +*/ +TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment ) +{ + TQDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + if ( n.attribute( "name" ) != name ) + continue; + return elementToVariant( n.firstChild().toElement(), defValue, comment ); + } + } + return defValue; +} + + +/*! + \overload + */ +TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue ) +{ + TQString comment; + return readProperty( e, name, defValue, comment ); +} + +/*! + Returns wheter object \a e defines property \a name or not. + + \sa readProperty() + */ +bool DomTool::hasProperty( const TQDomElement& e, const TQString& name ) +{ + TQDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + if ( n.attribute( "name" ) != name ) + continue; + return TRUE; + } + } + return FALSE; +} + +TQStringList DomTool::propertiesOfType( const TQDomElement& e, const TQString& type ) +{ + TQStringList result; + TQDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + TQDomElement n2 = n.firstChild().toElement(); + if ( n2.tagName() == type ) + result += n.attribute( "name" ); + } + } + return result; +} + + +TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& defValue ) +{ + TQString dummy; + return elementToVariant( e, defValue, dummy ); +} + +/*! + Interprets element \a e as variant and returns the result of the interpretation. + */ +TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& defValue, TQString &comment ) +{ + TQVariant v; + if ( e.tagName() == "rect" ) { + TQDomElement n3 = e.firstChild().toElement(); + int x = 0, y = 0, w = 0, h = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "x" ) + x = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "y" ) + y = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "width" ) + w = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "height" ) + h = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = TQVariant( TQRect( x, y, w, h ) ); + } else if ( e.tagName() == "point" ) { + TQDomElement n3 = e.firstChild().toElement(); + int x = 0, y = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "x" ) + x = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "y" ) + y = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = TQVariant( TQPoint( x, y ) ); + } else if ( e.tagName() == "size" ) { + TQDomElement n3 = e.firstChild().toElement(); + int w = 0, h = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "width" ) + w = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "height" ) + h = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = TQVariant( TQSize( w, h ) ); + } else if ( e.tagName() == "color" ) { + v = TQVariant( readColor( e ) ); + } else if ( e.tagName() == "font" ) { + TQDomElement n3 = e.firstChild().toElement(); + TQFont f( defValue.toFont() ); + while ( !n3.isNull() ) { + if ( n3.tagName() == "family" ) + f.setFamily( n3.firstChild().toText().data() ); + else if ( n3.tagName() == "pointsize" ) + f.setPointSize( n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "bold" ) + f.setBold( n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "italic" ) + f.setItalic( n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "underline" ) + f.setUnderline( n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "strikeout" ) + f.setStrikeOut( n3.firstChild().toText().data().toInt() ); + n3 = n3.nextSibling().toElement(); + } + v = TQVariant( f ); + } else if ( e.tagName() == "string" ) { + v = TQVariant( e.firstChild().toText().data() ); + TQDomElement n = e; + n = n.nextSibling().toElement(); + if ( n.tagName() == "comment" ) + comment = n.firstChild().toText().data(); + } else if ( e.tagName() == "cstring" ) { + v = TQVariant( TQCString( e.firstChild().toText().data() ) ); + } else if ( e.tagName() == "number" ) { + bool ok = TRUE; + v = TQVariant( e.firstChild().toText().data().toInt( &ok ) ); + if ( !ok ) + v = TQVariant( e.firstChild().toText().data().toDouble() ); + } else if ( e.tagName() == "bool" ) { + TQString t = e.firstChild().toText().data(); + v = TQVariant( t == "true" || t == "1" ); + } else if ( e.tagName() == "pixmap" ) { + v = TQVariant( e.firstChild().toText().data() ); + } else if ( e.tagName() == "iconset" ) { + v = TQVariant( e.firstChild().toText().data() ); + } else if ( e.tagName() == "image" ) { + v = TQVariant( e.firstChild().toText().data() ); + } else if ( e.tagName() == "enum" ) { + v = TQVariant( e.firstChild().toText().data() ); + } else if ( e.tagName() == "set" ) { + v = TQVariant( e.firstChild().toText().data() ); + } else if ( e.tagName() == "sizepolicy" ) { + TQDomElement n3 = e.firstChild().toElement(); + TQSizePolicy sp; + while ( !n3.isNull() ) { + if ( n3.tagName() == "hsizetype" ) + sp.setHorData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "vsizetype" ) + sp.setVerData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "horstretch" ) + sp.setHorStretch( n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "verstretch" ) + sp.setVerStretch( n3.firstChild().toText().data().toInt() ); + n3 = n3.nextSibling().toElement(); + } + v = TQVariant( sp ); + } else if ( e.tagName() == "cursor" ) { + v = TQVariant( TQCursor( e.firstChild().toText().data().toInt() ) ); + } else if ( e.tagName() == "stringlist" ) { + TQStringList lst; + TQDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) + lst << n.firstChild().toText().data(); + v = TQVariant( lst ); + } else if ( e.tagName() == "date" ) { + TQDomElement n3 = e.firstChild().toElement(); + int y, m, d; + y = m = d = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "year" ) + y = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "month" ) + m = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "day" ) + d = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = TQVariant( TQDate( y, m, d ) ); + } else if ( e.tagName() == "time" ) { + TQDomElement n3 = e.firstChild().toElement(); + int h, m, s; + h = m = s = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "hour" ) + h = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "minute" ) + m = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "second" ) + s = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = TQVariant( TQTime( h, m, s ) ); + } else if ( e.tagName() == "datetime" ) { + TQDomElement n3 = e.firstChild().toElement(); + int h, mi, s, y, mo, d ; + h = mi = s = y = mo = d = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "hour" ) + h = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "minute" ) + mi = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "second" ) + s = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "year" ) + y = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "month" ) + mo = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "day" ) + d = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = TQVariant( TQDateTime( TQDate( y, mo, d ), TQTime( h, mi, s ) ) ); + } + return v; +} + + +/*! Returns the color which is returned in the dom element \a e. + */ + +TQColor DomTool::readColor( const TQDomElement &e ) +{ + TQDomElement n = e.firstChild().toElement(); + int r= 0, g = 0, b = 0; + while ( !n.isNull() ) { + if ( n.tagName() == "red" ) + r = n.firstChild().toText().data().toInt(); + else if ( n.tagName() == "green" ) + g = n.firstChild().toText().data().toInt(); + else if ( n.tagName() == "blue" ) + b = n.firstChild().toText().data().toInt(); + n = n.nextSibling().toElement(); + } + + return TQColor( r, g, b ); +} + +/*! + Returns the contents of attribute \a name of object \a e as + variant or the variant passed as \a defValue if the attribute does + not exist. + + \sa hasAttribute() + */ +TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment ) +{ + TQDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "attribute" ) { + if ( n.attribute( "name" ) != name ) + continue; + return elementToVariant( n.firstChild().toElement(), defValue, comment ); + } + } + return defValue; +} + +/*! + \overload +*/ +TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue ) +{ + TQString comment; + return readAttribute( e, name, defValue, comment ); +} + +/*! + Returns wheter object \a e defines attribute \a name or not. + + \sa readAttribute() + */ +bool DomTool::hasAttribute( const TQDomElement& e, const TQString& name ) +{ + TQDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "attribute" ) { + if ( n.attribute( "name" ) != name ) + continue; + return TRUE; + } + } + return FALSE; +} + +static bool toBool( const TQString& s ) +{ + return s == "true" || s.toInt() != 0; +} + +/*! + Convert TQt 2.x format to TQt 3.0 format if necessary +*/ +void DomTool::fixDocument( TQDomDocument& doc ) +{ + TQDomElement e; + TQDomNode n; + TQDomNodeList nl; + int i = 0; + + e = doc.firstChild().toElement(); + if ( e.tagName() != "UI" ) + return; + + // latest version, don't do anything + if ( e.hasAttribute("version") && e.attribute("version").toDouble() > 3.0 ) + return; + + nl = doc.elementsByTagName( "property" ); + + // in 3.0, we need to fix a spelling error + if ( e.hasAttribute("version") && e.attribute("version").toDouble() == 3.0 ) { + for ( i = 0; i < (int) nl.length(); i++ ) { + TQDomElement el = nl.item(i).toElement(); + TQString s = el.attribute( "name" ); + if ( s == "resizeable" ) { + el.removeAttribute( "name" ); + el.setAttribute( "name", "resizable" ); + } + } + return; + } + + + // in versions smaller than 3.0 we need to change more + e.setAttribute( "version", 3.0 ); + + e.setAttribute("stdsetdef", 1 ); + for ( i = 0; i < (int) nl.length(); i++ ) { + e = nl.item(i).toElement(); + TQString name; + TQDomElement n2 = e.firstChild().toElement(); + if ( n2.tagName() == "name" ) { + name = n2.firstChild().toText().data(); + if ( name == "resizeable" ) + e.setAttribute( "name", "resizable" ); + else + e.setAttribute( "name", name ); + e.removeChild( n2 ); + } + bool stdset = toBool( e.attribute( "stdset" ) ); + if ( stdset || name == "toolTip" || name == "whatsThis" || + name == "buddy" || + e.parentNode().toElement().tagName() == "item" || + e.parentNode().toElement().tagName() == "spacer" || + e.parentNode().toElement().tagName() == "column" + ) + e.removeAttribute( "stdset" ); + else + e.setAttribute( "stdset", 0 ); + } + + nl = doc.elementsByTagName( "attribute" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + e = nl.item(i).toElement(); + TQString name; + TQDomElement n2 = e.firstChild().toElement(); + if ( n2.tagName() == "name" ) { + name = n2.firstChild().toText().data(); + e.setAttribute( "name", name ); + e.removeChild( n2 ); + } + } + + nl = doc.elementsByTagName( "image" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + e = nl.item(i).toElement(); + TQString name; + TQDomElement n2 = e.firstChild().toElement(); + if ( n2.tagName() == "name" ) { + name = n2.firstChild().toText().data(); + e.setAttribute( "name", name ); + e.removeChild( n2 ); + } + } + + nl = doc.elementsByTagName( "widget" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + e = nl.item(i).toElement(); + TQString name; + TQDomElement n2 = e.firstChild().toElement(); + if ( n2.tagName() == "class" ) { + name = n2.firstChild().toText().data(); + e.setAttribute( "class", name ); + e.removeChild( n2 ); + } + } + +} + diff --git a/pytquic3/domtool.h b/pytquic3/domtool.h new file mode 100644 index 0000000..87fbaf6 --- /dev/null +++ b/pytquic3/domtool.h @@ -0,0 +1,47 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of TQt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef DOMTOOL_H +#define DOMTOOL_H + +#include +#include + +class TQDomElement; +class TQDomDocument; + +class DomTool : public TQt +{ +public: + static TQVariant readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue ); + static TQVariant readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment ); + static bool hasProperty( const TQDomElement& e, const TQString& name ); + static TQStringList propertiesOfType( const TQDomElement& e, const TQString& type ); + static TQVariant elementToVariant( const TQDomElement& e, const TQVariant& defValue ); + static TQVariant elementToVariant( const TQDomElement& e, const TQVariant& defValue, TQString &comment ); + static TQVariant readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue ); + static TQVariant readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment ); + static bool hasAttribute( const TQDomElement& e, const TQString& name ); + static TQColor readColor( const TQDomElement &e ); + static void fixDocument( TQDomDocument& ); +}; + + +#endif // DOMTOOL_H diff --git a/pytquic3/embed.cpp b/pytquic3/embed.cpp new file mode 100644 index 0000000..9bf0071 --- /dev/null +++ b/pytquic3/embed.cpp @@ -0,0 +1,322 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** Copyright (c) 2001 Phil Thompson +** Copyright (c) 2002 Riverbank Computing Limited +** +** This file is part of TQt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include "uic.h" +#include +#include +#include +#include +#include +#include +#include + +// on embedded, we do not compress image data. Rationale: by mapping +// the ready-only data directly into memory we are both faster and +// more memory efficient +#if (TQT_VERSION < 0x030100 || defined(Q_WS_QWS)) && !defined(TQT_NO_IMAGE_COLLECTION_COMPRESSION) +#define TQT_NO_IMAGE_COLLECTION_COMPRESSION +#endif + +struct EmbedImage +{ + ~EmbedImage() { delete[] colorTable; } + int width, height, depth; + int numColors; + TQRgb* colorTable; + TQString name; + TQString cname; + bool alpha; +#ifndef TQT_NO_IMAGE_COLLECTION_COMPRESSION + ulong compressed; +#endif +}; + +static TQString convertToCIdentifier( const char *s ) +{ + TQString r = s; + int len = r.length(); + if ( len > 0 && !isalpha( (char)r[0].latin1() ) ) + r[0] = '_'; + for ( int i=1; i> 4) & 15]; + s += hexdigits[v & 15]; + if ( i == len-1 ) + s += "\"\n"; + } + if ( s.length() ) + out << (const char*)s; + return (ulong)len; +} + +static void embedData( TQTextStream& out, const TQRgb* input, int n ) +{ + out << hex; + const TQRgb *v = input; + for ( int i=0; i list_image; + list_image.setAutoDelete( TRUE ); + int image_count = 0; + for ( it = images.begin(); it != images.end(); ++it ) { + TQImage img; + if ( !img.load( *it ) ) { + fprintf( stderr, "pytquic: cannot load image file %s\n", (*it).utf8() ); + continue; + } + EmbedImage *e = new EmbedImage; + e->width = img.width(); + e->height = img.height(); + e->depth = img.depth(); + e->numColors = img.numColors(); + e->colorTable = new TQRgb[e->numColors]; + e->alpha = img.hasAlphaBuffer(); + memcpy(e->colorTable, img.colorTable(), e->numColors*sizeof(TQRgb)); + TQFileInfo fi( *it ); + e->name = fi.fileName(); + e->cname = TQString("image_%1").arg( image_count++); + list_image.append( e ); + out << "# " << *it << "\n"; + TQString s; + if ( e->depth == 1 ) + img = img.convertBitOrder(TQImage::BigEndian); + out << s.sprintf( "%s_data =", + (const char *)e->cname ); +#ifndef TQT_NO_IMAGE_COLLECTION_COMPRESSION + e->compressed = +#endif + embedData( out, img.bits(), img.numBytes() ); + out << "\n"; + if ( e->numColors ) { + out << s.sprintf( "%s_ctable = [", + (const char *)e->cname ); + embedData( out, e->colorTable, e->numColors ); + out << "\n]\n\n"; + } + } + + if ( !list_image.isEmpty() ) { + out << indent << "embed_image_vec = [\n"; + ++indent; + EmbedImage *e = list_image.first(); + while ( e ) { + out << indent << "[" + << e->width << "," + << e->height << "," + << e->depth << "," + << e->cname << "_data," +#ifndef TQT_NO_IMAGE_COLLECTION_COMPRESSION + << e->compressed << "," +#endif + << e->numColors << ","; + if ( e->numColors ) + out << e->cname << "_ctable,"; + else + out << "None,"; + if ( e->alpha ) + out << "1,"; + else + out << "0,"; + out << "\"" << e->name << "\"],\n"; + e = list_image.next(); + } + --indent; + out << indent << "]\n"; + + out << "\n" + "\n" + "def uic_findImage(name):\n"; + ++indent; + out << indent << "global embed_image_vec\n"; + out << "\n"; +#ifndef TQT_NO_IMAGE_COLLECTION_COMPRESSION + out << indent << "for (w,h,depth,data,comp,nrCol,colTab,alpha,iname) in embed_image_vec:" << endl; +#else + out << indent << "for (w,h,depth,data,nrCol,colTab,alpha,iname) in embed_image_vec:" << endl; +#endif + ++indent; + out << indent << "if iname == str(name):" << endl; + ++indent; +#ifndef TQT_NO_IMAGE_COLLECTION_COMPRESSION + // Keep the data object alive until we have a deep copy of the image. + out << indent << "data = tqUncompress(data).data()\n"; +#endif + out << indent << "img = TQImage(data,w,h,depth,colTab,nrCol,TQImage.BigEndian).copy()\n"; + out << "\n"; + out << indent << "if alpha:\n"; + ++indent; + out << indent << "img.setAlphaBuffer(1)\n"; + --indent; + out << "\n"; + out << indent << "return img\n"; + --indent; + --indent; + out << endl; + out << indent << "return TQImage()\n"; + --indent; + out << "\n"; + out << "\n"; + + out << indent << "class MimeSourceFactory_" << cProject << "(TQMimeSourceFactory):\n"; + ++indent; + out << indent << "def __init__(self):\n"; + ++indent; + out << indent << "TQMimeSourceFactory.__init__(self)\n"; + out << "\n"; + --indent; + out << indent << "def data(self,abs_name):\n"; + ++indent; + out << indent << "d = TQMimeSourceFactory.data(self,abs_name)\n"; + out << indent << "if d or abs_name.isNull():\n"; + ++indent; + out << indent << "return d\n"; + --indent; + out << "\n"; + out << indent << "img = uic_findImage(abs_name)\n"; + out << indent << "if not img.isNull():\n"; + ++indent; + out << indent << "self.setImage(abs_name,img)\n"; + --indent; + out << "\n"; + out << indent << "return TQMimeSourceFactory.data(self,abs_name)\n"; + --indent; + --indent; + out << "\n"; + out << "\n"; + + out << indent << "factory = None\n"; + out << "\n"; + + out << indent << "def tqInitImages_" << cProject << "():\n"; + ++indent; + out << indent << "global factory\n"; + out << "\n"; + out << indent << "if factory is None:\n"; + ++indent; + out << indent << "factory = MimeSourceFactory_" << cProject << "()\n"; + out << indent << "TQMimeSourceFactory.defaultFactory().addFactory(factory)\n"; + --indent; + --indent; + out << "\n"; + out << "\n"; + + out << indent << "def tqCleanupImages_" << cProject << "():\n"; + ++indent; + out << indent << "global factory\n"; + out << "\n"; + out << indent << "if factory is not None:\n"; + ++indent; + out << indent << "TQMimeSourceFactory.defaultFactory().removeFactory(factory)\n"; + out << indent << "factory = None\n"; + --indent; + --indent; + out << "\n"; + out << "\n"; + + out << indent << "class StaticInitImages_" << cProject << ":\n"; + ++indent; + out << indent << "def __init__(self):\n"; + ++indent; + out << indent << "self.cleanup = tqCleanupImages_" << cProject << "\n"; + out << indent << "tqInitImages_" << cProject << "()\n"; + --indent; + out << "\n"; + out << indent << "def __del__(self):\n"; + ++indent; + out << indent << "self.cleanup()\n"; + --indent; + --indent; + out << "\n"; + out << "\n"; + + out << "staticImages = StaticInitImages_" << cProject << "()\n"; + } +} diff --git a/pytquic3/form.cpp b/pytquic3/form.cpp new file mode 100644 index 0000000..e5912f1 --- /dev/null +++ b/pytquic3/form.cpp @@ -0,0 +1,938 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of TQt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include +#include "uic.h" +#include "parser.h" +#include "widgetdatabase.h" +#include "domtool.h" +#include +#include +#include +#include +#define NO_STATIC_COLORS +#include + +#if TQT_VERSION < 0x030100 +#include +#endif + +static TQByteArray unzipXPM( TQString data, ulong& length ) +{ +#if TQT_VERSION >= 0x030100 + const int lengthOffset = 4; + int baSize = data.length() / 2 + lengthOffset; + uchar *ba = new uchar[ baSize ]; + for ( int i = lengthOffset; i < baSize; ++i ) { + char h = data[ 2 * (i-lengthOffset) ].latin1(); + char l = data[ 2 * (i-lengthOffset) + 1 ].latin1(); + uchar r = 0; + if ( h <= '9' ) + r += h - '0'; + else + r += h - 'a' + 10; + r = r << 4; + if ( l <= '9' ) + r += l - '0'; + else + r += l - 'a' + 10; + ba[ i ] = r; + } + // tqUncompress() expects the first 4 bytes to be the expected length of the + // uncompressed data + ba[0] = ( length & 0xff000000 ) >> 24; + ba[1] = ( length & 0x00ff0000 ) >> 16; + ba[2] = ( length & 0x0000ff00 ) >> 8; + ba[3] = ( length & 0x000000ff ); + TQByteArray baunzip = tqUncompress( ba, baSize ); + delete[] ba; + return baunzip; +#else + uchar *ba = new uchar[ data.length() / 2 ]; + for ( int i = 0; i < (int)data.length() / 2; ++i ) { + char h = data[ 2 * i ].latin1(); + char l = data[ 2 * i + 1 ].latin1(); + uchar r = 0; + if ( h <= '9' ) + r += h - '0'; + else + r += h - 'a' + 10; + r = r << 4; + if ( l <= '9' ) + r += l - '0'; + else + r += l - 'a' + 10; + ba[ i ] = r; + } + // I'm not sure this makes sense. Why couldn't the compressed data be + // less than 20% of the original data? Maybe it's enough to trust the + // `length' passed as an argument. Quoting the zlib header: + // Upon entry, destLen is the total size of the destination + // buffer, which must be large enough to hold the entire + // uncompressed data. (The size of the uncompressed data must + // have been saved previously by the compressor and transmitted + // to the decompressor by some mechanism outside the scope of + // this compression library.) + // Which is the role of `length'. On the other hand this could prevent + // crashes in some cases of slightly corrupt UIC files. + if ( length < data.length() * 5 ) + length = data.length() * 5; + TQByteArray baunzip( length ); + ::uncompress( (uchar*) baunzip.data(), &length, ba, data.length()/2 ); + delete[] ba; + return baunzip; +#endif +} + + + +/*! + Creates an implementation ( cpp-file ) for the form given in \a e + + \sa createFormDecl(), createObjectImpl() + */ +void Uic::createFormImpl( const TQDomElement &e ) +{ + TQDomElement n; + TQDomNodeList nl; + int i; + TQString objClass = getClassName( e ); + if ( objClass.isEmpty() ) + return; + TQString objName = getObjectName( e ); + + // generate local and local includes required + TQStringList globalIncludes; + TQStringList::Iterator it; + TQStringList sqlClasses; + TQStringList axwidgets, databrowsers; + + TQMap customWidgetIncludes; + TQMap functionImpls; + // find additional slots and functions + TQStringList extraSlots; + TQStringList extraSlotTypes; + nl = e.parentNode().toElement().elementsByTagName( "slot" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + n = nl.item(i).toElement(); + if ( n.parentNode().toElement().tagName() != "slots" + && n.parentNode().toElement().tagName() != "connections" ) + continue; + if ( n.attribute( "language", "C++" ) != "C++" ) + continue; + TQString slotName = n.firstChild().toText().data().stripWhiteSpace(); + if ( slotName.endsWith( ";" ) ) + slotName = slotName.left( slotName.length() - 1 ); + + extraSlots += Parser::cleanArgs(slotName); + extraSlotTypes += n.attribute( "returnType", "void" ); + } + + for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "functions" ) { // compatibility + for ( TQDomElement n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + if ( n2.tagName() == "function" ) { + TQString fname = n2.attribute( "name" ); + fname = Parser::cleanArgs( fname ); + functionImpls.insert( fname, n2.firstChild().toText().data() ); + } + } + } + } + + // additional includes (local or global ) and forward declaractions + nl = e.parentNode().toElement().elementsByTagName( "include" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + TQDomElement n2 = nl.item(i).toElement(); + + TQString s = n2.firstChild().toText().data(); + if ( n2.attribute( "location" ) != "local" ) { + if ( s.right( 5 ) == ".ui.h" && !TQFile::exists( s ) ) + continue; + if ( n2.attribute( "impldecl", "in implementation" ) != "in implementation" ) + continue; + globalIncludes += s; + } + } + + // do the local includes afterwards, since global includes have priority on clashes + TQFileInfo fi(fileName); + + for ( i = 0; i < (int) nl.length(); i++ ) { + TQDomElement n2 = nl.item(i).toElement(); + TQString s = n2.firstChild().toText().data(); + if ( n2.attribute( "location" ) == "local" &&!globalIncludes.contains( s ) ) { + if ( s.right( 5 ) != ".ui.h" ) + continue; + + if ( !TQFile::exists( s ) ) + { + s = fi.dirPath() + "/" + s; + + if ( !TQFile::exists( s ) ) + continue; + } + + if ( TQFile::exists( s ) ) + { + TQFile f(s); + f.open(IO_ReadOnly); + TQTextStream headerStream(&f); + TQString line; + TQString functionText; + TQString functionName; + TQRegExp rx("void .*::(.*\\(.*\\))"); + int pos, inFunction = 0; + + while (line = headerStream.readLine()) + { + pos = rx.search(line); + + if (pos > -1) + { + if (inFunction) + functionImpls.insert(Parser::cleanArgs(functionName),functionText); + + functionName = rx.cap(1); + functionText = ""; + inFunction = 1; + } + functionText += line + "\n"; + } + + if (inFunction) + functionImpls.insert(Parser::cleanArgs(functionName),functionText); + } + } + } + + // additional custom widget headers + nl = e.parentNode().toElement().elementsByTagName( "header" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + TQDomElement n2 = nl.item(i).toElement(); + TQString s = n2.firstChild().toText().data(); + if ( n2.attribute( "location" ) != "local" ) + globalIncludes += s; + } + + // includes for child widgets + for ( it = tags.begin(); it != tags.end(); ++it ) { + nl = e.parentNode().toElement().elementsByTagName( *it ); + for ( i = 1; i < (int) nl.length(); i++ ) { // start at 1, 0 is the toplevel widget + TQString name = getClassName( nl.item(i).toElement() ); + if ( name == "Spacer" ) { + globalIncludes += "tqlayout.h"; + globalIncludes += "tqapplication.h"; + continue; + } + if ( name.mid( 1 ) == "ListView" ) + globalIncludes += "tqheader.h"; + else if ( name == "TQAxWidget" ) + axwidgets += getObjectName(nl.item(i).toElement()); + else if ( name == "TQDataBrowser" ) + databrowsers += getObjectName(nl.item(i).toElement()); + if ( name != objClass ) { + int wid = WidgetDatabase::idFromClassName( name ); + TQMap::Iterator it = customWidgetIncludes.find( name ); + if ( it == customWidgetIncludes.end() ) + globalIncludes += WidgetDatabase::includeFile( wid ); + } + } + } + + if (globalIncludes.findIndex("tqtable.h") >= 0) + out << indent << "from PyTQt.tqttable import TQTable" << endl; + + if (!axwidgets.empty()) + out << indent << "from PyTQt.tqtaxcontainer import TQAxWidget" << endl; + + if (globalIncludes.findIndex("tqextscintilla.h") >= 0) + out << indent << "from PyTQt.tqtext import TQextScintilla" << endl; + + registerDatabases( e ); + dbConnections = unique( dbConnections ); + if ( dbConnections.count() ) + sqlClasses += "TQSqlDatabase"; + if ( dbCursors.count() ) + sqlClasses += "TQSqlCursor"; + bool dbForm = FALSE; + if ( dbForms[ "(default)" ].count() ) + dbForm = TRUE; + bool subDbForms = FALSE; + for ( it = dbConnections.begin(); it != dbConnections.end(); ++it ) { + if ( !(*it).isEmpty() && (*it) != "(default)" ) { + if ( dbForms[ (*it) ].count() ) { + subDbForms = TRUE; + break; + } + } + } + if ( dbForm || subDbForms ) { + sqlClasses += "TQSqlForm"; + sqlClasses += "TQSqlRecord"; + } + + if (globalIncludes.findIndex("tqdatatable.h") >= 0) + sqlClasses += "TQDataTable"; + + if (globalIncludes.findIndex("tqtableview.h") >= 0) + sqlClasses += "TQTableView"; + + if (globalIncludes.findIndex("tqdatabrowser.h") >= 0) + sqlClasses += "TQDataBrowser"; + + if (globalIncludes.findIndex("tqdataview.h") >= 0) + sqlClasses += "TQDataView"; + + if ( !sqlClasses.empty() ) { + out << indent << "from PyTQt.tqtsql import"; + const char *sep = " "; + + for ( it = sqlClasses.begin(); it != sqlClasses.end(); ++it ) { + out << sep << (*it); + sep = ", "; + } + + out << endl; + } + + // Add any code from the comments. + if (!pyCode.isEmpty()) + out << pyCode; + + out << endl; + + // find out what images are required + TQStringList requiredImages; + static const char *imgTags[] = { "pixmap", "iconset", 0 }; + for ( i = 0; imgTags[i] != 0; i++ ) { + nl = e.parentNode().toElement().elementsByTagName( imgTags[i] ); + for ( int j = 0; j < (int) nl.length(); j++ ) { + TQDomNode nn = nl.item(j); + while ( nn.parentNode() != e.parentNode() ) + nn = nn.parentNode(); + if ( nn.nodeName() != "customwidgets" ) + requiredImages += nl.item(j).firstChild().toText().data(); + } + } + + // register the object and unify its name + objName = registerObject( objName ); + + TQStringList images; + TQStringList xpmImages; + if ( pixmapLoaderFunction.isEmpty() && !externPixmaps ) { + // create images + for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "images" ) { + nl = n.elementsByTagName( "image" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + TQString img = registerObject( nl.item(i).toElement().attribute( "name" ) ); + if ( !requiredImages.contains( img ) ) + continue; + TQDomElement tmp = nl.item(i).firstChild().toElement(); + if ( tmp.tagName() != "data" ) + continue; + TQString format = tmp.attribute("format", "PNG" ); + TQString data = tmp.firstChild().toText().data(); + if ( format == "XPM.GZ" ) { + xpmImages += img; + ulong length = tmp.attribute("length").toULong(); + TQByteArray baunzip = unzipXPM( data, length ); + length = baunzip.size(); + // shouldn't we test the initial `length' against the + // resulting `length' to catch corrupt UIC files? + int a = 0; + out << indent << img << "_data = [" << endl; + while ( baunzip[a] != '\"' ) + a++; + for ( ; a < (int) length; a++ ) + { + char ch; + + if ((ch = baunzip[a]) == '}') + { + out << endl << "]"; + break; + } + + out << ch; + } + out << endl; + } else { + images += img; + out << indent << img << "_data = \\" << endl; + ++indent; + out << indent << "\""; + int a ; + for ( a = 0; a < (int) (data.length()/2)-1; a++ ) { + out << "\\x" << TQString(data[2*a]) << TQString(data[2*a+1]); + if ( a % 12 == 11 ) + out << "\" \\" << endl << indent << "\""; + } + out << "\\x" << TQString(data[2*a]) << TQString(data[2*a+1]) << "\"" << endl; + --indent; + } + } + } + } + out << endl; + } else if ( externPixmaps ) { +#if TQT_VERSION >= 0x030100 + pixmapLoaderFunction = "TQPixmap.fromMimeSource"; +#else + out << indent << "def uic_load_pixmap_" << objName << "(name):" << endl; + ++indent; + out << indent << "pix = TQPixmap()" << endl; + out << indent << "m = TQMimeSourceFactory.defaultFactory().data(name)" << endl; + out << endl; + out << indent << "if m:" << endl; + ++indent; + out << indent << "TQImageDrag.decode(m,pix)" << endl; + --indent; + out << endl; + out << indent << "return pix" << endl; + --indent; + out << endl; + out << endl; + pixmapLoaderFunction = "uic_load_pixmap_" + objName; +#endif + } + + + // constructor(s) + + out << indent << "class " << nameOfClass << "(" << objClass << "):" << endl; + ++indent; + + if ( objClass == "TQDialog" || objClass == "TQWizard" ) { + out << indent << "def __init__(self,parent = None,name = None,modal = 0,fl = 0):" << endl; + ++indent; + out << indent << objClass << ".__init__(self,parent,name,modal,fl)" << endl; + } else if ( objClass == "TQWidget" ) { + out << indent << "def __init__(self,parent = None,name = None,fl = 0):" << endl; + ++indent; + out << indent << objClass << ".__init__(self,parent,name,fl)" << endl; + } else if ( objClass == "TQMainWindow" ) { + out << indent << "def __init__(self,parent = None,name = None,fl = 0):" << endl; + ++indent; + out << indent << objClass << ".__init__(self,parent,name,fl)" << endl; + out << indent << "self.statusBar()" << endl; + isMainWindow = TRUE; + } else { + out << indent << "def __init__(self,parent = None,name = None):" << endl; + ++indent; + out << indent << objClass << ".__init__(self,parent,name)" << endl; + } + + out << endl; + + // create pixmaps for all images + if ( !images.isEmpty() ) { + TQStringList::Iterator it; + for ( it = images.begin(); it != images.end(); ++it ) { + out << indent << "self." << (*it) << " = TQPixmap()" << endl; + out << indent << "self." << (*it) << ".loadFromData(" << (*it) << "_data,\"PNG\")" << endl; + } + } + // create pixmaps for all images + if ( !xpmImages.isEmpty() ) { + for ( it = xpmImages.begin(); it != xpmImages.end(); ++it ) { + out << indent << "self." << (*it) << " = TQPixmap(" << (*it) << "_data)" << endl; + } + out << endl; + } + + + // set the properties + TQSize geometry( 0, 0 ); + + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + bool stdset = stdsetdef; + if ( n.hasAttribute( "stdset" ) ) + stdset = toBool( n.attribute( "stdset" ) ); + TQString prop = n.attribute("name"); + TQDomElement n2 = n.firstChild().toElement(); + TQString value = setObjectProperty( objClass, TQString::null, prop, n2, stdset ); + if ( value.isEmpty() ) + continue; + + if ( prop == "geometry" && n2.tagName() == "rect") { + TQDomElement n3 = n2.firstChild().toElement(); + while ( !n3.isNull() ) { + if ( n3.tagName() == "width" ) + geometry.setWidth( n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "height" ) + geometry.setHeight( n3.firstChild().toText().data().toInt() ); + n3 = n3.nextSibling().toElement(); + } + } else { + TQString call; + if ( stdset ) + call = "self." + mkStdSet( prop ) + "(" + value + ")"; + else + call = "self.setProperty(\"" + prop + "\",TQVariant(" + value + "))"; + + if ( n2.tagName() == "string" ) { + trout << trindent << call << endl; + } else if ( prop == "name" ) { + out << indent << "if not name:" << endl; + ++indent; + out << indent << call << endl; + --indent; + out << endl; + } else { + out << indent << call << endl; + } + } + } + } + + out << endl; + + // create all children, some forms have special requirements + + if ( objClass == "TQWizard" ) { + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( tags.contains( n.tagName() ) ) { + TQString page = createObjectImpl( n, objClass, "self" ); + TQString comment; + TQString label = DomTool::readAttribute( n, "title", "", comment ).toString(); + out << indent << "self.addPage(" << page << ",TQString(\"\"))" << endl; + trout << trindent << "self.setTitle(" << page << ","<< trcall( label, comment ) << ")" << endl; + TQVariant def( FALSE ); + if ( DomTool::hasAttribute( n, "backEnabled" ) ) + out << indent << "self.setBackEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "backEnabled", def).toBool() ) << ")" << endl; + if ( DomTool::hasAttribute( n, "nextEnabled" ) ) + out << indent << "self.setNextEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "nextEnabled", def).toBool() ) << ")" << endl; + if ( DomTool::hasAttribute( n, "finishEnabled" ) ) + out << indent << "self.setFinishEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "finishEnabled", def).toBool() ) << ")" << endl; + if ( DomTool::hasAttribute( n, "helpEnabled" ) ) + out << indent << "self.setHelpEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "helpEnabled", def).toBool() ) << ")" << endl; + if ( DomTool::hasAttribute( n, "finish" ) ) + out << indent << "self.setFinish( " << page << "," << mkBool( DomTool::readAttribute( n, "finish", def).toBool() ) << ")" << endl; + } + } + } else { // standard widgets + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( tags.contains( n.tagName() ) ) + createObjectImpl( n, objName, "self" ); + } + } + + // database support + dbConnections = unique( dbConnections ); + if ( dbConnections.count() ) + out << endl; + for ( it = dbConnections.begin(); it != dbConnections.end(); ++it ) { + if ( !(*it).isEmpty() && (*it) != "(default)") { + out << indent << "self." << (*it) << "Connection = TQSqlDatabase.database(\"" <<(*it) << "\")" << endl; + } + } + + nl = e.parentNode().toElement().elementsByTagName( "widget" ); + for ( i = 1; i < (int) nl.length(); i++ ) { // start at 1, 0 is the toplevel widget + n = nl.item(i).toElement(); + TQString s = getClassName( n ); + if ( (dbForm || subDbForms) && (s == "TQDataBrowser" || s == "TQDataView") ) { + TQString objName = getObjectName( n ); + TQString tab = getDatabaseInfo( n, "table" ); + TQString con = getDatabaseInfo( n, "connection" ); + out << indent << objName << "Form = TQSqlForm(self,\"" << objName << "Form\")" << endl; + TQDomElement n2; + for ( n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) + createFormImpl( n2, objName, con, tab ); + out << indent << "self." << objName << ".setForm(" << objName << "Form)" << endl; + } + } + + // actions, toolbars, menubar + bool needEndl = FALSE; + for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "actions" ) { + if ( !needEndl ) + out << endl; + createActionImpl( n.firstChild().toElement(), "self" ); + needEndl = TRUE; + } + } + if ( needEndl ) + out << endl; + needEndl = FALSE; + for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "toolbars" ) { + if ( !needEndl ) + out << endl; + createToolbarImpl( n, objClass, objName ); + needEndl = TRUE; + } + } + if ( needEndl ) + out << endl; + needEndl = FALSE; + for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "menubar" ) { + if ( !needEndl ) + out << endl; + createMenuBarImpl( n, objClass, objName ); + needEndl = TRUE; + } + } + if ( needEndl ) + out << endl; + + out << endl; + out << indent << "self.languageChange()" << endl; + out << endl; + + // take minimumSizeHint() into account, for height-for-width widgets + if ( !geometry.isNull() ) { + out << indent << "self.resize(TQSize(" << geometry.width() << "," + << geometry.height() <<").expandedTo(self.minimumSizeHint()))" << endl; + out << indent << "self.clearWState(TQt.WState_Polished)" << endl; + } + + for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "connections" ) { + // setup signals and slots connections + out << endl; + nl = n.elementsByTagName( "connection" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + TQString sender, receiver, signal, slot; + for ( TQDomElement n2 = nl.item(i).firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + if ( n2.tagName() == "sender" ) + sender = n2.firstChild().toText().data(); + else if ( n2.tagName() == "receiver" ) + receiver = n2.firstChild().toText().data(); + else if ( n2.tagName() == "signal" ) + signal = n2.firstChild().toText().data(); + else if ( n2.tagName() == "slot" ) + slot = n2.firstChild().toText().data(); + } + if ( sender.isEmpty() || + receiver.isEmpty() || + signal.isEmpty() || + slot.isEmpty() ) + continue; + if ( sender[0] == '<' || + receiver[0] == '<' || + signal[0] == '<' || + slot[0] == '<' ) + continue; + + sender = registeredName( sender ); + receiver = registeredName( receiver ); + + // translate formwindow name to "self" + if ( sender == objName ) + sender = "self"; + else + sender = "self." + sender; + + bool isaxwidget = (axwidgets.findIndex(receiver) >= 0); + bool isdatabrowser = (databrowsers.findIndex(receiver) >= 0); + + if ( receiver == objName ) + receiver = "self"; + else + receiver = "self." + receiver; + + out << indent << "self.connect(" << sender + << ",SIGNAL(\"" << signal << "\")," << receiver; + + // Normally we never use the SLOT() macro in case the + // connection is to a method of a Python custom widget. The + // exception is if the receiver is a TQAxWidget where it must be + // used because the slots are dynamic. + if (isaxwidget) + out << ",SLOT(\"" << slot << "\")"; + else + { + TQString mname = slot.left(slot.find('(')); + + // Rename slots that have different names in PyTQt. + if (isdatabrowser && mname == "del") + mname = "delOnCursor"; + + out << "." << mname; + } + + out << ")" << endl; + } + } else if ( n.tagName() == "tabstops" ) { + // setup tab order + out << endl; + TQString lastName; + TQDomElement n2 = n.firstChild().toElement(); + while ( !n2.isNull() ) { + if ( n2.tagName() == "tabstop" ) { + TQString name = n2.firstChild().toText().data(); + name = registeredName( name ); + if ( !lastName.isEmpty() ) + out << indent << "self.setTabOrder(self." << lastName << ",self." << name << ")" << endl; + lastName = name; + } + n2 = n2.nextSibling().toElement(); + } + } + } + + // buddies + bool firstBuddy = TRUE; + for ( TQValueList::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) { + if ( isObjectRegistered( (*buddy).buddy ) ) { + if ( firstBuddy ) { + out << endl; + } + out << indent << "self." << (*buddy).key << ".setBuddy(self." << registeredName( (*buddy).buddy ) << ")" << endl; + firstBuddy = FALSE; + } + + } + + if ( extraSlots.find( "init()" ) != extraSlots.end() ) + out << endl << indent << "self.init()" << endl; + + // end of constructor + --indent; + + // destructor + if ( extraSlots.find( "destroy()" ) != extraSlots.end() ) { + out << endl; + out << indent << "def __del__(self):" << endl; + ++indent; + out << indent << "self.destroy()" << endl; + --indent; + } + + // handle application events if required + bool needFontEventHandler = FALSE; + bool needSqlTableEventHandler = FALSE; + bool needSqlDataBrowserEventHandler = FALSE; + nl = e.elementsByTagName( "widget" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + if ( !DomTool::propertiesOfType( nl.item(i).toElement() , "font" ).isEmpty() ) + needFontEventHandler = TRUE; + TQString s = getClassName( nl.item(i).toElement() ); + if ( s == "TQDataTable" || s == "TQDataBrowser" ) { + if ( !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) + continue; + if ( s == "TQDataTable" ) + needSqlTableEventHandler = TRUE; + if ( s == "TQDataBrowser" ) + needSqlDataBrowserEventHandler = TRUE; + } + if ( needFontEventHandler && needSqlTableEventHandler && needSqlDataBrowserEventHandler ) + break; + } + if ( needFontEventHandler && FALSE ) { + // indent = "\t"; // increase indentation for if-clause below + out << "/* " << endl; + out << " * Main event handler. Reimplemented to handle" << endl; + out << " * application font changes"; + out << " */" << endl; + out << "bool " << nameOfClass << "::event( TQEvent* ev )" << endl; + out << "{" << endl; + out << " bool ret = " << objClass << "::event( ev ); " << endl; + if ( needFontEventHandler ) { + ++indent; + out << " if ( ev->type() == TQEvent::ApplicationFontChange ) {" << endl; + for ( i = 0; i < (int) nl.length(); i++ ) { + n = nl.item(i).toElement(); + TQStringList list = DomTool::propertiesOfType( n, "font" ); + for ( it = list.begin(); it != list.end(); ++it ) + createExclusiveProperty( n, *it ); + } + out << " }" << endl; + --indent; + } + out << "}" << endl; + out << endl; + } + + if ( needSqlTableEventHandler || needSqlDataBrowserEventHandler ) { + out << endl; + out << indent << "# Widget polish. Reimplemented to handle default data" << endl; + if ( needSqlTableEventHandler ) + out << indent << "# table initialization." << endl; + if ( needSqlDataBrowserEventHandler ) + out << indent << "# browser initialization." << endl; + out << indent << "def polish(self):" << endl; + ++indent; + if ( needSqlTableEventHandler ) { + for ( i = 0; i < (int) nl.length(); i++ ) { + TQString s = getClassName( nl.item(i).toElement() ); + if ( s == "TQDataTable" ) { + n = nl.item(i).toElement(); + TQString c = getObjectName( n ); + TQString conn = getDatabaseInfo( n, "connection" ); + TQString tab = getDatabaseInfo( n, "table" ); + if ( !( conn.isEmpty() || tab.isEmpty() || !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) ) { + out << indent << "if self." << c << ":" << endl; + ++indent; + out << indent << "cursor = self." << c << ".sqlCursor()" << endl; + out << endl; + out << indent << "if not cursor:" << endl; + ++indent; + if ( conn == "(default)" ) + out << indent << "cursor = TQSqlCursor(\"" << tab << "\")" << endl; + else + out << indent << "cursor = TQSqlCursor(\"" << tab << "\",1,self." << conn << "Connection)" << endl; + out << indent << "if self." << c << ".isReadOnly():" << endl; + ++indent; + out << indent << "cursor.setMode(TQSqlCursor.ReadOnly)" << endl; + --indent; + out << indent << "self." << c << ".setSqlCursor(cursor,0,1)" << endl; + --indent; + out << endl; + out << indent << "if not cursor.isActive():" << endl; + ++indent; + out << indent << "self." << c << ".refresh(TQDataTable.RefreshAll)" << endl; + --indent; + --indent; + } + } + } + } + if ( needSqlDataBrowserEventHandler ) { + nl = e.elementsByTagName( "widget" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + TQString s = getClassName( nl.item(i).toElement() ); + if ( s == "TQDataBrowser" ) { + TQString obj = getObjectName( nl.item(i).toElement() ); + TQString tab = getDatabaseInfo( nl.item(i).toElement(), + "table" ); + TQString conn = getDatabaseInfo( nl.item(i).toElement(), + "connection" ); + if ( !(tab.isEmpty() || !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) ) { + out << indent << "if self." << obj << ":" << endl; + ++indent; + out << indent << "if not self." << obj << ".sqlCursor():" << endl; + ++indent; + if ( conn == "(default)" ) + out << indent << "cursor = TQSqlCursor(\"" << tab << "\")" << endl; + else + out << indent << "cursor = TQSqlCursor(\"" << tab << "\",1,self." << conn << "Connection)" << endl; + out << indent << "self." << obj << ".setSqlCursor(cursor,1)" << endl; + out << indent << "self." << obj << ".refresh()" << endl; + out << indent << "self." << obj << ".first()" << endl; + --indent; + --indent; + } + } + } + } + out << indent << objClass << ".polish(self)" << endl; + --indent; + } + + out << endl; + out << endl; + out << indent << "def languageChange(self):" << endl; + uint old = indent.setIndent(0); + out << languageChangeBody << endl; + indent.setIndent(old); + + // create stubs for additional slots if necessary + if ( !extraSlots.isEmpty() && writeFunctImpl ) { + TQStringList::ConstIterator cit; + + for ( cit = extraSlots.begin(); cit != extraSlots.end(); ++cit ) { + pySlot(cit); + + bool createWarning = TRUE; + TQString fname = Parser::cleanArgs( *cit ); + TQMap::Iterator fit = functionImpls.find( fname ); + if ( fit != functionImpls.end() ) { + int begin = (*fit).find( "{" ); + TQString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 ); + createWarning = body.simplifyWhiteSpace().isEmpty(); + if ( !createWarning ) + { + ++indent; + TQString formatted_body = body.replace(TQRegExp("\n"), TQString("\n") + TQString(indent)); + out << formatted_body << endl; + --indent; + } + } + if ( createWarning ) { + out << endl; + ++indent; + if ( *cit != "init()" && *cit != "destroy()" ) + out << indent << "print(\"" << nameOfClass << "." << (*cit) << ": Not implemented yet\")" << endl; + else + out << indent << "pass" << endl; + --indent; + } + } + } + + --indent; +} + + +/*! Creates form support implementation code for the widgets given + in \a e. + + Traverses recursively over all children. + */ + +void Uic::createFormImpl( const TQDomElement& e, const TQString& form, const TQString& connection, const TQString& table ) +{ + if ( e.tagName() == "widget" && + e.attribute( "class" ) != "TQDataTable" ) { + TQString field = getDatabaseInfo( e, "field" ); + if ( !field.isEmpty() ) { + if ( isWidgetInTable( e, connection, table ) ) + out << indent << form << "Form.insert(self." << getObjectName( e ) << "," << fixString( field ) << ")" << endl; + } + } + TQDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + createFormImpl( n, form, connection, table ); + } +} + + +// Generate a Python slot definition. + +void Uic::pySlot(TQStringList::ConstIterator &it) +{ + out << endl; + + int astart = (*it).find('('); + out << indent << "def " << (*it).left(astart) << "(self"; + + // We don't reproduce the argument names (if any) because we would have to + // remove the types - too complicated for the moment, so we just count them + // and give them names based on their position. + + TQString args = (*it).mid(astart + 1,(*it).find(')') - astart - 1).stripWhiteSpace(); + + if (!args.isEmpty()) { + int nrargs = args.contains(',') + 1; + + for (int i = 0; i < nrargs; ++i) + out << ",a" << i; + } + + out << "):"; +} diff --git a/pytquic3/globaldefs.h b/pytquic3/globaldefs.h new file mode 100644 index 0000000..4704ff9 --- /dev/null +++ b/pytquic3/globaldefs.h @@ -0,0 +1,56 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of TQt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef GLOBALDEFS_H +#define GLOBALDEFS_H + +#include +#include + +#define BOXLAYOUT_DEFAULT_MARGIN 11 +#define BOXLAYOUT_DEFAULT_SPACING 6 + +#ifndef NO_STATIC_COLORS +static TQColor *backColor1 = 0; +static TQColor *backColor2 = 0; +static TQColor *selectedBack = 0; + +static void init_colors() +{ + if ( backColor1 ) + return; + +#if 0 // a calculated alternative for backColor1 + TQColorGroup myCg = tqApp->palette().active(); + int h1, s1, v1; + int h2, s2, v2; + myCg.color( TQColorGroup::Base ).hsv( &h1, &s1, &v1 ); + myCg.color( TQColorGroup::Background ).hsv( &h2, &s2, &v2 ); + TQColor c( h1, s1, ( v1 + v2 ) / 2, TQColor::Hsv ); +#endif + + backColor1 = new TQColor( 250, 248, 235 ); + backColor2 = new TQColor( 255, 255, 255 ); + selectedBack = new TQColor( 230, 230, 230 ); +} + +#endif + +#endif diff --git a/pytquic3/main.cpp b/pytquic3/main.cpp new file mode 100644 index 0000000..0158545 --- /dev/null +++ b/pytquic3/main.cpp @@ -0,0 +1,244 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** Copyright (c) 2001 Phil Thompson +** +** This file is part of TQt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include "uic.h" +#include "parser.h" +#include "widgetdatabase.h" +#include "domtool.h" +#include +#include +#include +#include +#define NO_STATIC_COLORS +#include +#include +#include +#include + +int main( int argc, char * argv[] ) +{ + PyIndent indent; + bool testCode = FALSE, execCode = FALSE; + bool subcl = FALSE; + bool imagecollection = FALSE; + TQStringList images; + const char *error = 0; + const char* fileName = 0; + TQCString outputFile; + const char* projectName = 0; + const char* trmacro = 0; + bool fix = FALSE; + TQApplication app(argc, argv, FALSE); + TQString className, uicClass; + + for ( int n = 1; n < argc && error == 0; n++ ) { + TQCString arg = argv[n]; + if ( arg[0] == '-' ) { // option + TQCString opt = &arg[1]; + if ( opt[0] == 'o' ) { // output redirection + if ( opt[1] == '\0' ) { + if ( !(n < argc-1) ) { + error = "Missing output-file name"; + break; + } + outputFile = argv[++n]; + } else + outputFile = &opt[1]; + } else if ( opt[0] == 'e' || opt == "embed" ) { + imagecollection = TRUE; + if ( opt == "embed" || opt[1] == '\0' ) { + if ( !(n < argc-1) ) { + error = "Missing name of project"; + break; + } + projectName = argv[++n]; + } else + projectName = &opt[1]; + } else if ( opt == "subimpl" ) { + subcl = TRUE; + if ( !(n < argc-1) ) { + error = "Missing class name"; + break; + } + className = argv[++n]; + } else if ( opt == "tr" ) { + if ( opt == "tr" || opt[1] == '\0' ) { + if ( !(n < argc-1) ) { + error = "Missing tr macro"; + break; + } + trmacro = argv[++n]; + } else { + trmacro = &opt[1]; + } + } else if ( opt == "version" ) { + fprintf( stderr, + "Python User Interface Compiler %s for TQt version %s\n", + PYTQT_VERSION, TQT_VERSION_STR ); + return 1; + } else if ( opt == "help" ) { + break; + } else if ( opt == "fix" ) { + fix = TRUE; + } else if ( opt[0] == 'p' ) { + uint tabstop; + bool ok; + + if ( opt[1] == '\0' ) { + if ( !(n < argc-1) ) { + error = "Missing Python indent"; + break; + } + tabstop = TQCString(argv[++n]).toUInt(&ok); + } else + tabstop = opt.mid(1).toUInt(&ok); + + if (ok) + indent.setTabStop(tabstop); + else + error = "Invalid Python indent"; + } else if ( opt == "test" ) { + testCode = TRUE; + } else if ( opt == "x" ) { + execCode = TRUE; + } else { + error = "Unrecognized option"; + } + } else { + if ( imagecollection ) + images << argv[n]; + else if ( fileName ) // can handle only one file + error = "Too many input files specified"; + else + fileName = argv[n]; + } + } + + if ( argc < 2 || error || (!fileName && !imagecollection ) ) { + fprintf( stderr, "PyTQt user interface compiler.\n" ); + if ( error ) + fprintf( stderr, "pytquic: %s\n", error ); + + fprintf( stderr, "Usage: %s [options] [mode] \n" + "\nGenerate implementation:\n" + " %s [options] \n" + "Generate image collection:\n" + " %s [options] -embed ...\n" + "\t\tproject name\n" + "\t\timage files\n" + "Generate subclass implementation:\n" + " %s [options] -subimpl \n" + "\t\tname of the subclass to generate\n" + "Options:\n" + "\t-o file\t\tWrite output to file rather than stdout\n" + "\t-p indent\tSet the Python indent in spaces (0 to use a tab)\n" + "\t-tr func\tUse func() rather than TQApplication.translate() for i18n\n" + "\t-x\t\tGenerate extra code to test and display the class\n" + "\t-test\t\tGenerate extra code to test but not display the class\n" + "\t-version\tDisplay version of pytquic\n" + "\t-help\t\tDisplay this information\n" + , argv[0], argv[0], argv[0], argv[0]); + return 1; + } + + Uic::setIndent(indent); + + TQFile fileOut; + if ( !outputFile.isEmpty() ) { + fileOut.setName( outputFile ); + if (!fileOut.open( IO_WriteOnly ) ) + tqFatal( "pytquic: Could not open output file '%s'", outputFile.data() ); + } else { + fileOut.open( IO_WriteOnly, stdout ); + } + TQTextStream out( &fileOut ); + + if ( imagecollection ) { + out.setEncoding( TQTextStream::UnicodeUTF8 ); + out << "# -*- coding: latin-1 -*-\n\n"; + Uic::embed( out, projectName, images ); + return 0; + } + + + out.setEncoding( TQTextStream::UnicodeUTF8 ); + TQFile file( fileName ); + if ( !file.open( IO_ReadOnly ) ) + tqFatal( "pytquic: Could not open file '%s' ", fileName ); + + TQDomDocument doc; + TQString errMsg; + int errLine; + if ( !doc.setContent( &file, &errMsg, &errLine ) ) + tqFatal( TQString("pytquic: Failed to parse %s: ") + errMsg + TQString (" in line %d\n"), fileName, errLine ); + + TQDomElement e = doc.firstChild().toElement(); + if ( e.hasAttribute("version") && e.attribute("version").toDouble() > 3.3 ) { + tqWarning( TQString("pytquic: File generated with too recent version of TQt Designer (%s vs. %s)"), + e.attribute("version").utf8(), TQT_VERSION_STR ); + return 1; + } + + DomTool::fixDocument( doc ); + + if ( fix ) { + out << doc.toString(); + return 0; + } + + out << "# -*- coding: utf-8 -*-\n\n"; + + if ( !subcl ) { + out << "# Form implementation generated from reading ui file '" << fileName << "'" << endl; + out << "#" << endl; + out << "# Created by: The PyTQt User Interface Compiler (pytquic) " << PYTQT_VERSION << endl; + out << "#" << endl; + out << "# WARNING! All changes made in this file will be lost!" << endl; + out << endl; + out << endl; + } + + if (testCode || execCode) + out << "import sys" << endl; + + out << "from PyTQt.tqt import *" << endl; + + Uic( fileName, outputFile, out, doc, subcl, trmacro, className, uicClass ); + + if (testCode || execCode) { + out << endl; + out << indent << "if __name__ == \"__main__\":" << endl; + ++indent; + out << indent << "a = TQApplication(sys.argv)" << endl; + out << indent << "TQObject.connect(a,SIGNAL(\"lastWindowClosed()\"),a,SLOT(\"quit()\"))" << endl; + out << indent << "w = " << (subcl ? className : uicClass) << "()" << endl; + out << indent << "a.setMainWidget(w)" << endl; + + if (execCode) { + out << indent << "w.show()" << endl; + out << indent << "a.exec_loop()" << endl; + } + + --indent; + } + + return 0; +} diff --git a/pytquic3/object.cpp b/pytquic3/object.cpp new file mode 100644 index 0000000..6b26e8c --- /dev/null +++ b/pytquic3/object.cpp @@ -0,0 +1,704 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of TQt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include "uic.h" +#include "parser.h" +#include "domtool.h" +#include +#include +#include +#define NO_STATIC_COLORS +#include + + +/*! + Creates an implementation for the object given in \a e. + + Traverses recursively over all children. + + Returns the name of the generated child object. + */ + +static bool createdCentralWidget = FALSE; + +TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& par, const TQString& layout ) +{ + TQString parent( par ); + if ( parent == "self" && isMainWindow ) { + if ( !createdCentralWidget ) + out << indent << "self.setCentralWidget(TQWidget(self,\"tqt_central_widget\"))" << endl; + createdCentralWidget = TRUE; + parent = "self.centralWidget()"; + } + TQDomElement n; + TQString objClass, objName, fullObjName; + int numItems = 0; + int numColumns = 0; + int numRows = 0; + + if ( layouts.contains( e.tagName() ) ) + return createLayoutImpl( e, parentClass, parent, layout ); + + objClass = getClassName( e ); + if ( objClass.isEmpty() ) + return objName; + objName = getObjectName( e ); + + TQString definedName = objName; + bool isTmpObject = objName.isEmpty() || objClass == "TQLayoutWidget"; + if ( isTmpObject ) { + if ( objClass[0] == 'Q' ) + objName = objClass.mid(1); + else + objName = objClass.lower(); + } + + bool isLine = objClass == "Line"; + if ( isLine ) + objClass = "TQFrame"; + + out << endl; + if ( objClass == "TQLayoutWidget" ) { + if ( layout.isEmpty() ) { + // register the object and unify its name + objName = registerObject( objName ); + out << indent << objName << " = TQWidget(" << parent << ",\"" << definedName << "\")" << endl; + } else { + // the layout widget is not necessary, hide it by creating its child in the parent + TQString result; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if (tags.contains( n.tagName() ) ) + result = createObjectImpl( n, parentClass, parent, layout ); + } + return result; + } + + // Layouts don't go into the class instance dictionary. + fullObjName = objName; + } else if ( objClass != "TQToolBar" && objClass != "TQMenuBar" ) { + // register the object and unify its name + objName = registerObject( objName ); + + // Temporary objects don't go into the class instance dictionary. + fullObjName = isTmpObject ? objName : "self." + objName; + + out << indent << fullObjName << " = " << createObjectInstance( objClass, parent, objName ) << endl; + } + else + fullObjName = "self." + objName; + + if ( objClass == "TQAxWidget" ) { + TQString controlId; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" && n.attribute( "name" ) == "control" ) { + controlId = n.firstChild().toElement().text(); + } + } + out << indent << fullObjName << ".setControl(\"" << controlId << "\")" << endl; + } + + lastItem = "None"; + // set the properties and insert items + bool hadFrameShadow = FALSE; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + bool stdset = stdsetdef; + if ( n.hasAttribute( "stdset" ) ) + stdset = toBool( n.attribute( "stdset" ) ); + TQString prop = n.attribute( "name" ); + if ( prop == "database" ) + continue; + TQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset ); + if ( value.isEmpty() ) + continue; + if ( prop == "name" ) + continue; + if ( isLine && prop == "frameShadow" ) + hadFrameShadow = TRUE; + if ( prop == "buddy" && value.startsWith("\"") && value.endsWith("\"") ) { + buddies << Buddy( objName, value.mid(1, value.length() - 2 ) ); + continue; + } + if ( isLine && prop == "orientation" ) { + prop = "frameShape"; + if ( value.right(10) == "Horizontal" ) + value = "TQFrame.HLine"; + else + value = "TQFrame.VLine"; + if ( !hadFrameShadow ) { + prop = "frameStyle"; + value += " | TQFrame.Sunken"; + } + } + if ( prop == "buttonGroupId" ) { + if ( parentClass == "TQButtonGroup" ) + out << indent << parent << ".insert( " << fullObjName << "," << value << ")" << endl; + continue; + } + if ( prop == "frameworkCode" ) + continue; + if ( objClass == "TQMultiLineEdit" && + TQRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) ) + continue; + TQString call = fullObjName + "."; + TQString tail; + if ( stdset ) { + call += mkStdSet( prop ) + "("; + tail = ")"; + } else { + call += "setProperty(\"" + prop + "\",TQVariant("; + tail = "))"; + } + if ( prop == "accel" ) { + call += "TQKeySequence("; + tail += ")"; + } + call += value + tail; + + if ( n.firstChild().toElement().tagName() == "string" || + prop == "currentItem" ) { + trout << trindent << call << endl; + } else { + out << indent << call << endl; + } + } else if ( n.tagName() == "item" ) { + TQString call; + TQString value; + + if ( objClass.contains( "ListBox" ) ) { + call = createListBoxItemImpl( n, fullObjName ); + if ( !call.isEmpty() ) { + if ( numItems == 0 ) + trout << trindent << fullObjName << ".clear()" << endl; + trout << trindent << call << endl; + } + } else if ( objClass.contains( "ComboBox" ) ) { + call = createListBoxItemImpl( n, fullObjName, &value ); + if ( !call.isEmpty() ) { + if ( numItems == 0 ) + trout << trindent << fullObjName << ".clear()" << endl; + trout << trindent << call << endl; + } + } else if ( objClass.contains( "IconView" ) ) { + call = createIconViewItemImpl( n, fullObjName ); + if ( !call.isEmpty() ) { + if ( numItems == 0 ) + trout << trindent << fullObjName << ".clear()" << endl; + trout << trindent << call << endl; + } + } else if ( objClass.contains( "ListView" ) ) { + call = createListViewItemImpl( n, fullObjName, TQString::null ); + if ( !call.isEmpty() ) { + if ( numItems == 0 ) + trout << trindent << fullObjName << ".clear()" << endl; + trout << call << endl; + } + } + if ( !call.isEmpty() ) + numItems++; + } else if ( n.tagName() == "column" || n.tagName() == "row" ) { + TQString call; + TQString value; + + if ( objClass.contains( "ListView" ) ) { + call = createListViewColumnImpl( n, fullObjName, &value ); + if ( !call.isEmpty() ) { + out << call; + trout << trindent << fullObjName << ".header().setLabel(" + << numColumns++ << "," << value << ")\n"; + } + } else if ( objClass == "TQTable" || objClass == "TQDataTable" ) { + bool isCols = ( n.tagName() == "column" ); + call = createTableRowColumnImpl( n, fullObjName, &value ); + if ( !call.isEmpty() ) { + out << call; + trout << trindent << fullObjName << "." + << ( isCols ? "horizontalHeader" : "verticalHeader" ) + << "().setLabel(" + << ( isCols ? numColumns++ : numRows++ ) + << "," << value << ")\n"; + } + } + } + } + + // create all children, some widgets have special requirements + + if ( objClass == "TQTabWidget" ) { + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( tags.contains( n.tagName() ) ) { + TQString page = createObjectImpl( n, objClass, fullObjName ); + TQString comment; + TQString label = DomTool::readAttribute( n, "title", "", comment ).toString(); + out << indent << fullObjName << ".insertTab(" << page << ",TQString.fromUtf8(\"\"))" << endl; + trout << trindent << fullObjName << ".changeTab(" << page << "," << trcall( label, comment ) << ")" << endl; + } + } + } else if ( objClass == "TQWidgetStack" ) { + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( tags.contains( n.tagName() ) ) { + TQString page = createObjectImpl( n, objClass, fullObjName ); + int id = DomTool::readAttribute( n, "id", "" ).toInt(); + out << indent << fullObjName << ".addWidget(" << page << "," << id << ")" << endl; + } + } + } else if ( objClass == "TQToolBox" ) { + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( tags.contains( n.tagName() ) ) { + TQString page = createObjectImpl( n, objClass, fullObjName ); + TQString comment; + TQString label = DomTool::readAttribute( n, "label", "", comment ).toString(); + out << indent << fullObjName << ".addItem(" << page << ",TQString.fromUtf8(\"\"))" << endl; + trout << trindent << fullObjName << ".setItemLabel(" << fullObjName + << ".indexOf(" << page << ")," << trcall( label, comment ) + << ")" << endl; + } + } + } else if ( objClass != "TQToolBar" && objClass != "TQMenuBar" ) { // standard widgets + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( tags.contains( n.tagName() ) ) + createObjectImpl( n, objClass, fullObjName ); + } + } + + return fullObjName; +} + + + +/*! + Creates a set-call for property \a exclusiveProp of the object + given in \a e. + + If the object does not have this property, the function does nothing. + + Exclusive properties are used to generate the implementation of + application font or palette change handlers in createFormImpl(). + + */ +void Uic::createExclusiveProperty( const TQDomElement & e, const TQString& exclusiveProp ) +{ + TQDomElement n; + TQString objClass = getClassName( e ); + if ( objClass.isEmpty() ) + return; + TQString objName = getObjectName( e ); +#if 0 // it's not clear whether this check should be here or not + if ( objName.isEmpty() ) + return; +#endif + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + bool stdset = stdsetdef; + if ( n.hasAttribute( "stdset" ) ) + stdset = toBool( n.attribute( "stdset" ) ); + TQString prop = n.attribute( "name" ); + if ( prop != exclusiveProp ) + continue; + TQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset ); + if ( value.isEmpty() ) + continue; + out << indent << indent << objName << ".setProperty(\"" << prop << "\",TQVariant(" << value << "))" << endl; + } + } +} + + +/* Convert a TQSizePolicy::SizeType to text. */ +static TQString mapSizeType(TQSizePolicy::SizeType st) +{ + const char *txt; + + switch (st) + { + case TQSizePolicy::Fixed: + txt = "TQSizePolicy.Fixed"; + break; + + case TQSizePolicy::Minimum: + txt = "TQSizePolicy.Minimum"; + break; + + case TQSizePolicy::Maximum: + txt = "TQSizePolicy.Maximum"; + break; + + case TQSizePolicy::Preferred: + txt = "TQSizePolicy.Preferred"; + break; + + case TQSizePolicy::MinimumExpanding: + txt = "TQSizePolicy.MinimumExpanding"; + break; + + case TQSizePolicy::Expanding: + txt = "TQSizePolicy.Expanding"; + break; + + case TQSizePolicy::Ignored: + txt = "TQSizePolicy.Ignored"; + break; + + default: + txt = "Invalid TQSizePolicy::SizeType"; + } + + return txt; +} + + +/*! Attention: this function has to be in sync with + Resource::saveProperty() and DomTool::elementToVariant. If you + change one, change all. + */ +TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj, const TQString &prop, const TQDomElement &e, bool stdset ) +{ + TQString v; + if ( e.tagName() == "rect" ) { + TQDomElement n3 = e.firstChild().toElement(); + int x = 0, y = 0, w = 0, h = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "x" ) + x = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "y" ) + y = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "width" ) + w = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "height" ) + h = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = "TQRect(%1,%2,%3,%4)"; + v = v.arg(x).arg(y).arg(w).arg(h); + + } else if ( e.tagName() == "point" ) { + TQDomElement n3 = e.firstChild().toElement(); + int x = 0, y = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "x" ) + x = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "y" ) + y = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = "TQPoint(%1,%2)"; + v = v.arg(x).arg(y); + } else if ( e.tagName() == "size" ) { + TQDomElement n3 = e.firstChild().toElement(); + int w = 0, h = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "width" ) + w = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "height" ) + h = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = "TQSize(%1,%2)"; + v = v.arg(w).arg(h); + } else if ( e.tagName() == "color" ) { + TQDomElement n3 = e.firstChild().toElement(); + int r = 0, g = 0, b = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "red" ) + r = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "green" ) + g = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "blue" ) + b = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = "TQColor(%1,%2,%3)"; + v = v.arg(r).arg(g).arg(b); + } else if ( e.tagName() == "font" ) { + TQDomElement n3 = e.firstChild().toElement(); + TQString attrname = e.parentNode().toElement().attribute( "name", "font" ); + TQString fontname; + if ( !obj.isEmpty() ) { + fontname = registerObject( obj + "_" + attrname ); + out << indent << fontname << " = TQFont(self." << obj << ".font())" << endl; + } else { + fontname = registerObject( "f" ); + out << indent << fontname << " = TQFont(self.font())" << endl; + } + while ( !n3.isNull() ) { + if ( n3.tagName() == "family" ) + out << indent << fontname << ".setFamily(\"" << n3.firstChild().toText().data() << "\")" << endl; + else if ( n3.tagName() == "pointsize" ) + out << indent << fontname << ".setPointSize(" << n3.firstChild().toText().data() << ")" << endl; + else if ( n3.tagName() == "bold" ) + out << indent << fontname << ".setBold(" << mkBool( n3.firstChild().toText().data() ) << ")" << endl; + else if ( n3.tagName() == "italic" ) + out << indent << fontname << ".setItalic(" << mkBool( n3.firstChild().toText().data() ) << ")" << endl; + else if ( n3.tagName() == "underline" ) + out << indent << fontname << ".setUnderline(" << mkBool( n3.firstChild().toText().data() ) << ")" << endl; + else if ( n3.tagName() == "strikeout" ) + out << indent << fontname << ".setStrikeOut(" << mkBool( n3.firstChild().toText().data() ) << ")" << endl; + n3 = n3.nextSibling().toElement(); + } + + if ( prop == "font" ) { + if ( !obj.isEmpty() ) + out << indent << "self." << obj << ".setFont(" << fontname << ")" << endl; + else + out << indent << "self.setFont(" << fontname << ")" << endl; + } else { + v = fontname; + } + } else if ( e.tagName() == "string" ) { + TQString txt = e.firstChild().toText().data(); + TQString com = getComment( e.parentNode() ); + + if ( prop == "toolTip" && objClass != "TQAction" && objClass != "TQActionGroup" ) { + if ( !obj.isEmpty() ) + trout << trindent << "TQToolTip.add(self." << obj << "," + << trcall( txt, com ) << ")" << endl; + else + trout << trindent << "TQToolTip.add(self," + << trcall( txt, com ) << ")" << endl; + } else if ( prop == "whatsThis" && objClass != "TQAction" && objClass != "TQActionGroup" ) { + if ( !obj.isEmpty() ) + trout << trindent << "TQWhatsThis.add(self." << obj << "," + << trcall( txt, com ) << ")" << endl; + else + trout << trindent << "TQWhatsThis.add(self," + << trcall( txt, com ) << ")" << endl; + } else { + v = trcall( txt, com ); + } + } else if ( e.tagName() == "cstring" ) { + v = "\"%1\""; + v = v.arg( e.firstChild().toText().data() ); + } else if ( e.tagName() == "number" ) { + v = "%1"; + v = v.arg( e.firstChild().toText().data() ); + } else if ( e.tagName() == "bool" ) { + if ( stdset ) + v = "%1"; + else + v = "TQVariant(%1)"; + v = v.arg( mkBool( e.firstChild().toText().data() ) ); + } else if ( e.tagName() == "pixmap" ) { + v = e.firstChild().toText().data(); + if ( !v.isEmpty() ) { + if ( pixmapLoaderFunction.isEmpty() ) { + v.prepend( "self." ); + } else { + v.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + v.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); + } + } + } else if ( e.tagName() == "iconset" ) { + v = "TQIconSet(%1)"; + TQString s = e.firstChild().toText().data(); + if ( !s.isEmpty() ) { + if ( pixmapLoaderFunction.isEmpty() ) { + s.prepend( "self." ); + } else { + s.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + s.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); + } + } + v = v.arg( s ); + } else if ( e.tagName() == "image" ) { + v = e.firstChild().toText().data() + ".convertToImage()"; + } else if ( e.tagName() == "enum" ) { + v = "%1.%2"; + TQString oc = objClass; + TQString ev = e.firstChild().toText().data(); + if ( oc == "TQListView" && ev == "Manual" ) // #### workaround, rename TQListView::Manual in 4.0 + oc = "TQScrollView"; + v = v.arg( oc ).arg( ev ); + } else if ( e.tagName() == "set" ) { + TQString keys( e.firstChild().toText().data() ); + TQStringList lst = TQStringList::split( '|', keys ); + v = ""; + TQStringList::Iterator it = lst.begin(); + while ( it != lst.end() ) { + v += objClass + "." + *it; + if ( it != lst.fromLast() ) + v += " | "; + ++it; + } + } else if ( e.tagName() == "sizepolicy" ) { + TQDomElement n3 = e.firstChild().toElement(); + TQSizePolicy sp; + while ( !n3.isNull() ) { + if ( n3.tagName() == "hsizetype" ) + sp.setHorData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "vsizetype" ) + sp.setVerData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "horstretch" ) + sp.setHorStretch( n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "verstretch" ) + sp.setVerStretch( n3.firstChild().toText().data().toInt() ); + n3 = n3.nextSibling().toElement(); + } + TQString tmp = "self."; + if ( !obj.isEmpty() ) + tmp += obj + "."; + v = "TQSizePolicy(%1,%2,%3,%4," + tmp + "sizePolicy().hasHeightForWidth())"; + v = v.arg( mapSizeType(sp.horData()) ).arg( mapSizeType(sp.verData()) ).arg( sp.horStretch() ).arg( sp.verStretch() ); + } else if ( e.tagName() == "palette" ) { + TQPalette pal; + bool no_pixmaps = e.elementsByTagName( "pixmap" ).count() == 0; + TQDomElement n; + if ( no_pixmaps ) { + n = e.firstChild().toElement(); + while ( !n.isNull() ) { + TQColorGroup cg; + if ( n.tagName() == "active" ) { + cg = loadColorGroup( n ); + pal.setActive( cg ); + } else if ( n.tagName() == "inactive" ) { + cg = loadColorGroup( n ); + pal.setInactive( cg ); + } else if ( n.tagName() == "disabled" ) { + cg = loadColorGroup( n ); + pal.setDisabled( cg ); + } + n = n.nextSibling().toElement(); + } + } + if ( no_pixmaps && pal == TQPalette( pal.active().button(), pal.active().background() ) ) { + v = "TQPalette(TQColor(%1,%2,%3),TQColor(%1,%2,%3))"; + v = v.arg( pal.active().button().red() ).arg( pal.active().button().green() ).arg( pal.active().button().blue() ); + v = v.arg( pal.active().background().red() ).arg( pal.active().background().green() ).arg( pal.active().background().blue() ); + } else { + TQString palette = "pal"; + if ( !pal_used ) { + out << indent << palette << " = TQPalette()" << endl; + pal_used = TRUE; + } + TQString cg = "cg"; + if ( !cg_used ) { + out << indent << cg << " = TQColorGroup()" << endl; + cg_used = TRUE; + } + n = e.firstChild().toElement(); + while ( !n.isNull() && n.tagName() != "active" ) + n = n.nextSibling().toElement(); + createColorGroupImpl( cg, n ); + out << indent << palette << ".setActive(" << cg << ")" << endl; + + n = e.firstChild().toElement(); + while ( !n.isNull() && n.tagName() != "inactive" ) + n = n.nextSibling().toElement(); + createColorGroupImpl( cg, n ); + out << indent << palette << ".setInactive(" << cg << ")" << endl; + + n = e.firstChild().toElement(); + while ( !n.isNull() && n.tagName() != "disabled" ) + n = n.nextSibling().toElement(); + createColorGroupImpl( cg, n ); + out << indent << palette << ".setDisabled(" << cg << ")" << endl; + v = palette; + } + } else if ( e.tagName() == "cursor" ) { + v = "TQCursor(%1)"; + v = v.arg( e.firstChild().toText().data() ); + } else if ( e.tagName() == "date" ) { + TQDomElement n3 = e.firstChild().toElement(); + int y, m, d; + y = m = d = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "year" ) + y = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "month" ) + m = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "day" ) + d = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = "TQDate(%1,%2,%3)"; + v = v.arg(y).arg(m).arg(d); + } else if ( e.tagName() == "time" ) { + TQDomElement n3 = e.firstChild().toElement(); + int h, m, s; + h = m = s = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "hour" ) + h = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "minute" ) + m = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "second" ) + s = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = "TQTime(%1,%2,%3)"; + v = v.arg(h).arg(m).arg(s); + } else if ( e.tagName() == "datetime" ) { + TQDomElement n3 = e.firstChild().toElement(); + int h, mi, s, y, mo, d; + h = mi = s = y = mo = d = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "hour" ) + h = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "minute" ) + mi = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "second" ) + s = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "year" ) + y = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "month" ) + mo = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "day" ) + d = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = "TQDateTime(TQDate(%1,%2,%3),TQTime(%4,%5,%6))"; + v = v.arg(y).arg(mo).arg(d).arg(h).arg(mi).arg(s); + } else if ( e.tagName() == "stringlist" ) { + TQStringList l; + TQDomElement n3 = e.firstChild().toElement(); + TQString listname = "l"; + if ( !obj.isEmpty() ) { + listname = obj + "_stringlist"; + listname = registerObject( listname ); + out << indent << listname << " = TQStringList()" << endl; + } else { + out << indent << listname << " = TQStringList()" << endl; + } + while ( !n3.isNull() ) { + if ( n3.tagName() == "string" ) + out << indent << listname << ".append(\"" << n3.firstChild().toText().data().simplifyWhiteSpace() << "\")" << endl; + n3 = n3.nextSibling().toElement(); + } + v = listname; + } + return v; +} + + + + +/*! Extracts a named object property from \a e. + */ +TQDomElement Uic::getObjectProperty( const TQDomElement& e, const TQString& name ) +{ + TQDomElement n; + for ( n = e.firstChild().toElement(); + !n.isNull(); + n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" && n.toElement().attribute("name") == name ) + return n; + } + return n; +} + diff --git a/pytquic3/parser.cpp b/pytquic3/parser.cpp new file mode 100644 index 0000000..fc6aae4 --- /dev/null +++ b/pytquic3/parser.cpp @@ -0,0 +1,66 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of TQt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include "parser.h" +#include +#include + +class NormalizeObject : public TQObject +{ +public: + NormalizeObject() : TQObject() {} + static TQCString normalizeSignalSlot( const char *signalSlot ) { return TQObject::normalizeSignalSlot( signalSlot ); } +}; + +TQString Parser::cleanArgs( const TQString &func ) +{ + TQString slot( func ); + int begin = slot.find( "(" ) + 1; + TQString args = slot.mid( begin ); + args = args.left( args.find( ")" ) ); + TQStringList lst = TQStringList::split( ',', args ); + TQString res = slot.left( begin ); + for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { + if ( it != lst.begin() ) + res += ","; + TQString arg = *it; + int pos = 0; + if ( ( pos = arg.find( "&" ) ) != -1 ) { + arg = arg.left( pos + 1 ); + } else if ( ( pos = arg.find( "*" ) ) != -1 ) { + arg = arg.left( pos + 1 ); + } else { + arg = arg.simplifyWhiteSpace(); + if ( ( pos = arg.find( ':' ) ) != -1 ) + arg = arg.left( pos ).simplifyWhiteSpace() + ":" + arg.mid( pos + 1 ).simplifyWhiteSpace(); + TQStringList l = TQStringList::split( ' ', arg ); + if ( l.count() == 2 ) { + if ( l[ 0 ] != "const" && l[ 0 ] != "unsigned" && l[ 0 ] != "var" ) + arg = l[ 0 ]; + } else if ( l.count() == 3 ) { + arg = l[ 0 ] + " " + l[ 1 ]; + } + } + res += arg; + } + res += ")"; + + return TQString::fromUtf8( NormalizeObject::normalizeSignalSlot( res.utf8() ) ); +} diff --git a/pytquic3/parser.h b/pytquic3/parser.h new file mode 100644 index 0000000..5fdbdc2 --- /dev/null +++ b/pytquic3/parser.h @@ -0,0 +1,33 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of TQt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef PARSER_H +#define PARSER_H + +#include + +class Parser +{ +public: + static TQString cleanArgs( const TQString &func ); + +}; + +#endif diff --git a/pytquic3/pytquic-prof.sbf b/pytquic3/pytquic-prof.sbf new file mode 100644 index 0000000..8a5cfa7 --- /dev/null +++ b/pytquic3/pytquic-prof.sbf @@ -0,0 +1,24 @@ +# This is the build file for pytquic for TQt v3 Professional Edition. +# +# Copyright (c) 2007 +# Riverbank Computing Limited +# +# 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. + +target = pytquic +sources = main.cpp uic.cpp form.cpp object.cpp subclassing.cpp embed.cpp widgetdatabase.cpp domtool.cpp parser.cpp tqdom.cpp tqxml.cpp +headers = domtool.h globaldefs.h parser.h uic.h widgetdatabase.h widgetinterface.h diff --git a/pytquic3/pytquic.pro.in b/pytquic3/pytquic.pro.in new file mode 100644 index 0000000..326e0e5 --- /dev/null +++ b/pytquic3/pytquic.pro.in @@ -0,0 +1,36 @@ +# Copyright (c) 2001 +# Phil Thompson +# Copyright (c) 2002, 2003 +# Riverbank Computing Limited +# +# The project file for pytquic for TQt v3. + + +TEMPLATE = app +CONFIG += tqt console warn_on release @PYTQT_RBPROF@ +INCLUDEPATH += @BLX_INCLUDEPATH@ $(TQTDIR)/src/3rdparty/zlib +DEFINES += UIC TQT_INTERNAL_XML @BLX_DEFINES@ + +DESTDIR = @PYTQT_BINDIR@ +TARGET = pytquic + +HEADERS = uic.h \ + widgetdatabase.h \ + domtool.h \ + parser.h \ + widgetinterface.h + +SOURCES = main.cpp \ + uic.cpp \ + form.cpp \ + object.cpp \ + subclassing.cpp \ + embed.cpp \ + widgetdatabase.cpp \ + domtool.cpp \ + parser.cpp + +rbprof:exists($(TQTDIR)/src/tqt_professional.pri) { + TQT_SOURCE_TREE = $(TQTDIR) + include($(TQTDIR)/src/tqt_professional.pri) +} diff --git a/pytquic3/pytquic.sbf b/pytquic3/pytquic.sbf new file mode 100644 index 0000000..86360b6 --- /dev/null +++ b/pytquic3/pytquic.sbf @@ -0,0 +1,24 @@ +# This is the build file for pytquic for TQt v3. +# +# Copyright (c) 2007 +# Riverbank Computing Limited +# +# 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. + +target = pytquic +sources = main.cpp uic.cpp form.cpp object.cpp subclassing.cpp embed.cpp widgetdatabase.cpp domtool.cpp parser.cpp +headers = domtool.h globaldefs.h parser.h uic.h widgetdatabase.h widgetinterface.h diff --git a/pytquic3/subclassing.cpp b/pytquic3/subclassing.cpp new file mode 100644 index 0000000..9cb1ee1 --- /dev/null +++ b/pytquic3/subclassing.cpp @@ -0,0 +1,185 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of TQt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include "uic.h" +#include "parser.h" +#include "widgetdatabase.h" +#include "domtool.h" +#include +#include +#include +#define NO_STATIC_COLORS +#include +#include +#include +#include + + +/*! + Creates an implementation for a subclass \a subClass of the form + given in \a e + + \sa createSubDecl() + */ +void Uic::createSubImpl( const TQDomElement &e, const TQString& subClass ) +{ + TQDomElement n; + TQDomNodeList nl; + int i; + + TQString objClass = getClassName( e ); + if ( objClass.isEmpty() ) + return; + + TQString supClsMod = fileName; + int tail = supClsMod.findRev('.',-1); + if (tail >= 0) + supClsMod.truncate(tail); + + out << indent << "from " << supClsMod << " import " << nameOfClass << endl; + out << endl; + out << endl; + + out << indent << "class " << subClass << "(" << nameOfClass << "):" << endl; + ++indent; + out << endl; + + // constructor + if ( objClass == "TQDialog" || objClass == "TQWizard" ) { + out << indent << "def __init__(self,parent = None,name = None,modal = 0,fl = 0):" << endl; + ++indent; + out << indent << nameOfClass << ".__init__(self,parent,name,modal,fl)" << endl; + } else { // standard TQWidget + out << indent << "def __init__(self,parent = None,name = None,fl = 0):" << endl; + ++indent; + out << indent << nameOfClass << ".__init__(self,parent,name,fl)" << endl; + } + --indent; + + // find additional functions + TQStringList publicSlots, protectedSlots, privateSlots; + TQStringList publicSlotTypes, protectedSlotTypes, privateSlotTypes; + TQStringList publicSlotSpecifier, protectedSlotSpecifier, privateSlotSpecifier; + TQStringList publicFuncts, protectedFuncts, privateFuncts; + TQStringList publicFunctRetTyp, protectedFunctRetTyp, privateFunctRetTyp; + TQStringList publicFunctSpec, protectedFunctSpec, privateFunctSpec; + + nl = e.parentNode().toElement().elementsByTagName( "slot" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + n = nl.item(i).toElement(); + if ( n.parentNode().toElement().tagName() != "slots" + && n.parentNode().toElement().tagName() != "connections" ) + continue; + if ( n.attribute( "language", "C++" ) != "C++" ) + continue; + TQString returnType = n.attribute( "returnType", "void" ); + TQString functionName = n.firstChild().toText().data().stripWhiteSpace(); + if ( functionName.endsWith( ";" ) ) + functionName = functionName.left( functionName.length() - 1 ); + TQString specifier = n.attribute( "specifier" ); + TQString access = n.attribute( "access" ); + if ( access == "protected" ) { + protectedSlots += functionName; + protectedSlotTypes += returnType; + protectedSlotSpecifier += specifier; + } else if ( access == "private" ) { + privateSlots += functionName; + privateSlotTypes += returnType; + privateSlotSpecifier += specifier; + } else { + publicSlots += functionName; + publicSlotTypes += returnType; + publicSlotSpecifier += specifier; + } + } + + nl = e.parentNode().toElement().elementsByTagName( "function" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + n = nl.item(i).toElement(); + if ( n.parentNode().toElement().tagName() != "functions" ) + continue; + if ( n.attribute( "language", "C++" ) != "C++" ) + continue; + TQString returnType = n.attribute( "returnType", "void" ); + TQString functionName = n.firstChild().toText().data().stripWhiteSpace(); + if ( functionName.endsWith( ";" ) ) + functionName = functionName.left( functionName.length() - 1 ); + TQString specifier = n.attribute( "specifier" ); + TQString access = n.attribute( "access" ); + if ( access == "protected" ) { + protectedFuncts += functionName; + protectedFunctRetTyp += returnType; + protectedFunctSpec += specifier; + } else if ( access == "private" ) { + privateFuncts += functionName; + privateFunctRetTyp += returnType; + privateFunctSpec += specifier; + } else { + publicFuncts += functionName; + publicFunctRetTyp += returnType; + publicFunctSpec += specifier; + } + } + + if ( !publicFuncts.isEmpty() ) + writeFunctionsSubImpl( publicFuncts, publicFunctRetTyp, publicFunctSpec, subClass, "public function" ); + + // create stubs for public additional slots + if ( !publicSlots.isEmpty() ) + writeFunctionsSubImpl( publicSlots, publicSlotTypes, publicSlotSpecifier, subClass, "public slot" ); + + if ( !protectedFuncts.isEmpty() ) + writeFunctionsSubImpl( protectedFuncts, protectedFunctRetTyp, protectedFunctSpec, subClass, "protected function" ); + + // create stubs for protected additional slots + if ( !protectedSlots.isEmpty() ) + writeFunctionsSubImpl( protectedSlots, protectedSlotTypes, protectedSlotSpecifier, subClass, "protected slot" ); + + if ( !privateFuncts.isEmpty() ) + writeFunctionsSubImpl( privateFuncts, privateFunctRetTyp, privateFunctSpec, subClass, "private function" ); + + // create stubs for private additional slots + if ( !privateSlots.isEmpty() ) + writeFunctionsSubImpl( privateSlots, privateSlotTypes, privateSlotSpecifier, subClass, "private slot" ); + + --indent; +} + +void Uic::writeFunctionsSubImpl( const TQStringList &fuLst, const TQStringList &typLst, const TQStringList &specLst, + const TQString &subClass, const TQString &descr ) +{ + TQValueListConstIterator it, it2, it3; + for ( it = fuLst.begin(), it2 = typLst.begin(), it3 = specLst.begin(); + it != fuLst.end(); ++it, ++it2, ++it3 ) { + TQString type = *it2; + if ( type.isEmpty() ) + type = "void"; + if ( *it3 == "non virtual" ) + continue; + out << endl; + out << indent << "# " << descr << endl; + pySlot(it); + ++indent; + out << endl; + out << indent << "print(\"" << subClass << "." << (*it) << ": Not implemented yet\")" << endl; + --indent; + } + out << endl; +} diff --git a/pytquic3/uic.cpp b/pytquic3/uic.cpp new file mode 100644 index 0000000..8d0613c --- /dev/null +++ b/pytquic3/uic.cpp @@ -0,0 +1,1145 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** Copyright (c) 2004 Phil Thompson +** +** This file is part of TQt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include "uic.h" +#include "parser.h" +#include "widgetdatabase.h" +#include "domtool.h" +#include +#include +#include +#define NO_STATIC_COLORS +#include +#include +#include +#include + +bool Uic::isMainWindow = FALSE; +PyIndent Uic::indent; +PyIndent Uic::trindent; + + +// Re-calculate the indent string based on the current number and nature of the +// indent. +void PyIndent::calc() +{ + indstr.truncate(0); + + for (uint i = current; i > 0; --i) + if (tabStop == 0) + indstr += '\t'; + else + for (uint t = 0; t < tabStop; ++t) + indstr += ' '; +} + + +TQString Uic::getComment( const TQDomNode& n ) +{ + TQDomNode child = n.firstChild(); + while ( !child.isNull() ) { + if ( child.toElement().tagName() == "comment" ) + return child.toElement().firstChild().toText().data(); + child = child.nextSibling(); + } + return TQString::null; +} + +TQString Uic::mkBool( bool b ) +{ + return b? "1" : "0"; +} + +TQString Uic::mkBool( const TQString& s ) +{ + return mkBool( s == "true" || s == "1" ); +} + +bool Uic::toBool( const TQString& s ) +{ + return s == "true" || s.toInt() != 0; +} + +TQString Uic::fixString( const TQString &str, bool encode ) +{ +#if TQT_VERSION >= 0x030100 + TQString s; + if ( !encode ) { + s = str; + s.replace( "\\", "\\\\" ); + s.replace( "\"", "\\\"" ); + s.replace( "\r", "" ); + s.replace( "\n", "\\n\"\n\"" ); + } else { + TQCString utf8 = str.utf8(); + const int l = utf8.length(); + + for ( int i = 0; i < l; ++i ) { + uchar ch = (uchar)utf8[i]; + + if (ch != 0x0d) { // skip \r + s += "\\x"; + + if (ch <= 0x0f) + s += "0"; + + s += TQString::number( ch, 16 ); + } + } + } +#else + TQString s( str ); + s.replace( TQRegExp( "\\\\" ), "\\\\" ); + s.replace( TQRegExp( "\"" ), "\\\"" ); + s.replace( TQRegExp( "\r?\n" ), "\\n\"\n\"" ); +#endif + return "\"" + s + "\""; +} + +TQString Uic::trcall( const TQString& sourceText, const TQString& comment ) +{ + if ( sourceText.isEmpty() && comment.isEmpty() ) + return "TQString.null"; + + TQString t = trmacro; + bool encode = FALSE; + if ( t.isNull() ) { + t = "self.__tr"; + for ( int i = 0; i < (int) sourceText.length(); i++ ) { + if ( sourceText[i].unicode() >= 0x80 ) { + t = "self.__trUtf8"; + encode = TRUE; + break; + } + } + + if (encode) + pyNeedTrUtf8 = TRUE; + else + pyNeedTr = TRUE; + } + + if ( comment.isEmpty() ) { + return t + "(" + fixString( sourceText, encode ) + ")"; + } else { + return t + "(" + fixString( sourceText, encode ) + "," + + fixString( comment, encode ) + ")"; + } +} + +TQString Uic::mkStdSet( const TQString& prop ) +{ + return TQString( "set" ) + prop[0].upper() + prop.mid(1); +} + + + +/*! + \class Uic uic.h + \brief User Interface Compiler + + The class Uic encapsulates the user interface compiler (uic). + */ +Uic::Uic( const TQString &fn, const char *outputFn, TQTextStream &outStream, + TQDomDocument doc, bool subcl, const TQString &trm, + const TQString& subClass, TQString &uicClass ) + : out( outStream ), trout (&languageChangeBody ), + outputFileName( outputFn ), trmacro( trm ), + pyNeedTr(FALSE), pyNeedTrUtf8(FALSE) +{ + fileName = fn; + writeFunctImpl = TRUE; + defMargin = BOXLAYOUT_DEFAULT_MARGIN; + defSpacing = BOXLAYOUT_DEFAULT_SPACING; + externPixmaps = FALSE; + + trindent.setIndent(2); + + item_used = cg_used = pal_used = 0; + + layouts << "hbox" << "vbox" << "grid"; + tags = layouts; + tags << "widget"; + + pixmapLoaderFunction = getPixmapLoaderFunction( doc.firstChild().toElement() ); + nameOfClass = getFormClassName( doc.firstChild().toElement() ); + +#if TQT_VERSION >= 0x030300 + uiFileVersion = doc.firstChild().toElement().attribute("version"); +#endif + stdsetdef = toBool( doc.firstChild().toElement().attribute("stdsetdef") ); + + if ( doc.firstChild().isNull() || doc.firstChild().firstChild().isNull() ) + return; + + // Extract any Python code in the comments. + TQStringList comm = TQStringList::split('\n',getComment(doc.firstChild())); + + for (TQStringList::Iterator it = comm.begin(); it != comm.end(); ++it) + if ((*it).startsWith("Python:")) + pyCode += (*it).mid(7) + "\n"; + + TQDomElement e = doc.firstChild().firstChild().toElement(); + TQDomElement widget; + while ( !e.isNull() ) { + if ( e.tagName() == "widget" ) { + widget = e; + } else if ( e.tagName() == "pixmapinproject" ) { + externPixmaps = TRUE; + } else if ( e.tagName() == "layoutdefaults" ) { + defSpacing = e.attribute( "spacing", defSpacing.toString() ); + defMargin = e.attribute( "margin", defMargin.toString() ); + } else if ( e.tagName() == "layoutfunctions" ) { + defSpacing = e.attribute( "spacing", defSpacing.toString() ); + + bool ok; + defSpacing.toInt( &ok ); + if ( !ok ) { + TQString buf = defSpacing.toString(); + defSpacing = buf.append( "()" ); + } + defMargin = e.attribute( "margin", defMargin.toString() ); + defMargin.toInt( &ok ); + if ( !ok ) { + TQString buf = defMargin.toString(); + defMargin = buf.append( "()" ); + } + } + e = e.nextSibling().toElement(); + } + e = widget; + + if ( nameOfClass.isEmpty() ) + nameOfClass = getObjectName( e ); + + uicClass = nameOfClass; + + namespaces = TQStringList::split( "::", nameOfClass ); + bareNameOfClass = namespaces.last(); + namespaces.remove( namespaces.fromLast() ); + + if ( subcl ) { + createSubImpl( e, subClass ); + } else { + createFormImpl( e ); + } + + ++indent; + + if (pyNeedTr) + { + out << "\n"; + out << indent << "def __tr(self,s,c = None):\n"; + ++indent; + out << indent << "return tqApp.translate(b\"" << nameOfClass << "\",s.encode(),c)\n"; + --indent; + } + + if (pyNeedTrUtf8) + { + out << "\n"; + out << indent << "def __trUtf8(self,s,c = None):\n"; + ++indent; + out << indent << "return tqApp.translate(b\"" << nameOfClass << "\",s.encode(),c,TQApplication.UnicodeUTF8)\n"; + --indent; + } + + --indent; +} + +/*! Extracts a pixmap loader function from \a e + */ +TQString Uic::getPixmapLoaderFunction( const TQDomElement& e ) +{ + TQDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "pixmapfunction" ) + return n.firstChild().toText().data(); + } + return TQString::null; +} + + +/*! Extracts the forms class name from \a e + */ +TQString Uic::getFormClassName( const TQDomElement& e ) +{ + TQDomElement n; + TQString cn; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "class" ) { + TQString s = n.firstChild().toText().data(); + int i; + while ( ( i = s.find(' ' )) != -1 ) + s[i] = '_'; + cn = s; + } + } + return cn; +} + +/*! Extracts a class name from \a e. + */ +TQString Uic::getClassName( const TQDomElement& e ) +{ + TQString s = e.attribute( "class" ); + if ( s.isEmpty() && e.tagName() == "toolbar" ) + s = "TQToolBar"; + else if ( s.isEmpty() && e.tagName() == "menubar" ) + s = "TQMenuBar"; + return s; +} + +/*! Returns TRUE if database framework code is generated, else FALSE. +*/ + +bool Uic::isFrameworkCodeGenerated( const TQDomElement& e ) +{ + TQDomElement n = getObjectProperty( e, "frameworkCode" ); + if ( n.attribute("name") == "frameworkCode" && + !DomTool::elementToVariant( n.firstChild().toElement(), TQVariant( TRUE ) ).toBool() ) + return FALSE; + return TRUE; +} + +/*! Extracts an object name from \a e. It's stored in the 'name' + property. + */ +TQString Uic::getObjectName( const TQDomElement& e ) +{ + TQDomElement n = getObjectProperty( e, "name" ); + if ( n.firstChild().toElement().tagName() == "cstring" ) + return n.firstChild().toElement().firstChild().toText().data(); + return TQString::null; +} + +/*! Extracts an layout name from \a e. It's stored in the 'name' + property of the preceeding sibling (the first child of a TQLayoutWidget). + */ +TQString Uic::getLayoutName( const TQDomElement& e ) +{ + TQDomElement p = e.parentNode().toElement(); + TQString name; + + if ( getClassName(p) != "TQLayoutWidget" ) + name = "Layout"; + + TQDomElement n = getObjectProperty( p, "name" ); + if ( n.firstChild().toElement().tagName() == "cstring" ) { + name.prepend( n.firstChild().toElement().firstChild().toText().data() ); + return TQStringList::split( "::", name ).last(); + } + return e.tagName(); +} + + +TQString Uic::getDatabaseInfo( const TQDomElement& e, const TQString& tag ) +{ + TQDomElement n; + TQDomElement n1; + int child = 0; + // database info is a stringlist stored in this order + if ( tag == "connection" ) + child = 0; + else if ( tag == "table" ) + child = 1; + else if ( tag == "field" ) + child = 2; + else + return TQString::null; + n = getObjectProperty( e, "database" ); + if ( n.firstChild().toElement().tagName() == "stringlist" ) { + // find correct stringlist entry + TQDomElement n1 = n.firstChild().firstChild().toElement(); + for ( int i = 0; i < child && !n1.isNull(); ++i ) + n1 = n1.nextSibling().toElement(); + if ( n1.isNull() ) + return TQString::null; + return n1.firstChild().toText().data(); + } + return TQString::null; +} + + +/*! + Returns include file for class \a className or a null string. + */ +TQString Uic::getInclude( const TQString& className ) +{ + int wid = WidgetDatabase::idFromClassName( className ); + if ( wid != -1 ) + return WidgetDatabase::includeFile( wid ); + return TQString::null; +} + + +void Uic::createActionImpl( const TQDomElement &n, const TQString &parent ) +{ + for ( TQDomElement ae = n; !ae.isNull(); ae = ae.nextSibling().toElement() ) { + TQString objName = registerObject( getObjectName( ae ) ); + if ( ae.tagName() == "action" ) + out << indent << "self." << objName << " = TQAction(" << parent << ",\"" << objName << "\")" << endl; + else if ( ae.tagName() == "actiongroup" ) + out << indent << "self." << objName << " = TQActionGroup(" << parent << ",\"" << objName << "\")" << endl; + else + continue; + bool subActionsDone = FALSE; +#if TQT_VERSION >= 0x030300 + bool hasMenuText = FALSE; + TQString actionText; +#endif + for ( TQDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + if ( n2.tagName() == "property" ) { + bool stdset = stdsetdef; + if ( n2.hasAttribute( "stdset" ) ) + stdset = toBool( n2.attribute( "stdset" ) ); + TQString prop = n2.attribute("name"); + if ( prop == "name" ) + continue; + TQString value = setObjectProperty( "TQAction", objName, prop, n2.firstChild().toElement(), stdset ); + if ( value.isEmpty() ) + continue; + + TQString call = "self." + objName + "."; + if ( stdset ) + call += mkStdSet( prop ) + "(" + value + ")"; + else + call += "setProperty(\"" + prop + "\",TQVariant(" + value + "))"; + +#if TQT_VERSION >= 0x030300 + if (prop == "menuText") + hasMenuText = TRUE; + else if (prop == "text") + actionText = value; +#endif + + if ( n2.firstChild().toElement().tagName() == "string" ) { + trout << trindent << call << endl; + } else { + out << indent << call << endl; + } + } else if ( !subActionsDone && ( n2.tagName() == "actiongroup" || n2.tagName() == "action" ) ) { + createActionImpl( n2, "self." + objName ); + subActionsDone = TRUE; + } + } +#if TQT_VERSION >= 0x030300 + // workaround for loading pre-3.3 files expecting bogus TQAction behavior + if (!hasMenuText && !actionText.isEmpty() && uiFileVersion < "3.3") + trout << indent << "self." << objName << ".setMenuText(" << actionText << ")" << endl; +#endif + } +} + +TQString get_dock( const TQString &d ) +{ + if ( d == "0" ) + return "TQt.DockUnmanaged"; + if ( d == "1" ) + return "TQt.DockTornOff"; + if ( d == "2" ) + return "TQt.DockTop"; + if ( d == "3" ) + return "TQt.DockBottom"; + if ( d == "4" ) + return "TQt.DockRight"; + if ( d == "5" ) + return "TQt.DockLeft"; + if ( d == "6" ) + return "TQt.DockMinimized"; + return ""; +} + +void Uic::createToolbarImpl( const TQDomElement &n, const TQString &parentClass, const TQString &parent ) +{ + TQDomNodeList nl = n.elementsByTagName( "toolbar" ); + for ( int i = 0; i < (int) nl.length(); i++ ) { + TQDomElement ae = nl.item( i ).toElement(); + TQString dock = get_dock( ae.attribute( "dock" ) ); + TQString objName = getObjectName( ae ); + out << indent << "self." << objName << " = TQToolBar(TQString(\"\"),self," << dock << ")" << endl; + createObjectImpl( ae, parentClass, parent ); + for ( TQDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + if ( n2.tagName() == "action" ) { + out << indent << "self." << n2.attribute( "name" ) << ".addTo(self." << objName << ")" << endl; + } else if ( n2.tagName() == "separator" ) { + out << indent << "self." << objName << ".addSeparator()" << endl; + } else if ( n2.tagName() == "widget" ) { + if ( n2.attribute( "class" ) != "Spacer" ) { + createObjectImpl( n2, "TQToolBar", "self." + objName ); + } else { + TQString child = createSpacerImpl( n2, parentClass, parent, objName ); + out << indent << "TQApplication.sendPostedEvents(self." << objName + << ",TQEvent.ChildInserted)" << endl; + out << indent << "self." << objName << ".boxLayout().addItem(" << child << ")" << endl; + } + } + } + } +} + +void Uic::createMenuBarImpl( const TQDomElement &n, const TQString &parentClass, const TQString &parent ) +{ + TQString objName = getObjectName( n ); + out << indent << "self." << objName << " = TQMenuBar(self,\"" << objName << "\")" << endl; + createObjectImpl( n, parentClass, parent ); + + int i = 0; + TQDomElement c = n.firstChild().toElement(); + while ( !c.isNull() ) { + if ( c.tagName() == "item" ) { + TQString itemName = "self." + c.attribute( "name" ); + out << endl; + out << indent << itemName << " = TQPopupMenu(self)" << endl; + createPopupMenuImpl( c, parentClass, itemName ); + out << indent << "self." << objName << ".insertItem(TQString(\"\")," << itemName << "," << i << ")" << endl; + TQString findItem("self." + objName + ".findItem(%1)"); + findItem = findItem.arg(i); + trout << indent << "if " << findItem << ":" << endl; + ++indent; + trout << indent << findItem << ".setText(" << trcall( c.attribute( "text" ) ) << ")" << endl; + --indent; + } else if ( c.tagName() == "separator" ) { + out << endl; + out << indent << "self." << objName << ".insertSeparator(" << i << ")" << endl; + } + c = c.nextSibling().toElement(); + i++; + } +} + +void Uic::createPopupMenuImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent ) +{ + int i = 0; + for ( TQDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "action" || n.tagName() == "actiongroup" ) { + TQDomElement n2 = n.nextSibling().toElement(); + if ( n2.tagName() == "item" ) { // the action has a sub menu + TQString itemName = "self." + n2.attribute( "name" ); + TQString itemText = n2.attribute( "text" ); + out << indent << itemName << " = TQPopupMenu(self)" << endl; + out << indent << parent << ".setAccel(" << trcall( n2.attribute( "accel" ) ) << ","; + out << parent << ".insertItem(" << "self." << n.attribute( "name" ) << ".iconSet(),"; + out << trcall( itemText ) << "," << itemName << "))" << endl; + trout << indent << parent << ".changeItem(" << parent << ".idAt(" << i << "),"; + trout << trcall( itemText ) << ")" << endl; + createPopupMenuImpl( n2, parentClass, itemName ); + n = n2; + } else { + out << indent << "self." << n.attribute( "name" ) << ".addTo(" << parent << ")" << endl; + } + } else if ( n.tagName() == "separator" ) { + out << indent << parent << ".insertSeparator()" << endl; + } + ++i; + } +} + +/*! + Creates implementation of an listbox item tag. +*/ + +TQString Uic::createListBoxItemImpl( const TQDomElement &e, const TQString &parent , + TQString *value ) +{ + TQDomElement n = e.firstChild().toElement(); + TQString txt; + TQString com; + TQString pix; + while ( !n.isNull() ) { + if ( n.tagName() == "property" ) { + TQString attrib = n.attribute( "name" ); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); + if ( attrib == "text" ) { + txt = v.toString(); + com = getComment( n ); + } else if ( attrib == "pixmap" ) { + pix = v.toString(); + if ( !pix.isEmpty() ) { + if ( pixmapLoaderFunction.isEmpty() ) { + pix.prepend( "self." ); + } else { + pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "self." ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); + } + } + } + } + n = n.nextSibling().toElement(); + } + + if ( value ) + *value = trcall( txt, com ); + + if ( pix.isEmpty() ) + return parent + ".insertItem(" + trcall( txt, com ) + ")"; + + return parent + ".insertItem(" + pix + "," + trcall( txt, com ) + ")"; +} + +/*! + Creates implementation of an iconview item tag. +*/ + +TQString Uic::createIconViewItemImpl( const TQDomElement &e, const TQString &parent ) +{ + TQDomElement n = e.firstChild().toElement(); + TQString txt; + TQString com; + TQString pix; + while ( !n.isNull() ) { + if ( n.tagName() == "property" ) { + TQString attrib = n.attribute( "name" ); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); + if ( attrib == "text" ) { + txt = v.toString(); + com = getComment( n ); + } else if ( attrib == "pixmap" ) { + pix = v.toString(); + if ( !pix.isEmpty() ) { + if ( pixmapLoaderFunction.isEmpty() ) { + pix.prepend( "self." ); + } else { + pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "self." ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); + } + } + } + } + n = n.nextSibling().toElement(); + } + + if ( pix.isEmpty() ) + return "TQIconViewItem(" + parent + "," + trcall( txt, com ) + ")"; + else + return "TQIconViewItem(" + parent + "," + trcall( txt, com ) + "," + pix + ")"; +} + +/*! + Creates implementation of an listview item tag. +*/ + +TQString Uic::createListViewItemImpl( const TQDomElement &e, const TQString &parent, + const TQString &parentItem ) +{ + TQString s; + + TQDomElement n = e.firstChild().toElement(); + + bool hasChildren = e.elementsByTagName( "item" ).count() > 0; + TQString item; + + if ( hasChildren ) { + item = registerObject( "item" ); + } else { + item = "item"; + item_used = TRUE; + } + s = trindent + item + " = "; + + if ( !parentItem.isEmpty() ) + s += "TQListViewItem(" + parentItem + "," + lastItem + ")\n"; + else + s += "TQListViewItem(" + parent + "," + lastItem + ")\n"; + + TQStringList texts; + TQStringList pixmaps; + while ( !n.isNull() ) { + if ( n.tagName() == "property" ) { + TQString attrib = n.attribute("name"); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); + if ( attrib == "text" ) + texts << v.toString(); + else if ( attrib == "pixmap" ) { + TQString pix = v.toString(); + if ( !pix.isEmpty() ) { + if ( pixmapLoaderFunction.isEmpty() ) { + pix.prepend( "self." ); + } else { + pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "self." ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); + } + } + pixmaps << pix; + } + } else if ( n.tagName() == "item" ) { + s += trindent + item + ".setOpen(1)\n"; + s += createListViewItemImpl( n, parent, item ); + } + n = n.nextSibling().toElement(); + } + + for ( int i = 0; i < (int)texts.count(); ++i ) { + if ( !texts[ i ].isEmpty() ) + s += trindent + item + ".setText(" + TQString::number( i ) + "," + trcall( texts[ i ] ) + ")\n"; + if ( !pixmaps[ i ].isEmpty() ) + s += trindent + item + ".setPixmap(" + TQString::number( i ) + "," + pixmaps[ i ] + ")\n"; + } + + lastItem = item; + return s; +} + +/*! + Creates implementation of an listview column tag. +*/ + +TQString Uic::createListViewColumnImpl( const TQDomElement &e, const TQString &parent, + TQString *value ) +{ + TQDomElement n = e.firstChild().toElement(); + TQString txt; + TQString com; + TQString pix; + bool clickable = FALSE, resizable = FALSE; + while ( !n.isNull() ) { + if ( n.tagName() == "property" ) { + TQString attrib = n.attribute("name"); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); + if ( attrib == "text" ) { + txt = v.toString(); + com = getComment( n ); + } else if ( attrib == "pixmap" ) { + pix = v.toString(); + if ( !pix.isEmpty() ) { + if ( pixmapLoaderFunction.isEmpty() ) { + pix.prepend( "self." ); + } else { + pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "self." ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); + } + } + } else if ( attrib == "clickable" ) + clickable = v.toBool(); + else if ( attrib == "resizable" || attrib == "resizeable" ) + resizable = v.toBool(); + } + n = n.nextSibling().toElement(); + } + + if ( value ) + *value = trcall( txt, com ); + + TQString s; + s = indent + parent + ".addColumn(" + trcall( txt, com ) + ")\n"; + if ( !pix.isEmpty() ) + s += indent + parent + ".header().setLabel(" + parent + ".header().count() - 1,TQIconSet(" + pix + ")," + trcall( txt, com ) + ")\n"; + if ( !clickable ) + s += indent + parent + ".header().setClickEnabled(0," + parent + ".header().count() - 1)\n"; + if ( !resizable ) + s += indent + parent + ".header().setResizeEnabled(0," + parent + ".header().count() - 1)\n"; + return s; +} + +TQString Uic::createTableRowColumnImpl( const TQDomElement &e, const TQString &parent, + TQString *value ) +{ + TQString objClass = getClassName( e.parentNode().toElement() ); + TQDomElement n = e.firstChild().toElement(); + TQString txt; + TQString com; + TQString pix; + TQString field; + bool isRow = e.tagName() == "row"; + while ( !n.isNull() ) { + if ( n.tagName() == "property" ) { + TQString attrib = n.attribute("name"); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); + if ( attrib == "text" ) { + txt = v.toString(); + com = getComment( n ); + } else if ( attrib == "pixmap" ) { + pix = v.toString(); + if ( !pix.isEmpty() ) { + if ( pixmapLoaderFunction.isEmpty() ) { + pix.prepend( "self." ); + } else { + pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "self." ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); + } + } + } else if ( attrib == "field" ) + field = v.toString(); + } + n = n.nextSibling().toElement(); + } + + if ( value ) + *value = trcall( txt, com ); + + // ### This generated code sucks! We have to set the number of + // rows/cols before and then only do setLabel/() + // ### careful, though, since TQDataTable has an API which makes this code pretty good + + TQString s; + if ( isRow ) { + s = indent + parent + ".setNumRows(" + parent + ".numRows() + 1)\n"; + if ( pix.isEmpty() ) + s += indent + parent + ".verticalHeader().setLabel(" + parent + ".numRows() - 1," + + trcall( txt, com ) + ")\n"; + else + s += indent + parent + ".verticalHeader().setLabel(" + parent + ".numRows() - 1,TQIconSet(" + + pix + ")," + trcall( txt, com ) + ")\n"; + } else { + if ( objClass == "TQTable" ) { + s = indent + parent + ".setNumCols(" + parent + ".numCols() + 1)\n"; + if ( pix.isEmpty() ) + s += indent + parent + ".horizontalHeader().setLabel(" + parent + ".numCols() - 1," + + trcall( txt, com ) + ")\n"; + else + s += indent + parent + ".horizontalHeader().setLabel(" + parent + ".numCols() - 1,TQIconSet(" + + pix + ")," + trcall( txt, com ) + ")\n"; + } else if ( objClass == "TQDataTable" ) { + if ( !txt.isEmpty() && !field.isEmpty() ) { + if ( pix.isEmpty() ) + out << indent << parent << ".addColumn(" << fixString( field ) << "," << trcall( txt, com ) << ")" << endl; + else + out << indent << parent << ".addColumn(" << fixString( field ) << "," << trcall( txt, com ) << ",TQIconSet(" << pix << "))" << endl; + } + } + } + return s; +} + +/*! + Creates the implementation of a layout tag. Called from createObjectImpl(). + */ +TQString Uic::createLayoutImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout ) +{ + TQDomElement n; + TQString objClass, objName; + objClass = e.tagName(); + + TQString qlayout = "TQVBoxLayout"; + if ( objClass == "hbox" ) + qlayout = "TQHBoxLayout"; + else if ( objClass == "grid" ) + qlayout = "TQGridLayout"; + + bool isGrid = e.tagName() == "grid" ; + objName = registerObject( getLayoutName( e ) ); + layoutObjects += objName; + + TQString margin = DomTool::readProperty( e, "margin", defMargin ).toString(); + TQString spacing = DomTool::readProperty( e, "spacing", defSpacing ).toString(); + TQString resizeMode = DomTool::readProperty( e, "resizeMode", TQString::null ).toString(); + + TQString optcells; + if ( isGrid ) + optcells = "1,1,"; + if ( (parentClass == "TQGroupBox" || parentClass == "TQButtonGroup") && layout.isEmpty() ) { + // special case for group box + out << indent << parent << ".setColumnLayout(0,TQt.Vertical)" << endl; + out << indent << parent << ".layout().setSpacing(" << spacing << ")" << endl; + out << indent << parent << ".layout().setMargin(" << margin << ")" << endl; + out << indent << objName << " = " << qlayout << "(" << parent << ".layout())" << endl; + out << indent << objName << ".setAlignment(TQt.AlignTop)" << endl; + } else { + out << indent << objName << " = " << qlayout << "("; + if ( layout.isEmpty() ) + out << parent; + else { + out << "None"; + if ( !DomTool::hasProperty( e, "margin" ) ) + margin = "0"; + } + out << "," << optcells << margin << "," << spacing << ",\"" << objName << "\")" << endl; + } + if ( !resizeMode.isEmpty() ) + out << indent << objName << ".setResizeMode(TQLayout." << resizeMode << ")" << endl; + + if ( !isGrid ) { + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "spacer" ) { + TQString child = createSpacerImpl( n, parentClass, parent, objName ); + out << indent << objName << ".addItem(" << child << ")" << endl; + } else if ( tags.contains( n.tagName() ) ) { + TQString child = createObjectImpl( n, parentClass, parent, objName ); + if ( isLayout( child ) ) + out << indent << objName << ".addLayout(" << child << ")" << endl; + else + out << indent << objName << ".addWidget(" << child << ")" << endl; + } + } + } else { + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + TQDomElement ae = n; + int row = ae.attribute( "row" ).toInt(); + int col = ae.attribute( "column" ).toInt(); + int rowspan = ae.attribute( "rowspan" ).toInt(); + int colspan = ae.attribute( "colspan" ).toInt(); + if ( rowspan < 1 ) + rowspan = 1; + if ( colspan < 1 ) + colspan = 1; + if ( n.tagName() == "spacer" ) { + TQString child = createSpacerImpl( n, parentClass, parent, objName ); + if ( rowspan * colspan != 1 ) + out << indent << objName << ".addMultiCell(" << child << "," + << row << "," << ( row + rowspan - 1 ) << "," << col << "," << ( col + colspan - 1 ) << ")" << endl; + else + out << indent << objName << ".addItem(" << child << "," + << row << "," << col << ")" << endl; + } else if ( tags.contains( n.tagName() ) ) { + TQString child = createObjectImpl( n, parentClass, parent, objName ); + out << endl; + TQString o = "Widget"; + if ( isLayout( child ) ) + o = "Layout"; + if ( rowspan * colspan != 1 ) + out << indent << objName << ".addMultiCell" << o << "(" << child << "," + << row << "," << ( row + rowspan - 1 ) << "," << col << "," << ( col + colspan - 1 ) << ")" << endl; + else + out << indent << objName << ".add" << o << "(" << child << "," + << row << "," << col << ")" << endl; + } + } + } + + return objName; +} + + + +TQString Uic::createSpacerImpl( const TQDomElement &e, const TQString& /*parentClass*/, const TQString& /*parent*/, const TQString& /*layout*/) +{ + TQDomElement n; + TQString objClass, objName; + objClass = e.tagName(); + objName = registerObject( getObjectName( e ) ); + + TQSize size = DomTool::readProperty( e, "sizeHint", TQSize( 0, 0 ) ).toSize(); + TQString sizeType = DomTool::readProperty( e, "sizeType", "Expanding" ).toString(); + bool isVspacer = DomTool::readProperty( e, "orientation", "Horizontal" ) == "Vertical"; + + if ( sizeType != "Expanding" && sizeType != "MinimumExpanding" && + DomTool::hasProperty( e, "geometry" ) ) { // compatibility TQt 2.2 + TQRect geom = DomTool::readProperty( e, "geometry", TQRect(0,0,0,0) ).toRect(); + size = geom.size(); + } + + if ( isVspacer ) + out << indent << objName << " = TQSpacerItem(" + << size.width() << "," << size.height() + << ",TQSizePolicy.Minimum,TQSizePolicy." << sizeType << ")" << endl; + else + out << indent << objName << " = TQSpacerItem(" + << size.width() << "," << size.height() + << ",TQSizePolicy." << sizeType << ",TQSizePolicy.Minimum)" << endl; + + return objName; +} + +static const char* const ColorRole[] = { + "Foreground", "Button", "Light", "Midlight", "Dark", "Mid", + "Text", "BrightText", "ButtonText", "Base", "Background", "Shadow", + "Highlight", "HighlightedText", "Link", "LinkVisited", 0 +}; + + +/*! + Creates a colorgroup with name \a name from the color group \a cg + */ +void Uic::createColorGroupImpl( const TQString& name, const TQDomElement& e ) +{ + TQColorGroup cg; + int r = -1; + TQDomElement n = e.firstChild().toElement(); + TQString color; + while ( !n.isNull() ) { + if ( n.tagName() == "color" ) { + r++; + TQColor col = DomTool::readColor( n ); + color = "TQColor(%1,%2,%3)"; + color = color.arg( col.red() ).arg( col.green() ).arg( col.blue() ); + if ( col == white ) + color = "TQt.white"; + else if ( col == black ) + color = "TQt.black"; + if ( n.nextSibling().toElement().tagName() != "pixmap" ) { + out << indent << name << ".setColor(TQColorGroup." << ColorRole[r] << "," << color << ")" << endl; + } + } else if ( n.tagName() == "pixmap" ) { + TQString pixmap = n.firstChild().toText().data(); + if ( pixmapLoaderFunction.isEmpty() ) { + pixmap.prepend( "self." ); + } else { + pixmap.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "self." ) ); + pixmap.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); + } + out << indent << name << ".setBrush(TQColorGroup." + << ColorRole[r] << ",TQBrush(" << color << "," << pixmap << "))" << endl; + } + n = n.nextSibling().toElement(); + } +} + +/*! + Auxiliary function to load a color group. The colorgroup must not + contain pixmaps. + */ +TQColorGroup Uic::loadColorGroup( const TQDomElement &e ) +{ + TQColorGroup cg; + int r = -1; + TQDomElement n = e.firstChild().toElement(); + TQColor col; + while ( !n.isNull() ) { + if ( n.tagName() == "color" ) { + r++; + cg.setColor( (TQColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) ); + } + n = n.nextSibling().toElement(); + } + return cg; +} + +/*! Returns TRUE if the widget properties specify that it belongs to + the database \a connection and \a table. +*/ + +bool Uic::isWidgetInTable( const TQDomElement& e, const TQString& connection, const TQString& table ) +{ + TQString conn = getDatabaseInfo( e, "connection" ); + TQString tab = getDatabaseInfo( e, "table" ); + if ( conn == connection && tab == table ) + return TRUE; + return FALSE; +} + +/*! + Registers all database connections, cursors and forms. +*/ + +void Uic::registerDatabases( const TQDomElement& e ) +{ + TQDomElement n; + TQDomNodeList nl; + int i; + nl = e.parentNode().toElement().elementsByTagName( "widget" ); + for ( i = 0; i < (int) nl.length(); ++i ) { + n = nl.item(i).toElement(); + TQString conn = getDatabaseInfo( n, "connection" ); + TQString tab = getDatabaseInfo( n, "table" ); + TQString fld = getDatabaseInfo( n, "field" ); + if ( !conn.isNull() ) { + dbConnections += conn; + if ( !tab.isNull() ) { + dbCursors[conn] += tab; + if ( !fld.isNull() ) + dbForms[conn] += tab; + } + } + } +} + +/*! + Registers an object with name \a name. + + The returned name is a valid variable identifier, as similar to \a + name as possible and guaranteed to be unique within the form. + + \sa registeredName(), isObjectRegistered() + */ +TQString Uic::registerObject( const TQString& name ) +{ + if ( objectNames.isEmpty() ) { + // some temporary variables we need + objectNames += "img"; + objectNames += "item"; + objectNames += "cg"; + objectNames += "pal"; + } + + TQString result = name; + int i; + while ( ( i = result.find(' ' )) != -1 ) { + result[i] = '_'; + } + + if ( objectNames.contains( result ) ) { + int i = 2; + while ( objectNames.contains( result + "_" + TQString::number(i) ) ) + i++; + result += "_"; + result += TQString::number(i); + } + objectNames += result; + objectMapper.insert( name, result ); + return result; +} + +/*! + Returns the registered name for the original name \a name + or \a name if \a name wasn't registered. + + \sa registerObject(), isObjectRegistered() + */ +TQString Uic::registeredName( const TQString& name ) +{ + if ( !objectMapper.contains( name ) ) + return name; + return objectMapper[name]; +} + +/*! + Returns whether the object \a name was registered yet or not. + */ +bool Uic::isObjectRegistered( const TQString& name ) +{ + return objectMapper.contains( name ); +} + + +/*! + Unifies the entries in stringlist \a list. Should really be a TQStringList feature. + */ +TQStringList Uic::unique( const TQStringList& list ) +{ + if ( list.isEmpty() ) + return list; + + TQStringList result; + for ( TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) { + if ( !result.contains(*it) ) + result += *it; + } + return result; +} + + + +/*! + Creates an instance of class \a objClass, with parent \a parent and name \a objName + */ +TQString Uic::createObjectInstance( const TQString& objClass, const TQString& parent, const TQString& objName ) +{ + + if ( objClass.mid( 1 ) == "ComboBox" ) { + return objClass + "(0," + parent + ",\"" + objName + "\")"; + } + return objClass + "(" + parent + ",\"" + objName + "\")"; +} + +bool Uic::isLayout( const TQString& name ) const +{ + return layoutObjects.contains( name ); +} diff --git a/pytquic3/uic.h b/pytquic3/uic.h new file mode 100644 index 0000000..1cda66b --- /dev/null +++ b/pytquic3/uic.h @@ -0,0 +1,183 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** Copyright (c) 2001 Phil Thompson +** +** This file is part of TQt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef UIC_H +#define UIC_H +#include +#include +#include +#include +#include +#include +#include + + +#define PYTQT_VERSION "3.18.1" + + +class PyIndent +{ +public: + PyIndent() : tabStop(4), current(0) {calc();} + + void setTabStop(uint n) {tabStop = n; calc();} + uint setIndent(uint i) {uint old = current; current = i; calc(); return old;} + void operator++() {++current; calc();} + void operator--() {--current; calc();} + operator TQString() {return indstr;} + +private: + uint tabStop; + uint current; + TQString indstr; + + void calc(); +}; + + +class Uic : public TQt +{ +public: + Uic( const TQString &fn, const char *outputFn, TQTextStream& out, + TQDomDocument doc, bool subcl, const TQString &trm, + const TQString& subclname, TQString &uicClass ); + + static void setIndent(const PyIndent &pyind) {indent = pyind; trindent = pyind;} + + void createFormImpl( const TQDomElement &e ); + + void createSubImpl( const TQDomElement &e, const TQString& subclname ); + + void createActionImpl( const TQDomElement& e, const TQString &parent ); + void createToolbarImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent ); + void createMenuBarImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent ); + void createPopupMenuImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent ); + TQString createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout = TQString::null ); + TQString createLayoutImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout = TQString::null ); + TQString createObjectInstance( const TQString& objClass, const TQString& parent, const TQString& objName ); + TQString createSpacerImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout = TQString::null ); + void createExclusiveProperty( const TQDomElement & e, const TQString& exclusiveProp ); + TQString createListBoxItemImpl( const TQDomElement &e, const TQString &parent, TQString *value = 0 ); + TQString createIconViewItemImpl( const TQDomElement &e, const TQString &parent ); + TQString createListViewColumnImpl( const TQDomElement &e, const TQString &parent, TQString *value = 0 ); + TQString createTableRowColumnImpl( const TQDomElement &e, const TQString &parent, TQString *value = 0 ); + TQString createListViewItemImpl( const TQDomElement &e, const TQString &parent, + const TQString &parentItem ); + void createColorGroupImpl( const TQString& cg, const TQDomElement& e ); + TQColorGroup loadColorGroup( const TQDomElement &e ); + + TQDomElement getObjectProperty( const TQDomElement& e, const TQString& name ); + TQString getPixmapLoaderFunction( const TQDomElement& e ); + TQString getFormClassName( const TQDomElement& e ); + TQString getClassName( const TQDomElement& e ); + TQString getObjectName( const TQDomElement& e ); + TQString getLayoutName( const TQDomElement& e ); + TQString getInclude( const TQString& className ); + + TQString setObjectProperty( const TQString& objClass, const TQString& obj, const TQString &prop, const TQDomElement &e, bool stdset ); + + TQString registerObject( const TQString& name ); + TQString registeredName( const TQString& name ); + bool isObjectRegistered( const TQString& name ); + TQStringList unique( const TQStringList& ); + + TQString trcall( const TQString& sourceText, const TQString& comment = "" ); + + static void embed( TQTextStream& out, const char* project, const TQStringList& images ); + +private: + TQTextStream& out; + TQTextOStream trout; + TQString languageChangeBody; + TQCString outputFileName; + TQStringList objectNames; + TQMap objectMapper; + TQStringList tags; + TQStringList layouts; + TQString formName; + TQString lastItem; + TQString trmacro; + static PyIndent indent, trindent; + + struct Buddy + { + Buddy( const TQString& k, const TQString& b ) + : key( k ), buddy( b ) {} + Buddy(){} // for valuelist + TQString key; + TQString buddy; + bool operator==( const Buddy& other ) const + { return (key == other.key); } + }; + struct CustomInclude + { + TQString header; + TQString location; + }; + TQValueList buddies; + + TQStringList layoutObjects; + bool isLayout( const TQString& name ) const; + + uint item_used : 1; + uint cg_used : 1; + uint pal_used : 1; + uint stdsetdef : 1; + uint externPixmaps : 1; + +#if TQT_VERSION >= 0x030300 + TQString uiFileVersion; +#endif + TQString nameOfClass; + TQStringList namespaces; + TQString bareNameOfClass; + TQString pixmapLoaderFunction; + + void registerDatabases( const TQDomElement& e ); + bool isWidgetInTable( const TQDomElement& e, const TQString& connection, const TQString& table ); + bool isFrameworkCodeGenerated( const TQDomElement& e ); + TQString getDatabaseInfo( const TQDomElement& e, const TQString& tag ); + void createFormImpl( const TQDomElement& e, const TQString& form, const TQString& connection, const TQString& table ); + void writeFunctionsSubImpl( const TQStringList &fuLst, const TQStringList &typLst, const TQStringList &specLst, + const TQString &subClass, const TQString &descr ); + TQStringList dbConnections; + TQMap< TQString, TQStringList > dbCursors; + TQMap< TQString, TQStringList > dbForms; + + static bool isMainWindow; + static TQString mkBool( bool b ); + static TQString mkBool( const TQString& s ); + bool toBool( const TQString& s ); + static TQString fixString( const TQString &str, bool encode = FALSE ); + static bool onlyAscii; + static TQString mkStdSet( const TQString& prop ); + static TQString getComment( const TQDomNode& n ); + TQVariant defSpacing, defMargin; + TQString fileName; + bool writeFunctImpl; + + void pySlot(TQStringList::ConstIterator &it); + + TQString pyCode; + bool pyNeedTr, pyNeedTrUtf8; +}; + +#endif diff --git a/pytquic3/widgetdatabase.cpp b/pytquic3/widgetdatabase.cpp new file mode 100644 index 0000000..3e075b0 --- /dev/null +++ b/pytquic3/widgetdatabase.cpp @@ -0,0 +1,953 @@ +/********************************************************************** +** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. +** +** This file is part of TQt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License +** Agreement provided with the Software. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about TQt Commercial License Agreements. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include "widgetdatabase.h" +#include "widgetinterface.h" + +#include +#define NO_STATIC_COLORS +#include +#include +#include +#include +#include +#include +#include + +#include + +const int dbsize = 300; +const int dbcustom = 200; +const int dbdictsize = 211; +static WidgetDatabaseRecord* db[ dbsize ]; +static TQDict *className2Id = 0; +static int dbcount = 0; +static int dbcustomcount = 200; +static TQStrList *wGroups; +static TQStrList *invisibleGroups; +static bool whatsThisLoaded = FALSE; +static TQPluginManager *widgetPluginManager = 0; +static bool plugins_set_up = FALSE; +static bool was_in_setup = FALSE; + +TQCleanupHandler > cleanup_manager; + +WidgetDatabaseRecord::WidgetDatabaseRecord() +{ + isForm = FALSE; + isContainer = FALSE; + icon = 0; + nameCounter = 0; + isCommon = FALSE; + isPlugin = FALSE; +} + +WidgetDatabaseRecord::~WidgetDatabaseRecord() +{ + delete icon; +} + + +/*! + \class WidgetDatabase widgetdatabase.h + \brief The WidgetDatabase class holds information about widgets + + The WidgetDatabase holds information about widgets like toolTip(), + iconSet(), ... It works Id-based, so all access functions take the + widget id as parameter. To get the id for a widget (classname), use + idFromClassName(). + + All access functions are static. Having multiple widgetdatabases in + one application doesn't make sense anyway and so you don't need more + than an instance of the widgetdatabase. + + For creating widgets, layouts, etc. see WidgetFactory. +*/ + +/*! + Creates widget database. Does nothing. +*/ + +WidgetDatabase::WidgetDatabase() +{ +} + +/*! Sets up the widget database. If the static widgetdatabase already + exists, the functions returns immediately. +*/ + +void WidgetDatabase::setupDataBase( int id ) +{ + was_in_setup = TRUE; +#ifndef UIC + Q_UNUSED( id ) + if ( dbcount ) + return; +#else + if ( dbcount && id != -2 ) + return; + if ( dbcount && !plugins_set_up ) { + setupPlugins(); + return; + } + if ( dbcount && plugins_set_up) + return; +#endif + + wGroups = new TQStrList; + invisibleGroups = new TQStrList; + invisibleGroups->append( "Forms" ); + invisibleGroups->append( "Temp" ); + className2Id = new TQDict( dbdictsize ); + className2Id->setAutoDelete( TRUE ); + + WidgetDatabaseRecord *r = 0; + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_pushbutton.png"; + r->name = "TQPushButton"; + r->group = widgetGroup( "Buttons" ); + r->toolTip = "Push Button"; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_toolbutton.png"; + r->name = "TQToolButton"; + r->group = widgetGroup( "Buttons" ); + r->toolTip = "Tool Button"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_radiobutton.png"; + r->name = "TQRadioButton"; + r->group = widgetGroup( "Buttons" ); + r->toolTip = "Radio Button"; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_checkbox.png"; + r->name = "TQCheckBox"; + r->group = widgetGroup( "Buttons" ); + r->toolTip = "Check Box"; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_groupbox.png"; + r->name = "TQGroupBox"; + r->group = widgetGroup( "Containers" ); + r->toolTip = "Group Box"; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_buttongroup.png"; + r->name = "TQButtonGroup"; + r->group = widgetGroup( "Containers" ); + r->toolTip = "Button Group"; + r->isContainer = TRUE; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_frame.png"; + r->name = "TQFrame"; + r->group = widgetGroup( "Containers" ); + r->toolTip = "Frame"; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_tabwidget.png"; + r->name = "TQTabWidget"; + r->group = widgetGroup( "Containers" ); + r->toolTip = "Tabwidget"; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_widgetstack.png"; + r->name = "TQWidgetStack"; + r->group = widgetGroup( "Containers" ); + r->toolTip = "Widget Stack"; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_toolbox.png"; + r->name = "TQToolBox"; + r->group = widgetGroup( "Containers" ); + r->toolTip = "Tool Box"; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_listbox.png"; + r->name = "TQListBox"; + r->group = widgetGroup( "Views" ); + r->toolTip = "List Box"; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_listview.png"; + r->name = "TQListView"; + r->group = widgetGroup( "Views" ); + r->toolTip = "List View"; + + append( r ); + +#if !defined(TQT_NO_ICONVIEW) || defined(UIC) + r = new WidgetDatabaseRecord; + r->iconSet = "designer_iconview.png"; + r->name = "TQIconView"; + r->group = widgetGroup( "Views" ); + r->toolTip = "Icon View"; + + append( r ); +#endif + +#if !defined(TQT_NO_TABLE) + r = new WidgetDatabaseRecord; + r->iconSet = "designer_table.png"; + r->name = "TQTable"; + r->group = widgetGroup( "Views" ); + r->toolTip = "Table"; + + append( r ); +#endif + +#if !defined(TQT_NO_SQL) + r = new WidgetDatabaseRecord; + r->iconSet = "designer_datatable.png"; + r->includeFile = "tqdatatable.h"; + r->name = "TQDataTable"; + r->group = widgetGroup( "Database" ); + r->toolTip = "Data Table"; + + append( r ); +#endif + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_lineedit.png"; + r->name = "TQLineEdit"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Line Edit"; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_spinbox.png"; + r->name = "TQSpinBox"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Spin Box"; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_dateedit.png"; + r->name = "TQDateEdit"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Date Edit"; + r->includeFile = "tqdatetimeedit.h"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_timeedit.png"; + r->name = "TQTimeEdit"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Time Edit"; + r->includeFile = "tqdatetimeedit.h"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_datetimeedit.png"; + r->name = "TQDateTimeEdit"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Date-Time Edit"; + r->includeFile = "tqdatetimeedit.h"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_multilineedit.png"; + r->name = "TQMultiLineEdit"; + r->group = widgetGroup( "Temp" ); + r->toolTip = "Multi Line Edit"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_richtextedit.png"; + r->name = "TQTextEdit"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Rich Text Edit"; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_combobox.png"; + r->name = "TQComboBox"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Combo Box"; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_slider.png"; + r->name = "TQSlider"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Slider"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_scrollbar.png"; + r->name = "TQScrollBar"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Scrollbar"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_dial.png"; + r->name = "TQDial"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Dial"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_label.png"; + r->name = "TQLabel"; + r->group = widgetGroup( "Temp" ); + r->toolTip = "Label"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_label.png"; + r->name = "TextLabel"; + r->group = widgetGroup( "Display" ); + r->toolTip = "Text Label"; + r->whatsThis = "The Text Label provides a widget to display static text."; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_pixlabel.png"; + r->name = "PixmapLabel"; + r->group = widgetGroup( "Display" ); + r->toolTip = "Pixmap Label"; + r->whatsThis = "The Pixmap Label provides a widget to display pixmaps."; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_lcdnumber.png"; + r->name = "TQLCDNumber"; + r->group = widgetGroup( "Display" ); + r->toolTip = "LCD Number"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_line.png"; + r->name = "Line"; + r->group = widgetGroup( "Display" ); + r->toolTip = "Line"; + r->includeFile = "tqframe.h"; + r->whatsThis = "The Line widget provides horizontal and vertical lines."; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_progress.png"; + r->name = "TQProgressBar"; + r->group = widgetGroup( "Display" ); + r->toolTip = "Progress Bar"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_textview.png"; + r->name = "TQTextView"; + r->group = widgetGroup( "Temp" ); + r->toolTip = "Text View"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_textbrowser.png"; + r->name = "TQTextBrowser"; + r->group = widgetGroup( "Display" ); + r->toolTip = "Text Browser"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_spacer.png"; + r->name = "Spacer"; + r->group = widgetGroup( "Temp" ); + r->toolTip = "Spacer"; + r->whatsThis = "The Spacer provides horizontal and vertical spacing to be able to manipulate the behaviour of layouts."; + + append( r ); + + r = new WidgetDatabaseRecord; + r->name = "TQWidget"; + r->isForm = TRUE; + r->group = widgetGroup( "Forms" ); + + append( r ); + + r = new WidgetDatabaseRecord; + r->name = "TQDialog"; + r->group = widgetGroup( "Forms" ); + r->isForm = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->name = "TQWizard"; + r->group = widgetGroup( "Forms" ); + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->name = "TQDesignerWizard"; + r->group = widgetGroup( "Forms" ); + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->name = "TQLayoutWidget"; + r->group = widgetGroup( "Temp" ); + r->includeFile = ""; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->name = "TQSplitter"; + r->group = widgetGroup( "Temp" ); + r->includeFile = "tqsplitter.h"; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_tabwidget.png"; + r->name = "TQDesignerTabWidget"; + r->group = widgetGroup( "Temp" ); + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_tabwidget.png"; + r->name = "TQDesignerWidget"; + r->group = widgetGroup( "Temp" ); + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_tabwidget.png"; + r->name = "TQDesignerDialog"; + r->group = widgetGroup( "Temp" ); + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = ""; + r->name = "TQMainWindow"; + r->includeFile = "tqmainwindow.h"; + r->group = widgetGroup( "Temp" ); + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = ""; + r->name = "TQDesignerAction"; + r->includeFile = "tqaction.h"; + r->group = widgetGroup( "Temp" ); + r->isContainer = FALSE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = ""; + r->name = "TQDesignerActionGroup"; + r->includeFile = "tqaction.h"; + r->group = widgetGroup( "Temp" ); + r->isContainer = FALSE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = ""; + r->name = "TQScrollView"; + r->includeFile = "tqscrollview.h"; + r->group = widgetGroup( "Temp" ); + r->isContainer = TRUE; + + append( r ); + +#ifndef TQT_NO_SQL + r = new WidgetDatabaseRecord; + r->iconSet = ""; + r->name = "TQDataBrowser"; + r->includeFile = "tqdatabrowser.h"; + r->group = widgetGroup( "Database" ); + r->toolTip = "Data Browser"; + r->iconSet = "designer_databrowser.png"; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = ""; + r->name = "TQDataView"; + r->includeFile = "tqdataview.h"; + r->group = widgetGroup( "Database" ); + r->toolTip = "Data View"; + r->iconSet = "designer_dataview.png"; + r->isContainer = TRUE; + + append( r ); +#endif + +#ifndef UIC + setupPlugins(); +#endif +} + +void WidgetDatabase::setupPlugins() +{ + if ( plugins_set_up ) + return; + plugins_set_up = TRUE; + TQStringList widgets = widgetManager()->featureList(); + for ( TQStringList::Iterator it = widgets.begin(); it != widgets.end(); ++it ) { + if ( hasWidget( *it ) ) + continue; + WidgetDatabaseRecord *r = new WidgetDatabaseRecord; + WidgetInterface *iface = 0; + widgetManager()->queryInterface( *it, &iface ); + if ( !iface ) + continue; + +#ifndef UIC + TQIconSet icon = iface->iconSet( *it ); + if ( !icon.pixmap().isNull() ) + r->icon = new TQIconSet( icon ); +#endif + TQString grp = iface->group( *it ); + if ( grp.isEmpty() ) + grp = "3rd party widgets"; + r->group = widgetGroup( grp ); + r->toolTip = iface->toolTip( *it ); + r->whatsThis = iface->whatsThis( *it ); + r->includeFile = iface->includeFile( *it ); + r->isContainer = iface->isContainer( *it ); + r->name = *it; + r->isPlugin = TRUE; + append( r ); + iface->release(); + } +} + +/*! + Returns the number of elements in the widget database. +*/ + +int WidgetDatabase::count() +{ + setupDataBase( -1 ); + return dbcount; +} + +/*! + Returns the id at which the ids of custom widgets start. +*/ + +int WidgetDatabase::startCustom() +{ + setupDataBase( -1 ); + return dbcustom; +} + +/*! + Returns the iconset which represents the class registered as \a id. +*/ + +TQIconSet WidgetDatabase::iconSet( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return TQIconSet(); +#if !defined(UIC) && !defined(RESOURCE) + if ( !r->icon ) { + if ( r->iconSet.isEmpty() ) + return TQIconSet(); + TQPixmap pix = TQPixmap::fromMimeSource( r->iconSet ); + if ( pix.isNull() ) + pix = TQPixmap( r->iconSet ); + r->icon = new TQIconSet( pix ); + } + return *r->icon; +#else + return TQIconSet(); +#endif +} + +/*! + Returns the classname of the widget which is registered as \a id. +*/ + +TQString WidgetDatabase::className( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return TQString::null; + return r->name; +} + +/*! + Returns the group the widget registered as \a id belongs to. +*/ + +TQString WidgetDatabase::group( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return TQString::null; + return r->group; +} + +/*! + Returns the tooltip text of the widget which is registered as \a id. +*/ + +TQString WidgetDatabase::toolTip( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return TQString::null; + return r->toolTip; +} + +/*! + Returns the what's this? text of the widget which is registered as \a id. +*/ + +TQString WidgetDatabase::whatsThis( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return TQString::null; + return r->whatsThis; +} + +/*! + Returns the include file if the widget which is registered as \a id. +*/ + +TQString WidgetDatabase::includeFile( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return TQString::null; + if ( r->includeFile.isNull() ) + return r->name.lower() + ".h"; + return r->includeFile; +} + +/*! Returns whether the widget registered as \a id is a form. +*/ +bool WidgetDatabase::isForm( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return FALSE; + return r->isForm; +} + +/*! Returns whether the widget registered as \a id can have children. +*/ + +bool WidgetDatabase::isContainer( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return FALSE; + return r->isContainer || r->isForm; +} + +bool WidgetDatabase::isCommon( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return FALSE; + return r->isCommon; +} + +TQString WidgetDatabase::createWidgetName( int id ) +{ + setupDataBase( id ); + TQString n = className( id ); + if ( n == "TQLayoutWidget" ) + n = "Layout"; + if ( n[ 0 ] == 'Q' && n[ 1 ].lower() != n[ 1 ] ) + n = n.mid( 1 ); + int colonColon = n.findRev( "::" ); + if ( colonColon != -1 ) + n = n.mid( colonColon + 2 ); + + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return n; + n += TQString::number( ++r->nameCounter ); + n[0] = n[0].lower(); + return n; +} + +/*! Returns the id for \a name or -1 if \a name is unknown. + */ +int WidgetDatabase::idFromClassName( const TQString &name ) +{ + setupDataBase( -1 ); + if ( name.isEmpty() ) + return 0; + int *i = className2Id->find( name ); + if ( i ) + return *i; + if ( name == "FormWindow" ) + return idFromClassName( "TQLayoutWidget" ); +#ifdef UIC + setupDataBase( -2 ); + i = className2Id->find( name ); + if ( i ) + return *i; +#endif + return -1; +} + +bool WidgetDatabase::hasWidget( const TQString &name ) +{ + return className2Id->find( name ) != 0; +} + +WidgetDatabaseRecord *WidgetDatabase::at( int index ) +{ + if ( index < 0 ) + return 0; + if ( index >= dbcustom && index < dbcustomcount ) + return db[ index ]; + if ( index < dbcount ) + return db[ index ]; + return 0; +} + +void WidgetDatabase::insert( int index, WidgetDatabaseRecord *r ) +{ + if ( index < 0 || index >= dbsize ) + return; + db[ index ] = r; + className2Id->insert( r->name, new int( index ) ); + if ( index < dbcustom ) + dbcount = TQMAX( dbcount, index ); +} + +void WidgetDatabase::append( WidgetDatabaseRecord *r ) +{ + if ( !was_in_setup ) + setupDataBase( -1 ); + insert( dbcount++, r ); +} + +TQString WidgetDatabase::widgetGroup( const TQString &g ) +{ + if ( wGroups->find( g ) == -1 ) + wGroups->append( g ); + return g; +} + +bool WidgetDatabase::isGroupEmpty( const TQString &grp ) +{ + WidgetDatabaseRecord *r = 0; + for ( int i = 0; i < dbcount; ++i ) { + if ( !( r = db[ i ] ) ) + continue; + if ( r->group == grp ) + return FALSE; + } + return TRUE; +} + +TQString WidgetDatabase::widgetGroup( int i ) +{ + setupDataBase( -1 ); + if ( i >= 0 && i < (int)wGroups->count() ) + return wGroups->at( i ); + return TQString::null; +} + +int WidgetDatabase::numWidgetGroups() +{ + setupDataBase( -1 ); + return wGroups->count(); +} + +bool WidgetDatabase::isGroupVisible( const TQString &g ) +{ + setupDataBase( -1 ); + return invisibleGroups->find( g ) == -1; +} + +int WidgetDatabase::addCustomWidget( WidgetDatabaseRecord *r ) +{ + insert( dbcustomcount++, r ); + return dbcustomcount - 1; +} + +void WidgetDatabase::customWidgetClassNameChanged( const TQString &oldName, + const TQString &newName ) +{ + int id = idFromClassName( oldName ); + if ( id == -1 ) + return; + WidgetDatabaseRecord *r = db[ id ]; + r->name = newName; + className2Id->remove( oldName ); + className2Id->insert( newName, new int( id ) ); +} + +bool WidgetDatabase::isCustomWidget( int id ) +{ + if ( id >= dbcustom && id < dbcustomcount ) + return TRUE; + return FALSE; +} + +bool WidgetDatabase::isCustomPluginWidget( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return FALSE; + return r->isPlugin; +} + +bool WidgetDatabase::isWhatsThisLoaded() +{ + return whatsThisLoaded; +} + +void WidgetDatabase::loadWhatsThis( const TQString &docPath ) +{ + TQString whatsthisFile = docPath + "/whatsthis"; + TQFile f( whatsthisFile ); + if ( !f.open( IO_ReadOnly ) ) + return; + TQTextStream ts( &f ); + while ( !ts.atEnd() ) { + TQString s = ts.readLine(); + TQStringList l = TQStringList::split( " | ", s ); + int id = idFromClassName( l[ 1 ] ); + WidgetDatabaseRecord *r = at( id ); + if ( r ) + r->whatsThis = l[ 0 ]; + } + whatsThisLoaded = TRUE; +} + + +// ### TQt 3.1: make these publically accessible via TQWidgetDatabase API +#if defined(UIC) +bool dbnounload = FALSE; +TQStringList *dbpaths = 0; +#else +extern TQString *qwf_plugin_dir; +#endif + + +TQPluginManager *widgetManager() +{ + if ( !widgetPluginManager ) { + TQString pluginDir = "/designer"; +#if !defined(UIC) + if ( qwf_plugin_dir ) + pluginDir = *qwf_plugin_dir; +#endif + widgetPluginManager = new TQPluginManager( IID_Widget, TQApplication::libraryPaths(), pluginDir ); + cleanup_manager.add( &widgetPluginManager ); +#if defined(UIC) + if ( dbnounload ) + widgetPluginManager->setAutoUnload( FALSE ); + if ( dbpaths ) { + TQStringList::ConstIterator it = dbpaths->begin(); + for ( ; it != dbpaths->end(); ++it ) + widgetPluginManager->addLibraryPath( *it ); + } +#endif + } + return widgetPluginManager; +} diff --git a/pytquic3/widgetdatabase.h b/pytquic3/widgetdatabase.h new file mode 100644 index 0000000..18b63af --- /dev/null +++ b/pytquic3/widgetdatabase.h @@ -0,0 +1,96 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of TQt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License +** Agreement provided with the Software. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about TQt Commercial License Agreements. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef WIDGETDATABASE_H +#define WIDGETDATABASE_H + +#include +#include +#include "widgetinterface.h" // up here for GCC 2.7.* compatibility +#include + + +extern TQPluginManager *widgetManager(); + +struct WidgetDatabaseRecord +{ + WidgetDatabaseRecord(); + ~WidgetDatabaseRecord(); + TQString iconSet, name, group, toolTip, whatsThis, includeFile; + uint isContainer : 1; + uint isForm : 1; + uint isCommon : 1; + uint isPlugin : 1; + TQIconSet *icon; + int nameCounter; +}; + +class WidgetDatabase : public TQt +{ +public: + WidgetDatabase(); + static void setupDataBase( int id ); + static void setupPlugins(); + + static int count(); + static int startCustom(); + + static TQIconSet iconSet( int id ); + static TQString className( int id ); + static TQString group( int id ); + static TQString toolTip( int id ); + static TQString whatsThis( int id ); + static TQString includeFile( int id ); + static bool isForm( int id ); + static bool isContainer( int id ); + static bool isCommon( int id ); + + static int idFromClassName( const TQString &name ); + static TQString createWidgetName( int id ); + + static WidgetDatabaseRecord *at( int index ); + static void insert( int index, WidgetDatabaseRecord *r ); + static void append( WidgetDatabaseRecord *r ); + + static TQString widgetGroup( const TQString &g ); + static TQString widgetGroup( int i ); + static int numWidgetGroups(); + static bool isGroupVisible( const TQString &g ); + static bool isGroupEmpty( const TQString &grp ); + + static int addCustomWidget( WidgetDatabaseRecord *r ); + static bool isCustomWidget( int id ); + static bool isCustomPluginWidget( int id ); + + static bool isWhatsThisLoaded(); + static void loadWhatsThis( const TQString &docPath ); + + static bool hasWidget( const TQString &name ); + static void customWidgetClassNameChanged( const TQString &oldName, const TQString &newName ); + +}; + +#endif diff --git a/pytquic3/widgetinterface.h b/pytquic3/widgetinterface.h new file mode 100644 index 0000000..50f8e6d --- /dev/null +++ b/pytquic3/widgetinterface.h @@ -0,0 +1,29 @@ + /********************************************************************** +** Copyright (C) 2000-2001 Trolltech AS. All rights reserved. +** +** This file is part of TQt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef WIDGETINTERFACE_H +#define WIDGETINTERFACE_H + +#include + +#define WidgetInterface TQWidgetFactoryInterface +#define IID_Widget IID_QWidgetFactory + +#endif diff --git a/pyuic3/LICENSE.GPL b/pyuic3/LICENSE.GPL deleted file mode 100644 index c7aea18..0000000 --- a/pyuic3/LICENSE.GPL +++ /dev/null @@ -1,280 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/pyuic3/domtool.cpp b/pyuic3/domtool.cpp deleted file mode 100644 index 740088e..0000000 --- a/pyuic3/domtool.cpp +++ /dev/null @@ -1,447 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** This file is part of TQt Designer. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#include "domtool.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -/*! - \class DomTool domtool.h - \brief Tools for the dom - - A collection of static functions used by Resource (part of the - designer) and Uic. - -*/ - -/*! - Returns the contents of property \a name of object \a e as - variant or the variant passed as \a defValue if the property does - not exist. - - \sa hasProperty() -*/ -TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment ) -{ - TQDomElement n; - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "property" ) { - if ( n.attribute( "name" ) != name ) - continue; - return elementToVariant( n.firstChild().toElement(), defValue, comment ); - } - } - return defValue; -} - - -/*! - \overload - */ -TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue ) -{ - TQString comment; - return readProperty( e, name, defValue, comment ); -} - -/*! - Returns wheter object \a e defines property \a name or not. - - \sa readProperty() - */ -bool DomTool::hasProperty( const TQDomElement& e, const TQString& name ) -{ - TQDomElement n; - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "property" ) { - if ( n.attribute( "name" ) != name ) - continue; - return TRUE; - } - } - return FALSE; -} - -TQStringList DomTool::propertiesOfType( const TQDomElement& e, const TQString& type ) -{ - TQStringList result; - TQDomElement n; - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "property" ) { - TQDomElement n2 = n.firstChild().toElement(); - if ( n2.tagName() == type ) - result += n.attribute( "name" ); - } - } - return result; -} - - -TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& defValue ) -{ - TQString dummy; - return elementToVariant( e, defValue, dummy ); -} - -/*! - Interprets element \a e as variant and returns the result of the interpretation. - */ -TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& defValue, TQString &comment ) -{ - TQVariant v; - if ( e.tagName() == "rect" ) { - TQDomElement n3 = e.firstChild().toElement(); - int x = 0, y = 0, w = 0, h = 0; - while ( !n3.isNull() ) { - if ( n3.tagName() == "x" ) - x = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "y" ) - y = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "width" ) - w = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "height" ) - h = n3.firstChild().toText().data().toInt(); - n3 = n3.nextSibling().toElement(); - } - v = TQVariant( TQRect( x, y, w, h ) ); - } else if ( e.tagName() == "point" ) { - TQDomElement n3 = e.firstChild().toElement(); - int x = 0, y = 0; - while ( !n3.isNull() ) { - if ( n3.tagName() == "x" ) - x = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "y" ) - y = n3.firstChild().toText().data().toInt(); - n3 = n3.nextSibling().toElement(); - } - v = TQVariant( TQPoint( x, y ) ); - } else if ( e.tagName() == "size" ) { - TQDomElement n3 = e.firstChild().toElement(); - int w = 0, h = 0; - while ( !n3.isNull() ) { - if ( n3.tagName() == "width" ) - w = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "height" ) - h = n3.firstChild().toText().data().toInt(); - n3 = n3.nextSibling().toElement(); - } - v = TQVariant( TQSize( w, h ) ); - } else if ( e.tagName() == "color" ) { - v = TQVariant( readColor( e ) ); - } else if ( e.tagName() == "font" ) { - TQDomElement n3 = e.firstChild().toElement(); - TQFont f( defValue.toFont() ); - while ( !n3.isNull() ) { - if ( n3.tagName() == "family" ) - f.setFamily( n3.firstChild().toText().data() ); - else if ( n3.tagName() == "pointsize" ) - f.setPointSize( n3.firstChild().toText().data().toInt() ); - else if ( n3.tagName() == "bold" ) - f.setBold( n3.firstChild().toText().data().toInt() ); - else if ( n3.tagName() == "italic" ) - f.setItalic( n3.firstChild().toText().data().toInt() ); - else if ( n3.tagName() == "underline" ) - f.setUnderline( n3.firstChild().toText().data().toInt() ); - else if ( n3.tagName() == "strikeout" ) - f.setStrikeOut( n3.firstChild().toText().data().toInt() ); - n3 = n3.nextSibling().toElement(); - } - v = TQVariant( f ); - } else if ( e.tagName() == "string" ) { - v = TQVariant( e.firstChild().toText().data() ); - TQDomElement n = e; - n = n.nextSibling().toElement(); - if ( n.tagName() == "comment" ) - comment = n.firstChild().toText().data(); - } else if ( e.tagName() == "cstring" ) { - v = TQVariant( TQCString( e.firstChild().toText().data() ) ); - } else if ( e.tagName() == "number" ) { - bool ok = TRUE; - v = TQVariant( e.firstChild().toText().data().toInt( &ok ) ); - if ( !ok ) - v = TQVariant( e.firstChild().toText().data().toDouble() ); - } else if ( e.tagName() == "bool" ) { - TQString t = e.firstChild().toText().data(); - v = TQVariant( t == "true" || t == "1" ); - } else if ( e.tagName() == "pixmap" ) { - v = TQVariant( e.firstChild().toText().data() ); - } else if ( e.tagName() == "iconset" ) { - v = TQVariant( e.firstChild().toText().data() ); - } else if ( e.tagName() == "image" ) { - v = TQVariant( e.firstChild().toText().data() ); - } else if ( e.tagName() == "enum" ) { - v = TQVariant( e.firstChild().toText().data() ); - } else if ( e.tagName() == "set" ) { - v = TQVariant( e.firstChild().toText().data() ); - } else if ( e.tagName() == "sizepolicy" ) { - TQDomElement n3 = e.firstChild().toElement(); - TQSizePolicy sp; - while ( !n3.isNull() ) { - if ( n3.tagName() == "hsizetype" ) - sp.setHorData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); - else if ( n3.tagName() == "vsizetype" ) - sp.setVerData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); - else if ( n3.tagName() == "horstretch" ) - sp.setHorStretch( n3.firstChild().toText().data().toInt() ); - else if ( n3.tagName() == "verstretch" ) - sp.setVerStretch( n3.firstChild().toText().data().toInt() ); - n3 = n3.nextSibling().toElement(); - } - v = TQVariant( sp ); - } else if ( e.tagName() == "cursor" ) { - v = TQVariant( TQCursor( e.firstChild().toText().data().toInt() ) ); - } else if ( e.tagName() == "stringlist" ) { - TQStringList lst; - TQDomElement n; - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) - lst << n.firstChild().toText().data(); - v = TQVariant( lst ); - } else if ( e.tagName() == "date" ) { - TQDomElement n3 = e.firstChild().toElement(); - int y, m, d; - y = m = d = 0; - while ( !n3.isNull() ) { - if ( n3.tagName() == "year" ) - y = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "month" ) - m = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "day" ) - d = n3.firstChild().toText().data().toInt(); - n3 = n3.nextSibling().toElement(); - } - v = TQVariant( TQDate( y, m, d ) ); - } else if ( e.tagName() == "time" ) { - TQDomElement n3 = e.firstChild().toElement(); - int h, m, s; - h = m = s = 0; - while ( !n3.isNull() ) { - if ( n3.tagName() == "hour" ) - h = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "minute" ) - m = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "second" ) - s = n3.firstChild().toText().data().toInt(); - n3 = n3.nextSibling().toElement(); - } - v = TQVariant( TQTime( h, m, s ) ); - } else if ( e.tagName() == "datetime" ) { - TQDomElement n3 = e.firstChild().toElement(); - int h, mi, s, y, mo, d ; - h = mi = s = y = mo = d = 0; - while ( !n3.isNull() ) { - if ( n3.tagName() == "hour" ) - h = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "minute" ) - mi = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "second" ) - s = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "year" ) - y = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "month" ) - mo = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "day" ) - d = n3.firstChild().toText().data().toInt(); - n3 = n3.nextSibling().toElement(); - } - v = TQVariant( TQDateTime( TQDate( y, mo, d ), TQTime( h, mi, s ) ) ); - } - return v; -} - - -/*! Returns the color which is returned in the dom element \a e. - */ - -TQColor DomTool::readColor( const TQDomElement &e ) -{ - TQDomElement n = e.firstChild().toElement(); - int r= 0, g = 0, b = 0; - while ( !n.isNull() ) { - if ( n.tagName() == "red" ) - r = n.firstChild().toText().data().toInt(); - else if ( n.tagName() == "green" ) - g = n.firstChild().toText().data().toInt(); - else if ( n.tagName() == "blue" ) - b = n.firstChild().toText().data().toInt(); - n = n.nextSibling().toElement(); - } - - return TQColor( r, g, b ); -} - -/*! - Returns the contents of attribute \a name of object \a e as - variant or the variant passed as \a defValue if the attribute does - not exist. - - \sa hasAttribute() - */ -TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment ) -{ - TQDomElement n; - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "attribute" ) { - if ( n.attribute( "name" ) != name ) - continue; - return elementToVariant( n.firstChild().toElement(), defValue, comment ); - } - } - return defValue; -} - -/*! - \overload -*/ -TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue ) -{ - TQString comment; - return readAttribute( e, name, defValue, comment ); -} - -/*! - Returns wheter object \a e defines attribute \a name or not. - - \sa readAttribute() - */ -bool DomTool::hasAttribute( const TQDomElement& e, const TQString& name ) -{ - TQDomElement n; - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "attribute" ) { - if ( n.attribute( "name" ) != name ) - continue; - return TRUE; - } - } - return FALSE; -} - -static bool toBool( const TQString& s ) -{ - return s == "true" || s.toInt() != 0; -} - -/*! - Convert TQt 2.x format to TQt 3.0 format if necessary -*/ -void DomTool::fixDocument( TQDomDocument& doc ) -{ - TQDomElement e; - TQDomNode n; - TQDomNodeList nl; - int i = 0; - - e = doc.firstChild().toElement(); - if ( e.tagName() != "UI" ) - return; - - // latest version, don't do anything - if ( e.hasAttribute("version") && e.attribute("version").toDouble() > 3.0 ) - return; - - nl = doc.elementsByTagName( "property" ); - - // in 3.0, we need to fix a spelling error - if ( e.hasAttribute("version") && e.attribute("version").toDouble() == 3.0 ) { - for ( i = 0; i < (int) nl.length(); i++ ) { - TQDomElement el = nl.item(i).toElement(); - TQString s = el.attribute( "name" ); - if ( s == "resizeable" ) { - el.removeAttribute( "name" ); - el.setAttribute( "name", "resizable" ); - } - } - return; - } - - - // in versions smaller than 3.0 we need to change more - e.setAttribute( "version", 3.0 ); - - e.setAttribute("stdsetdef", 1 ); - for ( i = 0; i < (int) nl.length(); i++ ) { - e = nl.item(i).toElement(); - TQString name; - TQDomElement n2 = e.firstChild().toElement(); - if ( n2.tagName() == "name" ) { - name = n2.firstChild().toText().data(); - if ( name == "resizeable" ) - e.setAttribute( "name", "resizable" ); - else - e.setAttribute( "name", name ); - e.removeChild( n2 ); - } - bool stdset = toBool( e.attribute( "stdset" ) ); - if ( stdset || name == "toolTip" || name == "whatsThis" || - name == "buddy" || - e.parentNode().toElement().tagName() == "item" || - e.parentNode().toElement().tagName() == "spacer" || - e.parentNode().toElement().tagName() == "column" - ) - e.removeAttribute( "stdset" ); - else - e.setAttribute( "stdset", 0 ); - } - - nl = doc.elementsByTagName( "attribute" ); - for ( i = 0; i < (int) nl.length(); i++ ) { - e = nl.item(i).toElement(); - TQString name; - TQDomElement n2 = e.firstChild().toElement(); - if ( n2.tagName() == "name" ) { - name = n2.firstChild().toText().data(); - e.setAttribute( "name", name ); - e.removeChild( n2 ); - } - } - - nl = doc.elementsByTagName( "image" ); - for ( i = 0; i < (int) nl.length(); i++ ) { - e = nl.item(i).toElement(); - TQString name; - TQDomElement n2 = e.firstChild().toElement(); - if ( n2.tagName() == "name" ) { - name = n2.firstChild().toText().data(); - e.setAttribute( "name", name ); - e.removeChild( n2 ); - } - } - - nl = doc.elementsByTagName( "widget" ); - for ( i = 0; i < (int) nl.length(); i++ ) { - e = nl.item(i).toElement(); - TQString name; - TQDomElement n2 = e.firstChild().toElement(); - if ( n2.tagName() == "class" ) { - name = n2.firstChild().toText().data(); - e.setAttribute( "class", name ); - e.removeChild( n2 ); - } - } - -} - diff --git a/pyuic3/domtool.h b/pyuic3/domtool.h deleted file mode 100644 index 87fbaf6..0000000 --- a/pyuic3/domtool.h +++ /dev/null @@ -1,47 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** This file is part of TQt Designer. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#ifndef DOMTOOL_H -#define DOMTOOL_H - -#include -#include - -class TQDomElement; -class TQDomDocument; - -class DomTool : public TQt -{ -public: - static TQVariant readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue ); - static TQVariant readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment ); - static bool hasProperty( const TQDomElement& e, const TQString& name ); - static TQStringList propertiesOfType( const TQDomElement& e, const TQString& type ); - static TQVariant elementToVariant( const TQDomElement& e, const TQVariant& defValue ); - static TQVariant elementToVariant( const TQDomElement& e, const TQVariant& defValue, TQString &comment ); - static TQVariant readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue ); - static TQVariant readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment ); - static bool hasAttribute( const TQDomElement& e, const TQString& name ); - static TQColor readColor( const TQDomElement &e ); - static void fixDocument( TQDomDocument& ); -}; - - -#endif // DOMTOOL_H diff --git a/pyuic3/embed.cpp b/pyuic3/embed.cpp deleted file mode 100644 index c54104f..0000000 --- a/pyuic3/embed.cpp +++ /dev/null @@ -1,322 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** Copyright (c) 2001 Phil Thompson -** Copyright (c) 2002 Riverbank Computing Limited -** -** This file is part of TQt Designer. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#include "uic.h" -#include -#include -#include -#include -#include -#include -#include - -// on embedded, we do not compress image data. Rationale: by mapping -// the ready-only data directly into memory we are both faster and -// more memory efficient -#if (TQT_VERSION < 0x030100 || defined(Q_WS_QWS)) && !defined(TQT_NO_IMAGE_COLLECTION_COMPRESSION) -#define TQT_NO_IMAGE_COLLECTION_COMPRESSION -#endif - -struct EmbedImage -{ - ~EmbedImage() { delete[] colorTable; } - int width, height, depth; - int numColors; - TQRgb* colorTable; - TQString name; - TQString cname; - bool alpha; -#ifndef TQT_NO_IMAGE_COLLECTION_COMPRESSION - ulong compressed; -#endif -}; - -static TQString convertToCIdentifier( const char *s ) -{ - TQString r = s; - int len = r.length(); - if ( len > 0 && !isalpha( (char)r[0].latin1() ) ) - r[0] = '_'; - for ( int i=1; i> 4) & 15]; - s += hexdigits[v & 15]; - if ( i == len-1 ) - s += "\"\n"; - } - if ( s.length() ) - out << (const char*)s; - return (ulong)len; -} - -static void embedData( TQTextStream& out, const TQRgb* input, int n ) -{ - out << hex; - const TQRgb *v = input; - for ( int i=0; i list_image; - list_image.setAutoDelete( TRUE ); - int image_count = 0; - for ( it = images.begin(); it != images.end(); ++it ) { - TQImage img; - if ( !img.load( *it ) ) { - fprintf( stderr, "pyuic: cannot load image file %s\n", (*it).utf8() ); - continue; - } - EmbedImage *e = new EmbedImage; - e->width = img.width(); - e->height = img.height(); - e->depth = img.depth(); - e->numColors = img.numColors(); - e->colorTable = new TQRgb[e->numColors]; - e->alpha = img.hasAlphaBuffer(); - memcpy(e->colorTable, img.colorTable(), e->numColors*sizeof(TQRgb)); - TQFileInfo fi( *it ); - e->name = fi.fileName(); - e->cname = TQString("image_%1").arg( image_count++); - list_image.append( e ); - out << "# " << *it << "\n"; - TQString s; - if ( e->depth == 1 ) - img = img.convertBitOrder(TQImage::BigEndian); - out << s.sprintf( "%s_data =", - (const char *)e->cname ); -#ifndef TQT_NO_IMAGE_COLLECTION_COMPRESSION - e->compressed = -#endif - embedData( out, img.bits(), img.numBytes() ); - out << "\n"; - if ( e->numColors ) { - out << s.sprintf( "%s_ctable = [", - (const char *)e->cname ); - embedData( out, e->colorTable, e->numColors ); - out << "\n]\n\n"; - } - } - - if ( !list_image.isEmpty() ) { - out << indent << "embed_image_vec = [\n"; - ++indent; - EmbedImage *e = list_image.first(); - while ( e ) { - out << indent << "[" - << e->width << "," - << e->height << "," - << e->depth << "," - << e->cname << "_data," -#ifndef TQT_NO_IMAGE_COLLECTION_COMPRESSION - << e->compressed << "," -#endif - << e->numColors << ","; - if ( e->numColors ) - out << e->cname << "_ctable,"; - else - out << "None,"; - if ( e->alpha ) - out << "1,"; - else - out << "0,"; - out << "\"" << e->name << "\"],\n"; - e = list_image.next(); - } - --indent; - out << indent << "]\n"; - - out << "\n" - "\n" - "def uic_findImage(name):\n"; - ++indent; - out << indent << "global embed_image_vec\n"; - out << "\n"; -#ifndef TQT_NO_IMAGE_COLLECTION_COMPRESSION - out << indent << "for (w,h,depth,data,comp,nrCol,colTab,alpha,iname) in embed_image_vec:" << endl; -#else - out << indent << "for (w,h,depth,data,nrCol,colTab,alpha,iname) in embed_image_vec:" << endl; -#endif - ++indent; - out << indent << "if iname == str(name):" << endl; - ++indent; -#ifndef TQT_NO_IMAGE_COLLECTION_COMPRESSION - // Keep the data object alive until we have a deep copy of the image. - out << indent << "data = tqUncompress(data).data()\n"; -#endif - out << indent << "img = TQImage(data,w,h,depth,colTab,nrCol,TQImage.BigEndian).copy()\n"; - out << "\n"; - out << indent << "if alpha:\n"; - ++indent; - out << indent << "img.setAlphaBuffer(1)\n"; - --indent; - out << "\n"; - out << indent << "return img\n"; - --indent; - --indent; - out << endl; - out << indent << "return TQImage()\n"; - --indent; - out << "\n"; - out << "\n"; - - out << indent << "class MimeSourceFactory_" << cProject << "(TQMimeSourceFactory):\n"; - ++indent; - out << indent << "def __init__(self):\n"; - ++indent; - out << indent << "TQMimeSourceFactory.__init__(self)\n"; - out << "\n"; - --indent; - out << indent << "def data(self,abs_name):\n"; - ++indent; - out << indent << "d = TQMimeSourceFactory.data(self,abs_name)\n"; - out << indent << "if d or abs_name.isNull():\n"; - ++indent; - out << indent << "return d\n"; - --indent; - out << "\n"; - out << indent << "img = uic_findImage(abs_name)\n"; - out << indent << "if not img.isNull():\n"; - ++indent; - out << indent << "self.setImage(abs_name,img)\n"; - --indent; - out << "\n"; - out << indent << "return TQMimeSourceFactory.data(self,abs_name)\n"; - --indent; - --indent; - out << "\n"; - out << "\n"; - - out << indent << "factory = None\n"; - out << "\n"; - - out << indent << "def qInitImages_" << cProject << "():\n"; - ++indent; - out << indent << "global factory\n"; - out << "\n"; - out << indent << "if factory is None:\n"; - ++indent; - out << indent << "factory = MimeSourceFactory_" << cProject << "()\n"; - out << indent << "TQMimeSourceFactory.defaultFactory().addFactory(factory)\n"; - --indent; - --indent; - out << "\n"; - out << "\n"; - - out << indent << "def qCleanupImages_" << cProject << "():\n"; - ++indent; - out << indent << "global factory\n"; - out << "\n"; - out << indent << "if factory is not None:\n"; - ++indent; - out << indent << "TQMimeSourceFactory.defaultFactory().removeFactory(factory)\n"; - out << indent << "factory = None\n"; - --indent; - --indent; - out << "\n"; - out << "\n"; - - out << indent << "class StaticInitImages_" << cProject << ":\n"; - ++indent; - out << indent << "def __init__(self):\n"; - ++indent; - out << indent << "self.cleanup = qCleanupImages_" << cProject << "\n"; - out << indent << "qInitImages_" << cProject << "()\n"; - --indent; - out << "\n"; - out << indent << "def __del__(self):\n"; - ++indent; - out << indent << "self.cleanup()\n"; - --indent; - --indent; - out << "\n"; - out << "\n"; - - out << "staticImages = StaticInitImages_" << cProject << "()\n"; - } -} diff --git a/pyuic3/form.cpp b/pyuic3/form.cpp deleted file mode 100644 index 8c7a374..0000000 --- a/pyuic3/form.cpp +++ /dev/null @@ -1,938 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** This file is part of TQt Designer. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#include -#include "uic.h" -#include "parser.h" -#include "widgetdatabase.h" -#include "domtool.h" -#include -#include -#include -#include -#define NO_STATIC_COLORS -#include - -#if TQT_VERSION < 0x030100 -#include -#endif - -static TQByteArray unzipXPM( TQString data, ulong& length ) -{ -#if TQT_VERSION >= 0x030100 - const int lengthOffset = 4; - int baSize = data.length() / 2 + lengthOffset; - uchar *ba = new uchar[ baSize ]; - for ( int i = lengthOffset; i < baSize; ++i ) { - char h = data[ 2 * (i-lengthOffset) ].latin1(); - char l = data[ 2 * (i-lengthOffset) + 1 ].latin1(); - uchar r = 0; - if ( h <= '9' ) - r += h - '0'; - else - r += h - 'a' + 10; - r = r << 4; - if ( l <= '9' ) - r += l - '0'; - else - r += l - 'a' + 10; - ba[ i ] = r; - } - // tqUncompress() expects the first 4 bytes to be the expected length of the - // uncompressed data - ba[0] = ( length & 0xff000000 ) >> 24; - ba[1] = ( length & 0x00ff0000 ) >> 16; - ba[2] = ( length & 0x0000ff00 ) >> 8; - ba[3] = ( length & 0x000000ff ); - TQByteArray baunzip = tqUncompress( ba, baSize ); - delete[] ba; - return baunzip; -#else - uchar *ba = new uchar[ data.length() / 2 ]; - for ( int i = 0; i < (int)data.length() / 2; ++i ) { - char h = data[ 2 * i ].latin1(); - char l = data[ 2 * i + 1 ].latin1(); - uchar r = 0; - if ( h <= '9' ) - r += h - '0'; - else - r += h - 'a' + 10; - r = r << 4; - if ( l <= '9' ) - r += l - '0'; - else - r += l - 'a' + 10; - ba[ i ] = r; - } - // I'm not sure this makes sense. Why couldn't the compressed data be - // less than 20% of the original data? Maybe it's enough to trust the - // `length' passed as an argument. Quoting the zlib header: - // Upon entry, destLen is the total size of the destination - // buffer, which must be large enough to hold the entire - // uncompressed data. (The size of the uncompressed data must - // have been saved previously by the compressor and transmitted - // to the decompressor by some mechanism outside the scope of - // this compression library.) - // Which is the role of `length'. On the other hand this could prevent - // crashes in some cases of slightly corrupt UIC files. - if ( length < data.length() * 5 ) - length = data.length() * 5; - TQByteArray baunzip( length ); - ::uncompress( (uchar*) baunzip.data(), &length, ba, data.length()/2 ); - delete[] ba; - return baunzip; -#endif -} - - - -/*! - Creates an implementation ( cpp-file ) for the form given in \a e - - \sa createFormDecl(), createObjectImpl() - */ -void Uic::createFormImpl( const TQDomElement &e ) -{ - TQDomElement n; - TQDomNodeList nl; - int i; - TQString objClass = getClassName( e ); - if ( objClass.isEmpty() ) - return; - TQString objName = getObjectName( e ); - - // generate local and local includes required - TQStringList globalIncludes; - TQStringList::Iterator it; - TQStringList sqlClasses; - TQStringList axwidgets, databrowsers; - - TQMap customWidgetIncludes; - TQMap functionImpls; - // find additional slots and functions - TQStringList extraSlots; - TQStringList extraSlotTypes; - nl = e.parentNode().toElement().elementsByTagName( "slot" ); - for ( i = 0; i < (int) nl.length(); i++ ) { - n = nl.item(i).toElement(); - if ( n.parentNode().toElement().tagName() != "slots" - && n.parentNode().toElement().tagName() != "connections" ) - continue; - if ( n.attribute( "language", "C++" ) != "C++" ) - continue; - TQString slotName = n.firstChild().toText().data().stripWhiteSpace(); - if ( slotName.endsWith( ";" ) ) - slotName = slotName.left( slotName.length() - 1 ); - - extraSlots += Parser::cleanArgs(slotName); - extraSlotTypes += n.attribute( "returnType", "void" ); - } - - for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "functions" ) { // compatibility - for ( TQDomElement n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { - if ( n2.tagName() == "function" ) { - TQString fname = n2.attribute( "name" ); - fname = Parser::cleanArgs( fname ); - functionImpls.insert( fname, n2.firstChild().toText().data() ); - } - } - } - } - - // additional includes (local or global ) and forward declaractions - nl = e.parentNode().toElement().elementsByTagName( "include" ); - for ( i = 0; i < (int) nl.length(); i++ ) { - TQDomElement n2 = nl.item(i).toElement(); - - TQString s = n2.firstChild().toText().data(); - if ( n2.attribute( "location" ) != "local" ) { - if ( s.right( 5 ) == ".ui.h" && !TQFile::exists( s ) ) - continue; - if ( n2.attribute( "impldecl", "in implementation" ) != "in implementation" ) - continue; - globalIncludes += s; - } - } - - // do the local includes afterwards, since global includes have priority on clashes - TQFileInfo fi(fileName); - - for ( i = 0; i < (int) nl.length(); i++ ) { - TQDomElement n2 = nl.item(i).toElement(); - TQString s = n2.firstChild().toText().data(); - if ( n2.attribute( "location" ) == "local" &&!globalIncludes.contains( s ) ) { - if ( s.right( 5 ) != ".ui.h" ) - continue; - - if ( !TQFile::exists( s ) ) - { - s = fi.dirPath() + "/" + s; - - if ( !TQFile::exists( s ) ) - continue; - } - - if ( TQFile::exists( s ) ) - { - TQFile f(s); - f.open(IO_ReadOnly); - TQTextStream headerStream(&f); - TQString line; - TQString functionText; - TQString functionName; - TQRegExp rx("void .*::(.*\\(.*\\))"); - int pos, inFunction = 0; - - while (line = headerStream.readLine()) - { - pos = rx.search(line); - - if (pos > -1) - { - if (inFunction) - functionImpls.insert(Parser::cleanArgs(functionName),functionText); - - functionName = rx.cap(1); - functionText = ""; - inFunction = 1; - } - functionText += line + "\n"; - } - - if (inFunction) - functionImpls.insert(Parser::cleanArgs(functionName),functionText); - } - } - } - - // additional custom widget headers - nl = e.parentNode().toElement().elementsByTagName( "header" ); - for ( i = 0; i < (int) nl.length(); i++ ) { - TQDomElement n2 = nl.item(i).toElement(); - TQString s = n2.firstChild().toText().data(); - if ( n2.attribute( "location" ) != "local" ) - globalIncludes += s; - } - - // includes for child widgets - for ( it = tags.begin(); it != tags.end(); ++it ) { - nl = e.parentNode().toElement().elementsByTagName( *it ); - for ( i = 1; i < (int) nl.length(); i++ ) { // start at 1, 0 is the toplevel widget - TQString name = getClassName( nl.item(i).toElement() ); - if ( name == "Spacer" ) { - globalIncludes += "qlayout.h"; - globalIncludes += "qapplication.h"; - continue; - } - if ( name.mid( 1 ) == "ListView" ) - globalIncludes += "qheader.h"; - else if ( name == "TQAxWidget" ) - axwidgets += getObjectName(nl.item(i).toElement()); - else if ( name == "TQDataBrowser" ) - databrowsers += getObjectName(nl.item(i).toElement()); - if ( name != objClass ) { - int wid = WidgetDatabase::idFromClassName( name ); - TQMap::Iterator it = customWidgetIncludes.find( name ); - if ( it == customWidgetIncludes.end() ) - globalIncludes += WidgetDatabase::includeFile( wid ); - } - } - } - - if (globalIncludes.findIndex("qtable.h") >= 0) - out << indent << "from PyTQt.qttable import TQTable" << endl; - - if (!axwidgets.empty()) - out << indent << "from PyTQt.qtaxcontainer import TQAxWidget" << endl; - - if (globalIncludes.findIndex("tqextscintilla.h") >= 0) - out << indent << "from PyTQt.qtext import TQextScintilla" << endl; - - registerDatabases( e ); - dbConnections = unique( dbConnections ); - if ( dbConnections.count() ) - sqlClasses += "TQSqlDatabase"; - if ( dbCursors.count() ) - sqlClasses += "TQSqlCursor"; - bool dbForm = FALSE; - if ( dbForms[ "(default)" ].count() ) - dbForm = TRUE; - bool subDbForms = FALSE; - for ( it = dbConnections.begin(); it != dbConnections.end(); ++it ) { - if ( !(*it).isEmpty() && (*it) != "(default)" ) { - if ( dbForms[ (*it) ].count() ) { - subDbForms = TRUE; - break; - } - } - } - if ( dbForm || subDbForms ) { - sqlClasses += "TQSqlForm"; - sqlClasses += "TQSqlRecord"; - } - - if (globalIncludes.findIndex("qdatatable.h") >= 0) - sqlClasses += "TQDataTable"; - - if (globalIncludes.findIndex("qtableview.h") >= 0) - sqlClasses += "TQTableView"; - - if (globalIncludes.findIndex("qdatabrowser.h") >= 0) - sqlClasses += "TQDataBrowser"; - - if (globalIncludes.findIndex("qdataview.h") >= 0) - sqlClasses += "TQDataView"; - - if ( !sqlClasses.empty() ) { - out << indent << "from PyTQt.qtsql import"; - const char *sep = " "; - - for ( it = sqlClasses.begin(); it != sqlClasses.end(); ++it ) { - out << sep << (*it); - sep = ", "; - } - - out << endl; - } - - // Add any code from the comments. - if (!pyCode.isEmpty()) - out << pyCode; - - out << endl; - - // find out what images are required - TQStringList requiredImages; - static const char *imgTags[] = { "pixmap", "iconset", 0 }; - for ( i = 0; imgTags[i] != 0; i++ ) { - nl = e.parentNode().toElement().elementsByTagName( imgTags[i] ); - for ( int j = 0; j < (int) nl.length(); j++ ) { - TQDomNode nn = nl.item(j); - while ( nn.parentNode() != e.parentNode() ) - nn = nn.parentNode(); - if ( nn.nodeName() != "customwidgets" ) - requiredImages += nl.item(j).firstChild().toText().data(); - } - } - - // register the object and unify its name - objName = registerObject( objName ); - - TQStringList images; - TQStringList xpmImages; - if ( pixmapLoaderFunction.isEmpty() && !externPixmaps ) { - // create images - for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "images" ) { - nl = n.elementsByTagName( "image" ); - for ( i = 0; i < (int) nl.length(); i++ ) { - TQString img = registerObject( nl.item(i).toElement().attribute( "name" ) ); - if ( !requiredImages.contains( img ) ) - continue; - TQDomElement tmp = nl.item(i).firstChild().toElement(); - if ( tmp.tagName() != "data" ) - continue; - TQString format = tmp.attribute("format", "PNG" ); - TQString data = tmp.firstChild().toText().data(); - if ( format == "XPM.GZ" ) { - xpmImages += img; - ulong length = tmp.attribute("length").toULong(); - TQByteArray baunzip = unzipXPM( data, length ); - length = baunzip.size(); - // shouldn't we test the initial `length' against the - // resulting `length' to catch corrupt UIC files? - int a = 0; - out << indent << img << "_data = [" << endl; - while ( baunzip[a] != '\"' ) - a++; - for ( ; a < (int) length; a++ ) - { - char ch; - - if ((ch = baunzip[a]) == '}') - { - out << endl << "]"; - break; - } - - out << ch; - } - out << endl; - } else { - images += img; - out << indent << img << "_data = \\" << endl; - ++indent; - out << indent << "\""; - int a ; - for ( a = 0; a < (int) (data.length()/2)-1; a++ ) { - out << "\\x" << TQString(data[2*a]) << TQString(data[2*a+1]); - if ( a % 12 == 11 ) - out << "\" \\" << endl << indent << "\""; - } - out << "\\x" << TQString(data[2*a]) << TQString(data[2*a+1]) << "\"" << endl; - --indent; - } - } - } - } - out << endl; - } else if ( externPixmaps ) { -#if TQT_VERSION >= 0x030100 - pixmapLoaderFunction = "TQPixmap.fromMimeSource"; -#else - out << indent << "def uic_load_pixmap_" << objName << "(name):" << endl; - ++indent; - out << indent << "pix = TQPixmap()" << endl; - out << indent << "m = TQMimeSourceFactory.defaultFactory().data(name)" << endl; - out << endl; - out << indent << "if m:" << endl; - ++indent; - out << indent << "TQImageDrag.decode(m,pix)" << endl; - --indent; - out << endl; - out << indent << "return pix" << endl; - --indent; - out << endl; - out << endl; - pixmapLoaderFunction = "uic_load_pixmap_" + objName; -#endif - } - - - // constructor(s) - - out << indent << "class " << nameOfClass << "(" << objClass << "):" << endl; - ++indent; - - if ( objClass == "TQDialog" || objClass == "TQWizard" ) { - out << indent << "def __init__(self,parent = None,name = None,modal = 0,fl = 0):" << endl; - ++indent; - out << indent << objClass << ".__init__(self,parent,name,modal,fl)" << endl; - } else if ( objClass == "TQWidget" ) { - out << indent << "def __init__(self,parent = None,name = None,fl = 0):" << endl; - ++indent; - out << indent << objClass << ".__init__(self,parent,name,fl)" << endl; - } else if ( objClass == "TQMainWindow" ) { - out << indent << "def __init__(self,parent = None,name = None,fl = 0):" << endl; - ++indent; - out << indent << objClass << ".__init__(self,parent,name,fl)" << endl; - out << indent << "self.statusBar()" << endl; - isMainWindow = TRUE; - } else { - out << indent << "def __init__(self,parent = None,name = None):" << endl; - ++indent; - out << indent << objClass << ".__init__(self,parent,name)" << endl; - } - - out << endl; - - // create pixmaps for all images - if ( !images.isEmpty() ) { - TQStringList::Iterator it; - for ( it = images.begin(); it != images.end(); ++it ) { - out << indent << "self." << (*it) << " = TQPixmap()" << endl; - out << indent << "self." << (*it) << ".loadFromData(" << (*it) << "_data,\"PNG\")" << endl; - } - } - // create pixmaps for all images - if ( !xpmImages.isEmpty() ) { - for ( it = xpmImages.begin(); it != xpmImages.end(); ++it ) { - out << indent << "self." << (*it) << " = TQPixmap(" << (*it) << "_data)" << endl; - } - out << endl; - } - - - // set the properties - TQSize geometry( 0, 0 ); - - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "property" ) { - bool stdset = stdsetdef; - if ( n.hasAttribute( "stdset" ) ) - stdset = toBool( n.attribute( "stdset" ) ); - TQString prop = n.attribute("name"); - TQDomElement n2 = n.firstChild().toElement(); - TQString value = setObjectProperty( objClass, TQString::null, prop, n2, stdset ); - if ( value.isEmpty() ) - continue; - - if ( prop == "geometry" && n2.tagName() == "rect") { - TQDomElement n3 = n2.firstChild().toElement(); - while ( !n3.isNull() ) { - if ( n3.tagName() == "width" ) - geometry.setWidth( n3.firstChild().toText().data().toInt() ); - else if ( n3.tagName() == "height" ) - geometry.setHeight( n3.firstChild().toText().data().toInt() ); - n3 = n3.nextSibling().toElement(); - } - } else { - TQString call; - if ( stdset ) - call = "self." + mkStdSet( prop ) + "(" + value + ")"; - else - call = "self.setProperty(\"" + prop + "\",TQVariant(" + value + "))"; - - if ( n2.tagName() == "string" ) { - trout << trindent << call << endl; - } else if ( prop == "name" ) { - out << indent << "if not name:" << endl; - ++indent; - out << indent << call << endl; - --indent; - out << endl; - } else { - out << indent << call << endl; - } - } - } - } - - out << endl; - - // create all children, some forms have special requirements - - if ( objClass == "TQWizard" ) { - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( tags.contains( n.tagName() ) ) { - TQString page = createObjectImpl( n, objClass, "self" ); - TQString comment; - TQString label = DomTool::readAttribute( n, "title", "", comment ).toString(); - out << indent << "self.addPage(" << page << ",TQString(\"\"))" << endl; - trout << trindent << "self.setTitle(" << page << ","<< trcall( label, comment ) << ")" << endl; - TQVariant def( FALSE ); - if ( DomTool::hasAttribute( n, "backEnabled" ) ) - out << indent << "self.setBackEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "backEnabled", def).toBool() ) << ")" << endl; - if ( DomTool::hasAttribute( n, "nextEnabled" ) ) - out << indent << "self.setNextEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "nextEnabled", def).toBool() ) << ")" << endl; - if ( DomTool::hasAttribute( n, "finishEnabled" ) ) - out << indent << "self.setFinishEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "finishEnabled", def).toBool() ) << ")" << endl; - if ( DomTool::hasAttribute( n, "helpEnabled" ) ) - out << indent << "self.setHelpEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "helpEnabled", def).toBool() ) << ")" << endl; - if ( DomTool::hasAttribute( n, "finish" ) ) - out << indent << "self.setFinish( " << page << "," << mkBool( DomTool::readAttribute( n, "finish", def).toBool() ) << ")" << endl; - } - } - } else { // standard widgets - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( tags.contains( n.tagName() ) ) - createObjectImpl( n, objName, "self" ); - } - } - - // database support - dbConnections = unique( dbConnections ); - if ( dbConnections.count() ) - out << endl; - for ( it = dbConnections.begin(); it != dbConnections.end(); ++it ) { - if ( !(*it).isEmpty() && (*it) != "(default)") { - out << indent << "self." << (*it) << "Connection = TQSqlDatabase.database(\"" <<(*it) << "\")" << endl; - } - } - - nl = e.parentNode().toElement().elementsByTagName( "widget" ); - for ( i = 1; i < (int) nl.length(); i++ ) { // start at 1, 0 is the toplevel widget - n = nl.item(i).toElement(); - TQString s = getClassName( n ); - if ( (dbForm || subDbForms) && (s == "TQDataBrowser" || s == "TQDataView") ) { - TQString objName = getObjectName( n ); - TQString tab = getDatabaseInfo( n, "table" ); - TQString con = getDatabaseInfo( n, "connection" ); - out << indent << objName << "Form = TQSqlForm(self,\"" << objName << "Form\")" << endl; - TQDomElement n2; - for ( n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) - createFormImpl( n2, objName, con, tab ); - out << indent << "self." << objName << ".setForm(" << objName << "Form)" << endl; - } - } - - // actions, toolbars, menubar - bool needEndl = FALSE; - for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "actions" ) { - if ( !needEndl ) - out << endl; - createActionImpl( n.firstChild().toElement(), "self" ); - needEndl = TRUE; - } - } - if ( needEndl ) - out << endl; - needEndl = FALSE; - for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "toolbars" ) { - if ( !needEndl ) - out << endl; - createToolbarImpl( n, objClass, objName ); - needEndl = TRUE; - } - } - if ( needEndl ) - out << endl; - needEndl = FALSE; - for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "menubar" ) { - if ( !needEndl ) - out << endl; - createMenuBarImpl( n, objClass, objName ); - needEndl = TRUE; - } - } - if ( needEndl ) - out << endl; - - out << endl; - out << indent << "self.languageChange()" << endl; - out << endl; - - // take minimumSizeHint() into account, for height-for-width widgets - if ( !geometry.isNull() ) { - out << indent << "self.resize(TQSize(" << geometry.width() << "," - << geometry.height() <<").expandedTo(self.minimumSizeHint()))" << endl; - out << indent << "self.clearWState(TQt.WState_Polished)" << endl; - } - - for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "connections" ) { - // setup signals and slots connections - out << endl; - nl = n.elementsByTagName( "connection" ); - for ( i = 0; i < (int) nl.length(); i++ ) { - TQString sender, receiver, signal, slot; - for ( TQDomElement n2 = nl.item(i).firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { - if ( n2.tagName() == "sender" ) - sender = n2.firstChild().toText().data(); - else if ( n2.tagName() == "receiver" ) - receiver = n2.firstChild().toText().data(); - else if ( n2.tagName() == "signal" ) - signal = n2.firstChild().toText().data(); - else if ( n2.tagName() == "slot" ) - slot = n2.firstChild().toText().data(); - } - if ( sender.isEmpty() || - receiver.isEmpty() || - signal.isEmpty() || - slot.isEmpty() ) - continue; - if ( sender[0] == '<' || - receiver[0] == '<' || - signal[0] == '<' || - slot[0] == '<' ) - continue; - - sender = registeredName( sender ); - receiver = registeredName( receiver ); - - // translate formwindow name to "self" - if ( sender == objName ) - sender = "self"; - else - sender = "self." + sender; - - bool isaxwidget = (axwidgets.findIndex(receiver) >= 0); - bool isdatabrowser = (databrowsers.findIndex(receiver) >= 0); - - if ( receiver == objName ) - receiver = "self"; - else - receiver = "self." + receiver; - - out << indent << "self.connect(" << sender - << ",SIGNAL(\"" << signal << "\")," << receiver; - - // Normally we never use the SLOT() macro in case the - // connection is to a method of a Python custom widget. The - // exception is if the receiver is a TQAxWidget where it must be - // used because the slots are dynamic. - if (isaxwidget) - out << ",SLOT(\"" << slot << "\")"; - else - { - TQString mname = slot.left(slot.find('(')); - - // Rename slots that have different names in PyTQt. - if (isdatabrowser && mname == "del") - mname = "delOnCursor"; - - out << "." << mname; - } - - out << ")" << endl; - } - } else if ( n.tagName() == "tabstops" ) { - // setup tab order - out << endl; - TQString lastName; - TQDomElement n2 = n.firstChild().toElement(); - while ( !n2.isNull() ) { - if ( n2.tagName() == "tabstop" ) { - TQString name = n2.firstChild().toText().data(); - name = registeredName( name ); - if ( !lastName.isEmpty() ) - out << indent << "self.setTabOrder(self." << lastName << ",self." << name << ")" << endl; - lastName = name; - } - n2 = n2.nextSibling().toElement(); - } - } - } - - // buddies - bool firstBuddy = TRUE; - for ( TQValueList::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) { - if ( isObjectRegistered( (*buddy).buddy ) ) { - if ( firstBuddy ) { - out << endl; - } - out << indent << "self." << (*buddy).key << ".setBuddy(self." << registeredName( (*buddy).buddy ) << ")" << endl; - firstBuddy = FALSE; - } - - } - - if ( extraSlots.find( "init()" ) != extraSlots.end() ) - out << endl << indent << "self.init()" << endl; - - // end of constructor - --indent; - - // destructor - if ( extraSlots.find( "destroy()" ) != extraSlots.end() ) { - out << endl; - out << indent << "def __del__(self):" << endl; - ++indent; - out << indent << "self.destroy()" << endl; - --indent; - } - - // handle application events if required - bool needFontEventHandler = FALSE; - bool needSqlTableEventHandler = FALSE; - bool needSqlDataBrowserEventHandler = FALSE; - nl = e.elementsByTagName( "widget" ); - for ( i = 0; i < (int) nl.length(); i++ ) { - if ( !DomTool::propertiesOfType( nl.item(i).toElement() , "font" ).isEmpty() ) - needFontEventHandler = TRUE; - TQString s = getClassName( nl.item(i).toElement() ); - if ( s == "TQDataTable" || s == "TQDataBrowser" ) { - if ( !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) - continue; - if ( s == "TQDataTable" ) - needSqlTableEventHandler = TRUE; - if ( s == "TQDataBrowser" ) - needSqlDataBrowserEventHandler = TRUE; - } - if ( needFontEventHandler && needSqlTableEventHandler && needSqlDataBrowserEventHandler ) - break; - } - if ( needFontEventHandler && FALSE ) { - // indent = "\t"; // increase indentation for if-clause below - out << "/* " << endl; - out << " * Main event handler. Reimplemented to handle" << endl; - out << " * application font changes"; - out << " */" << endl; - out << "bool " << nameOfClass << "::event( TQEvent* ev )" << endl; - out << "{" << endl; - out << " bool ret = " << objClass << "::event( ev ); " << endl; - if ( needFontEventHandler ) { - ++indent; - out << " if ( ev->type() == TQEvent::ApplicationFontChange ) {" << endl; - for ( i = 0; i < (int) nl.length(); i++ ) { - n = nl.item(i).toElement(); - TQStringList list = DomTool::propertiesOfType( n, "font" ); - for ( it = list.begin(); it != list.end(); ++it ) - createExclusiveProperty( n, *it ); - } - out << " }" << endl; - --indent; - } - out << "}" << endl; - out << endl; - } - - if ( needSqlTableEventHandler || needSqlDataBrowserEventHandler ) { - out << endl; - out << indent << "# Widget polish. Reimplemented to handle default data" << endl; - if ( needSqlTableEventHandler ) - out << indent << "# table initialization." << endl; - if ( needSqlDataBrowserEventHandler ) - out << indent << "# browser initialization." << endl; - out << indent << "def polish(self):" << endl; - ++indent; - if ( needSqlTableEventHandler ) { - for ( i = 0; i < (int) nl.length(); i++ ) { - TQString s = getClassName( nl.item(i).toElement() ); - if ( s == "TQDataTable" ) { - n = nl.item(i).toElement(); - TQString c = getObjectName( n ); - TQString conn = getDatabaseInfo( n, "connection" ); - TQString tab = getDatabaseInfo( n, "table" ); - if ( !( conn.isEmpty() || tab.isEmpty() || !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) ) { - out << indent << "if self." << c << ":" << endl; - ++indent; - out << indent << "cursor = self." << c << ".sqlCursor()" << endl; - out << endl; - out << indent << "if not cursor:" << endl; - ++indent; - if ( conn == "(default)" ) - out << indent << "cursor = TQSqlCursor(\"" << tab << "\")" << endl; - else - out << indent << "cursor = TQSqlCursor(\"" << tab << "\",1,self." << conn << "Connection)" << endl; - out << indent << "if self." << c << ".isReadOnly():" << endl; - ++indent; - out << indent << "cursor.setMode(TQSqlCursor.ReadOnly)" << endl; - --indent; - out << indent << "self." << c << ".setSqlCursor(cursor,0,1)" << endl; - --indent; - out << endl; - out << indent << "if not cursor.isActive():" << endl; - ++indent; - out << indent << "self." << c << ".refresh(TQDataTable.RefreshAll)" << endl; - --indent; - --indent; - } - } - } - } - if ( needSqlDataBrowserEventHandler ) { - nl = e.elementsByTagName( "widget" ); - for ( i = 0; i < (int) nl.length(); i++ ) { - TQString s = getClassName( nl.item(i).toElement() ); - if ( s == "TQDataBrowser" ) { - TQString obj = getObjectName( nl.item(i).toElement() ); - TQString tab = getDatabaseInfo( nl.item(i).toElement(), - "table" ); - TQString conn = getDatabaseInfo( nl.item(i).toElement(), - "connection" ); - if ( !(tab.isEmpty() || !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) ) { - out << indent << "if self." << obj << ":" << endl; - ++indent; - out << indent << "if not self." << obj << ".sqlCursor():" << endl; - ++indent; - if ( conn == "(default)" ) - out << indent << "cursor = TQSqlCursor(\"" << tab << "\")" << endl; - else - out << indent << "cursor = TQSqlCursor(\"" << tab << "\",1,self." << conn << "Connection)" << endl; - out << indent << "self." << obj << ".setSqlCursor(cursor,1)" << endl; - out << indent << "self." << obj << ".refresh()" << endl; - out << indent << "self." << obj << ".first()" << endl; - --indent; - --indent; - } - } - } - } - out << indent << objClass << ".polish(self)" << endl; - --indent; - } - - out << endl; - out << endl; - out << indent << "def languageChange(self):" << endl; - uint old = indent.setIndent(0); - out << languageChangeBody << endl; - indent.setIndent(old); - - // create stubs for additional slots if necessary - if ( !extraSlots.isEmpty() && writeFunctImpl ) { - TQStringList::ConstIterator cit; - - for ( cit = extraSlots.begin(); cit != extraSlots.end(); ++cit ) { - pySlot(cit); - - bool createWarning = TRUE; - TQString fname = Parser::cleanArgs( *cit ); - TQMap::Iterator fit = functionImpls.find( fname ); - if ( fit != functionImpls.end() ) { - int begin = (*fit).find( "{" ); - TQString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 ); - createWarning = body.simplifyWhiteSpace().isEmpty(); - if ( !createWarning ) - { - ++indent; - TQString formatted_body = body.replace(TQRegExp("\n"), TQString("\n") + TQString(indent)); - out << formatted_body << endl; - --indent; - } - } - if ( createWarning ) { - out << endl; - ++indent; - if ( *cit != "init()" && *cit != "destroy()" ) - out << indent << "print(\"" << nameOfClass << "." << (*cit) << ": Not implemented yet\")" << endl; - else - out << indent << "pass" << endl; - --indent; - } - } - } - - --indent; -} - - -/*! Creates form support implementation code for the widgets given - in \a e. - - Traverses recursively over all children. - */ - -void Uic::createFormImpl( const TQDomElement& e, const TQString& form, const TQString& connection, const TQString& table ) -{ - if ( e.tagName() == "widget" && - e.attribute( "class" ) != "TQDataTable" ) { - TQString field = getDatabaseInfo( e, "field" ); - if ( !field.isEmpty() ) { - if ( isWidgetInTable( e, connection, table ) ) - out << indent << form << "Form.insert(self." << getObjectName( e ) << "," << fixString( field ) << ")" << endl; - } - } - TQDomElement n; - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - createFormImpl( n, form, connection, table ); - } -} - - -// Generate a Python slot definition. - -void Uic::pySlot(TQStringList::ConstIterator &it) -{ - out << endl; - - int astart = (*it).find('('); - out << indent << "def " << (*it).left(astart) << "(self"; - - // We don't reproduce the argument names (if any) because we would have to - // remove the types - too complicated for the moment, so we just count them - // and give them names based on their position. - - TQString args = (*it).mid(astart + 1,(*it).find(')') - astart - 1).stripWhiteSpace(); - - if (!args.isEmpty()) { - int nrargs = args.contains(',') + 1; - - for (int i = 0; i < nrargs; ++i) - out << ",a" << i; - } - - out << "):"; -} diff --git a/pyuic3/globaldefs.h b/pyuic3/globaldefs.h deleted file mode 100644 index 4704ff9..0000000 --- a/pyuic3/globaldefs.h +++ /dev/null @@ -1,56 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** This file is part of TQt Designer. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#ifndef GLOBALDEFS_H -#define GLOBALDEFS_H - -#include -#include - -#define BOXLAYOUT_DEFAULT_MARGIN 11 -#define BOXLAYOUT_DEFAULT_SPACING 6 - -#ifndef NO_STATIC_COLORS -static TQColor *backColor1 = 0; -static TQColor *backColor2 = 0; -static TQColor *selectedBack = 0; - -static void init_colors() -{ - if ( backColor1 ) - return; - -#if 0 // a calculated alternative for backColor1 - TQColorGroup myCg = tqApp->palette().active(); - int h1, s1, v1; - int h2, s2, v2; - myCg.color( TQColorGroup::Base ).hsv( &h1, &s1, &v1 ); - myCg.color( TQColorGroup::Background ).hsv( &h2, &s2, &v2 ); - TQColor c( h1, s1, ( v1 + v2 ) / 2, TQColor::Hsv ); -#endif - - backColor1 = new TQColor( 250, 248, 235 ); - backColor2 = new TQColor( 255, 255, 255 ); - selectedBack = new TQColor( 230, 230, 230 ); -} - -#endif - -#endif diff --git a/pyuic3/main.cpp b/pyuic3/main.cpp deleted file mode 100644 index e54000c..0000000 --- a/pyuic3/main.cpp +++ /dev/null @@ -1,244 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** Copyright (c) 2001 Phil Thompson -** -** This file is part of TQt Designer. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#include "uic.h" -#include "parser.h" -#include "widgetdatabase.h" -#include "domtool.h" -#include -#include -#include -#include -#define NO_STATIC_COLORS -#include -#include -#include -#include - -int main( int argc, char * argv[] ) -{ - PyIndent indent; - bool testCode = FALSE, execCode = FALSE; - bool subcl = FALSE; - bool imagecollection = FALSE; - TQStringList images; - const char *error = 0; - const char* fileName = 0; - TQCString outputFile; - const char* projectName = 0; - const char* trmacro = 0; - bool fix = FALSE; - TQApplication app(argc, argv, FALSE); - TQString className, uicClass; - - for ( int n = 1; n < argc && error == 0; n++ ) { - TQCString arg = argv[n]; - if ( arg[0] == '-' ) { // option - TQCString opt = &arg[1]; - if ( opt[0] == 'o' ) { // output redirection - if ( opt[1] == '\0' ) { - if ( !(n < argc-1) ) { - error = "Missing output-file name"; - break; - } - outputFile = argv[++n]; - } else - outputFile = &opt[1]; - } else if ( opt[0] == 'e' || opt == "embed" ) { - imagecollection = TRUE; - if ( opt == "embed" || opt[1] == '\0' ) { - if ( !(n < argc-1) ) { - error = "Missing name of project"; - break; - } - projectName = argv[++n]; - } else - projectName = &opt[1]; - } else if ( opt == "subimpl" ) { - subcl = TRUE; - if ( !(n < argc-1) ) { - error = "Missing class name"; - break; - } - className = argv[++n]; - } else if ( opt == "tr" ) { - if ( opt == "tr" || opt[1] == '\0' ) { - if ( !(n < argc-1) ) { - error = "Missing tr macro"; - break; - } - trmacro = argv[++n]; - } else { - trmacro = &opt[1]; - } - } else if ( opt == "version" ) { - fprintf( stderr, - "Python User Interface Compiler %s for TQt version %s\n", - PYTQT_VERSION, TQT_VERSION_STR ); - return 1; - } else if ( opt == "help" ) { - break; - } else if ( opt == "fix" ) { - fix = TRUE; - } else if ( opt[0] == 'p' ) { - uint tabstop; - bool ok; - - if ( opt[1] == '\0' ) { - if ( !(n < argc-1) ) { - error = "Missing Python indent"; - break; - } - tabstop = TQCString(argv[++n]).toUInt(&ok); - } else - tabstop = opt.mid(1).toUInt(&ok); - - if (ok) - indent.setTabStop(tabstop); - else - error = "Invalid Python indent"; - } else if ( opt == "test" ) { - testCode = TRUE; - } else if ( opt == "x" ) { - execCode = TRUE; - } else { - error = "Unrecognized option"; - } - } else { - if ( imagecollection ) - images << argv[n]; - else if ( fileName ) // can handle only one file - error = "Too many input files specified"; - else - fileName = argv[n]; - } - } - - if ( argc < 2 || error || (!fileName && !imagecollection ) ) { - fprintf( stderr, "PyTQt user interface compiler.\n" ); - if ( error ) - fprintf( stderr, "pyuic: %s\n", error ); - - fprintf( stderr, "Usage: %s [options] [mode] \n" - "\nGenerate implementation:\n" - " %s [options] \n" - "Generate image collection:\n" - " %s [options] -embed ...\n" - "\t\tproject name\n" - "\t\timage files\n" - "Generate subclass implementation:\n" - " %s [options] -subimpl \n" - "\t\tname of the subclass to generate\n" - "Options:\n" - "\t-o file\t\tWrite output to file rather than stdout\n" - "\t-p indent\tSet the Python indent in spaces (0 to use a tab)\n" - "\t-tr func\tUse func() rather than TQApplication.translate() for i18n\n" - "\t-x\t\tGenerate extra code to test and display the class\n" - "\t-test\t\tGenerate extra code to test but not display the class\n" - "\t-version\tDisplay version of pyuic\n" - "\t-help\t\tDisplay this information\n" - , argv[0], argv[0], argv[0], argv[0]); - return 1; - } - - Uic::setIndent(indent); - - TQFile fileOut; - if ( !outputFile.isEmpty() ) { - fileOut.setName( outputFile ); - if (!fileOut.open( IO_WriteOnly ) ) - tqFatal( "pyuic: Could not open output file '%s'", outputFile.data() ); - } else { - fileOut.open( IO_WriteOnly, stdout ); - } - TQTextStream out( &fileOut ); - - if ( imagecollection ) { - out.setEncoding( TQTextStream::UnicodeUTF8 ); - out << "# -*- coding: latin-1 -*-\n\n"; - Uic::embed( out, projectName, images ); - return 0; - } - - - out.setEncoding( TQTextStream::UnicodeUTF8 ); - TQFile file( fileName ); - if ( !file.open( IO_ReadOnly ) ) - tqFatal( "pyuic: Could not open file '%s' ", fileName ); - - TQDomDocument doc; - TQString errMsg; - int errLine; - if ( !doc.setContent( &file, &errMsg, &errLine ) ) - tqFatal( TQString("pyuic: Failed to parse %s: ") + errMsg + TQString (" in line %d\n"), fileName, errLine ); - - TQDomElement e = doc.firstChild().toElement(); - if ( e.hasAttribute("version") && e.attribute("version").toDouble() > 3.3 ) { - tqWarning( TQString("pyuic: File generated with too recent version of TQt Designer (%s vs. %s)"), - e.attribute("version").utf8(), TQT_VERSION_STR ); - return 1; - } - - DomTool::fixDocument( doc ); - - if ( fix ) { - out << doc.toString(); - return 0; - } - - out << "# -*- coding: utf-8 -*-\n\n"; - - if ( !subcl ) { - out << "# Form implementation generated from reading ui file '" << fileName << "'" << endl; - out << "#" << endl; - out << "# Created by: The PyTQt User Interface Compiler (pyuic) " << PYTQT_VERSION << endl; - out << "#" << endl; - out << "# WARNING! All changes made in this file will be lost!" << endl; - out << endl; - out << endl; - } - - if (testCode || execCode) - out << "import sys" << endl; - - out << "from PyTQt.qt import *" << endl; - - Uic( fileName, outputFile, out, doc, subcl, trmacro, className, uicClass ); - - if (testCode || execCode) { - out << endl; - out << indent << "if __name__ == \"__main__\":" << endl; - ++indent; - out << indent << "a = TQApplication(sys.argv)" << endl; - out << indent << "TQObject.connect(a,SIGNAL(\"lastWindowClosed()\"),a,SLOT(\"quit()\"))" << endl; - out << indent << "w = " << (subcl ? className : uicClass) << "()" << endl; - out << indent << "a.setMainWidget(w)" << endl; - - if (execCode) { - out << indent << "w.show()" << endl; - out << indent << "a.exec_loop()" << endl; - } - - --indent; - } - - return 0; -} diff --git a/pyuic3/object.cpp b/pyuic3/object.cpp deleted file mode 100644 index 1b7232f..0000000 --- a/pyuic3/object.cpp +++ /dev/null @@ -1,704 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** This file is part of TQt Designer. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#include "uic.h" -#include "parser.h" -#include "domtool.h" -#include -#include -#include -#define NO_STATIC_COLORS -#include - - -/*! - Creates an implementation for the object given in \a e. - - Traverses recursively over all children. - - Returns the name of the generated child object. - */ - -static bool createdCentralWidget = FALSE; - -TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& par, const TQString& layout ) -{ - TQString parent( par ); - if ( parent == "self" && isMainWindow ) { - if ( !createdCentralWidget ) - out << indent << "self.setCentralWidget(TQWidget(self,\"qt_central_widget\"))" << endl; - createdCentralWidget = TRUE; - parent = "self.centralWidget()"; - } - TQDomElement n; - TQString objClass, objName, fullObjName; - int numItems = 0; - int numColumns = 0; - int numRows = 0; - - if ( layouts.contains( e.tagName() ) ) - return createLayoutImpl( e, parentClass, parent, layout ); - - objClass = getClassName( e ); - if ( objClass.isEmpty() ) - return objName; - objName = getObjectName( e ); - - TQString definedName = objName; - bool isTmpObject = objName.isEmpty() || objClass == "TQLayoutWidget"; - if ( isTmpObject ) { - if ( objClass[0] == 'Q' ) - objName = objClass.mid(1); - else - objName = objClass.lower(); - } - - bool isLine = objClass == "Line"; - if ( isLine ) - objClass = "TQFrame"; - - out << endl; - if ( objClass == "TQLayoutWidget" ) { - if ( layout.isEmpty() ) { - // register the object and unify its name - objName = registerObject( objName ); - out << indent << objName << " = TQWidget(" << parent << ",\"" << definedName << "\")" << endl; - } else { - // the layout widget is not necessary, hide it by creating its child in the parent - TQString result; - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if (tags.contains( n.tagName() ) ) - result = createObjectImpl( n, parentClass, parent, layout ); - } - return result; - } - - // Layouts don't go into the class instance dictionary. - fullObjName = objName; - } else if ( objClass != "TQToolBar" && objClass != "TQMenuBar" ) { - // register the object and unify its name - objName = registerObject( objName ); - - // Temporary objects don't go into the class instance dictionary. - fullObjName = isTmpObject ? objName : "self." + objName; - - out << indent << fullObjName << " = " << createObjectInstance( objClass, parent, objName ) << endl; - } - else - fullObjName = "self." + objName; - - if ( objClass == "TQAxWidget" ) { - TQString controlId; - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "property" && n.attribute( "name" ) == "control" ) { - controlId = n.firstChild().toElement().text(); - } - } - out << indent << fullObjName << ".setControl(\"" << controlId << "\")" << endl; - } - - lastItem = "None"; - // set the properties and insert items - bool hadFrameShadow = FALSE; - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "property" ) { - bool stdset = stdsetdef; - if ( n.hasAttribute( "stdset" ) ) - stdset = toBool( n.attribute( "stdset" ) ); - TQString prop = n.attribute( "name" ); - if ( prop == "database" ) - continue; - TQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset ); - if ( value.isEmpty() ) - continue; - if ( prop == "name" ) - continue; - if ( isLine && prop == "frameShadow" ) - hadFrameShadow = TRUE; - if ( prop == "buddy" && value.startsWith("\"") && value.endsWith("\"") ) { - buddies << Buddy( objName, value.mid(1, value.length() - 2 ) ); - continue; - } - if ( isLine && prop == "orientation" ) { - prop = "frameShape"; - if ( value.right(10) == "Horizontal" ) - value = "TQFrame.HLine"; - else - value = "TQFrame.VLine"; - if ( !hadFrameShadow ) { - prop = "frameStyle"; - value += " | TQFrame.Sunken"; - } - } - if ( prop == "buttonGroupId" ) { - if ( parentClass == "TQButtonGroup" ) - out << indent << parent << ".insert( " << fullObjName << "," << value << ")" << endl; - continue; - } - if ( prop == "frameworkCode" ) - continue; - if ( objClass == "TQMultiLineEdit" && - TQRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) ) - continue; - TQString call = fullObjName + "."; - TQString tail; - if ( stdset ) { - call += mkStdSet( prop ) + "("; - tail = ")"; - } else { - call += "setProperty(\"" + prop + "\",TQVariant("; - tail = "))"; - } - if ( prop == "accel" ) { - call += "TQKeySequence("; - tail += ")"; - } - call += value + tail; - - if ( n.firstChild().toElement().tagName() == "string" || - prop == "currentItem" ) { - trout << trindent << call << endl; - } else { - out << indent << call << endl; - } - } else if ( n.tagName() == "item" ) { - TQString call; - TQString value; - - if ( objClass.contains( "ListBox" ) ) { - call = createListBoxItemImpl( n, fullObjName ); - if ( !call.isEmpty() ) { - if ( numItems == 0 ) - trout << trindent << fullObjName << ".clear()" << endl; - trout << trindent << call << endl; - } - } else if ( objClass.contains( "ComboBox" ) ) { - call = createListBoxItemImpl( n, fullObjName, &value ); - if ( !call.isEmpty() ) { - if ( numItems == 0 ) - trout << trindent << fullObjName << ".clear()" << endl; - trout << trindent << call << endl; - } - } else if ( objClass.contains( "IconView" ) ) { - call = createIconViewItemImpl( n, fullObjName ); - if ( !call.isEmpty() ) { - if ( numItems == 0 ) - trout << trindent << fullObjName << ".clear()" << endl; - trout << trindent << call << endl; - } - } else if ( objClass.contains( "ListView" ) ) { - call = createListViewItemImpl( n, fullObjName, TQString::null ); - if ( !call.isEmpty() ) { - if ( numItems == 0 ) - trout << trindent << fullObjName << ".clear()" << endl; - trout << call << endl; - } - } - if ( !call.isEmpty() ) - numItems++; - } else if ( n.tagName() == "column" || n.tagName() == "row" ) { - TQString call; - TQString value; - - if ( objClass.contains( "ListView" ) ) { - call = createListViewColumnImpl( n, fullObjName, &value ); - if ( !call.isEmpty() ) { - out << call; - trout << trindent << fullObjName << ".header().setLabel(" - << numColumns++ << "," << value << ")\n"; - } - } else if ( objClass == "TQTable" || objClass == "TQDataTable" ) { - bool isCols = ( n.tagName() == "column" ); - call = createTableRowColumnImpl( n, fullObjName, &value ); - if ( !call.isEmpty() ) { - out << call; - trout << trindent << fullObjName << "." - << ( isCols ? "horizontalHeader" : "verticalHeader" ) - << "().setLabel(" - << ( isCols ? numColumns++ : numRows++ ) - << "," << value << ")\n"; - } - } - } - } - - // create all children, some widgets have special requirements - - if ( objClass == "TQTabWidget" ) { - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( tags.contains( n.tagName() ) ) { - TQString page = createObjectImpl( n, objClass, fullObjName ); - TQString comment; - TQString label = DomTool::readAttribute( n, "title", "", comment ).toString(); - out << indent << fullObjName << ".insertTab(" << page << ",TQString.fromUtf8(\"\"))" << endl; - trout << trindent << fullObjName << ".changeTab(" << page << "," << trcall( label, comment ) << ")" << endl; - } - } - } else if ( objClass == "TQWidgetStack" ) { - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( tags.contains( n.tagName() ) ) { - TQString page = createObjectImpl( n, objClass, fullObjName ); - int id = DomTool::readAttribute( n, "id", "" ).toInt(); - out << indent << fullObjName << ".addWidget(" << page << "," << id << ")" << endl; - } - } - } else if ( objClass == "TQToolBox" ) { - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( tags.contains( n.tagName() ) ) { - TQString page = createObjectImpl( n, objClass, fullObjName ); - TQString comment; - TQString label = DomTool::readAttribute( n, "label", "", comment ).toString(); - out << indent << fullObjName << ".addItem(" << page << ",TQString.fromUtf8(\"\"))" << endl; - trout << trindent << fullObjName << ".setItemLabel(" << fullObjName - << ".indexOf(" << page << ")," << trcall( label, comment ) - << ")" << endl; - } - } - } else if ( objClass != "TQToolBar" && objClass != "TQMenuBar" ) { // standard widgets - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( tags.contains( n.tagName() ) ) - createObjectImpl( n, objClass, fullObjName ); - } - } - - return fullObjName; -} - - - -/*! - Creates a set-call for property \a exclusiveProp of the object - given in \a e. - - If the object does not have this property, the function does nothing. - - Exclusive properties are used to generate the implementation of - application font or palette change handlers in createFormImpl(). - - */ -void Uic::createExclusiveProperty( const TQDomElement & e, const TQString& exclusiveProp ) -{ - TQDomElement n; - TQString objClass = getClassName( e ); - if ( objClass.isEmpty() ) - return; - TQString objName = getObjectName( e ); -#if 0 // it's not clear whether this check should be here or not - if ( objName.isEmpty() ) - return; -#endif - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "property" ) { - bool stdset = stdsetdef; - if ( n.hasAttribute( "stdset" ) ) - stdset = toBool( n.attribute( "stdset" ) ); - TQString prop = n.attribute( "name" ); - if ( prop != exclusiveProp ) - continue; - TQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset ); - if ( value.isEmpty() ) - continue; - out << indent << indent << objName << ".setProperty(\"" << prop << "\",TQVariant(" << value << "))" << endl; - } - } -} - - -/* Convert a TQSizePolicy::SizeType to text. */ -static TQString mapSizeType(TQSizePolicy::SizeType st) -{ - const char *txt; - - switch (st) - { - case TQSizePolicy::Fixed: - txt = "TQSizePolicy.Fixed"; - break; - - case TQSizePolicy::Minimum: - txt = "TQSizePolicy.Minimum"; - break; - - case TQSizePolicy::Maximum: - txt = "TQSizePolicy.Maximum"; - break; - - case TQSizePolicy::Preferred: - txt = "TQSizePolicy.Preferred"; - break; - - case TQSizePolicy::MinimumExpanding: - txt = "TQSizePolicy.MinimumExpanding"; - break; - - case TQSizePolicy::Expanding: - txt = "TQSizePolicy.Expanding"; - break; - - case TQSizePolicy::Ignored: - txt = "TQSizePolicy.Ignored"; - break; - - default: - txt = "Invalid TQSizePolicy::SizeType"; - } - - return txt; -} - - -/*! Attention: this function has to be in sync with - Resource::saveProperty() and DomTool::elementToVariant. If you - change one, change all. - */ -TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj, const TQString &prop, const TQDomElement &e, bool stdset ) -{ - TQString v; - if ( e.tagName() == "rect" ) { - TQDomElement n3 = e.firstChild().toElement(); - int x = 0, y = 0, w = 0, h = 0; - while ( !n3.isNull() ) { - if ( n3.tagName() == "x" ) - x = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "y" ) - y = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "width" ) - w = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "height" ) - h = n3.firstChild().toText().data().toInt(); - n3 = n3.nextSibling().toElement(); - } - v = "TQRect(%1,%2,%3,%4)"; - v = v.arg(x).arg(y).arg(w).arg(h); - - } else if ( e.tagName() == "point" ) { - TQDomElement n3 = e.firstChild().toElement(); - int x = 0, y = 0; - while ( !n3.isNull() ) { - if ( n3.tagName() == "x" ) - x = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "y" ) - y = n3.firstChild().toText().data().toInt(); - n3 = n3.nextSibling().toElement(); - } - v = "TQPoint(%1,%2)"; - v = v.arg(x).arg(y); - } else if ( e.tagName() == "size" ) { - TQDomElement n3 = e.firstChild().toElement(); - int w = 0, h = 0; - while ( !n3.isNull() ) { - if ( n3.tagName() == "width" ) - w = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "height" ) - h = n3.firstChild().toText().data().toInt(); - n3 = n3.nextSibling().toElement(); - } - v = "TQSize(%1,%2)"; - v = v.arg(w).arg(h); - } else if ( e.tagName() == "color" ) { - TQDomElement n3 = e.firstChild().toElement(); - int r = 0, g = 0, b = 0; - while ( !n3.isNull() ) { - if ( n3.tagName() == "red" ) - r = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "green" ) - g = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "blue" ) - b = n3.firstChild().toText().data().toInt(); - n3 = n3.nextSibling().toElement(); - } - v = "TQColor(%1,%2,%3)"; - v = v.arg(r).arg(g).arg(b); - } else if ( e.tagName() == "font" ) { - TQDomElement n3 = e.firstChild().toElement(); - TQString attrname = e.parentNode().toElement().attribute( "name", "font" ); - TQString fontname; - if ( !obj.isEmpty() ) { - fontname = registerObject( obj + "_" + attrname ); - out << indent << fontname << " = TQFont(self." << obj << ".font())" << endl; - } else { - fontname = registerObject( "f" ); - out << indent << fontname << " = TQFont(self.font())" << endl; - } - while ( !n3.isNull() ) { - if ( n3.tagName() == "family" ) - out << indent << fontname << ".setFamily(\"" << n3.firstChild().toText().data() << "\")" << endl; - else if ( n3.tagName() == "pointsize" ) - out << indent << fontname << ".setPointSize(" << n3.firstChild().toText().data() << ")" << endl; - else if ( n3.tagName() == "bold" ) - out << indent << fontname << ".setBold(" << mkBool( n3.firstChild().toText().data() ) << ")" << endl; - else if ( n3.tagName() == "italic" ) - out << indent << fontname << ".setItalic(" << mkBool( n3.firstChild().toText().data() ) << ")" << endl; - else if ( n3.tagName() == "underline" ) - out << indent << fontname << ".setUnderline(" << mkBool( n3.firstChild().toText().data() ) << ")" << endl; - else if ( n3.tagName() == "strikeout" ) - out << indent << fontname << ".setStrikeOut(" << mkBool( n3.firstChild().toText().data() ) << ")" << endl; - n3 = n3.nextSibling().toElement(); - } - - if ( prop == "font" ) { - if ( !obj.isEmpty() ) - out << indent << "self." << obj << ".setFont(" << fontname << ")" << endl; - else - out << indent << "self.setFont(" << fontname << ")" << endl; - } else { - v = fontname; - } - } else if ( e.tagName() == "string" ) { - TQString txt = e.firstChild().toText().data(); - TQString com = getComment( e.parentNode() ); - - if ( prop == "toolTip" && objClass != "TQAction" && objClass != "TQActionGroup" ) { - if ( !obj.isEmpty() ) - trout << trindent << "TQToolTip.add(self." << obj << "," - << trcall( txt, com ) << ")" << endl; - else - trout << trindent << "TQToolTip.add(self," - << trcall( txt, com ) << ")" << endl; - } else if ( prop == "whatsThis" && objClass != "TQAction" && objClass != "TQActionGroup" ) { - if ( !obj.isEmpty() ) - trout << trindent << "TQWhatsThis.add(self." << obj << "," - << trcall( txt, com ) << ")" << endl; - else - trout << trindent << "TQWhatsThis.add(self," - << trcall( txt, com ) << ")" << endl; - } else { - v = trcall( txt, com ); - } - } else if ( e.tagName() == "cstring" ) { - v = "\"%1\""; - v = v.arg( e.firstChild().toText().data() ); - } else if ( e.tagName() == "number" ) { - v = "%1"; - v = v.arg( e.firstChild().toText().data() ); - } else if ( e.tagName() == "bool" ) { - if ( stdset ) - v = "%1"; - else - v = "TQVariant(%1)"; - v = v.arg( mkBool( e.firstChild().toText().data() ) ); - } else if ( e.tagName() == "pixmap" ) { - v = e.firstChild().toText().data(); - if ( !v.isEmpty() ) { - if ( pixmapLoaderFunction.isEmpty() ) { - v.prepend( "self." ); - } else { - v.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); - v.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); - } - } - } else if ( e.tagName() == "iconset" ) { - v = "TQIconSet(%1)"; - TQString s = e.firstChild().toText().data(); - if ( !s.isEmpty() ) { - if ( pixmapLoaderFunction.isEmpty() ) { - s.prepend( "self." ); - } else { - s.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); - s.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); - } - } - v = v.arg( s ); - } else if ( e.tagName() == "image" ) { - v = e.firstChild().toText().data() + ".convertToImage()"; - } else if ( e.tagName() == "enum" ) { - v = "%1.%2"; - TQString oc = objClass; - TQString ev = e.firstChild().toText().data(); - if ( oc == "TQListView" && ev == "Manual" ) // #### workaround, rename TQListView::Manual in 4.0 - oc = "TQScrollView"; - v = v.arg( oc ).arg( ev ); - } else if ( e.tagName() == "set" ) { - TQString keys( e.firstChild().toText().data() ); - TQStringList lst = TQStringList::split( '|', keys ); - v = ""; - TQStringList::Iterator it = lst.begin(); - while ( it != lst.end() ) { - v += objClass + "." + *it; - if ( it != lst.fromLast() ) - v += " | "; - ++it; - } - } else if ( e.tagName() == "sizepolicy" ) { - TQDomElement n3 = e.firstChild().toElement(); - TQSizePolicy sp; - while ( !n3.isNull() ) { - if ( n3.tagName() == "hsizetype" ) - sp.setHorData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); - else if ( n3.tagName() == "vsizetype" ) - sp.setVerData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); - else if ( n3.tagName() == "horstretch" ) - sp.setHorStretch( n3.firstChild().toText().data().toInt() ); - else if ( n3.tagName() == "verstretch" ) - sp.setVerStretch( n3.firstChild().toText().data().toInt() ); - n3 = n3.nextSibling().toElement(); - } - TQString tmp = "self."; - if ( !obj.isEmpty() ) - tmp += obj + "."; - v = "TQSizePolicy(%1,%2,%3,%4," + tmp + "sizePolicy().hasHeightForWidth())"; - v = v.arg( mapSizeType(sp.horData()) ).arg( mapSizeType(sp.verData()) ).arg( sp.horStretch() ).arg( sp.verStretch() ); - } else if ( e.tagName() == "palette" ) { - TQPalette pal; - bool no_pixmaps = e.elementsByTagName( "pixmap" ).count() == 0; - TQDomElement n; - if ( no_pixmaps ) { - n = e.firstChild().toElement(); - while ( !n.isNull() ) { - TQColorGroup cg; - if ( n.tagName() == "active" ) { - cg = loadColorGroup( n ); - pal.setActive( cg ); - } else if ( n.tagName() == "inactive" ) { - cg = loadColorGroup( n ); - pal.setInactive( cg ); - } else if ( n.tagName() == "disabled" ) { - cg = loadColorGroup( n ); - pal.setDisabled( cg ); - } - n = n.nextSibling().toElement(); - } - } - if ( no_pixmaps && pal == TQPalette( pal.active().button(), pal.active().background() ) ) { - v = "TQPalette(TQColor(%1,%2,%3),TQColor(%1,%2,%3))"; - v = v.arg( pal.active().button().red() ).arg( pal.active().button().green() ).arg( pal.active().button().blue() ); - v = v.arg( pal.active().background().red() ).arg( pal.active().background().green() ).arg( pal.active().background().blue() ); - } else { - TQString palette = "pal"; - if ( !pal_used ) { - out << indent << palette << " = TQPalette()" << endl; - pal_used = TRUE; - } - TQString cg = "cg"; - if ( !cg_used ) { - out << indent << cg << " = TQColorGroup()" << endl; - cg_used = TRUE; - } - n = e.firstChild().toElement(); - while ( !n.isNull() && n.tagName() != "active" ) - n = n.nextSibling().toElement(); - createColorGroupImpl( cg, n ); - out << indent << palette << ".setActive(" << cg << ")" << endl; - - n = e.firstChild().toElement(); - while ( !n.isNull() && n.tagName() != "inactive" ) - n = n.nextSibling().toElement(); - createColorGroupImpl( cg, n ); - out << indent << palette << ".setInactive(" << cg << ")" << endl; - - n = e.firstChild().toElement(); - while ( !n.isNull() && n.tagName() != "disabled" ) - n = n.nextSibling().toElement(); - createColorGroupImpl( cg, n ); - out << indent << palette << ".setDisabled(" << cg << ")" << endl; - v = palette; - } - } else if ( e.tagName() == "cursor" ) { - v = "TQCursor(%1)"; - v = v.arg( e.firstChild().toText().data() ); - } else if ( e.tagName() == "date" ) { - TQDomElement n3 = e.firstChild().toElement(); - int y, m, d; - y = m = d = 0; - while ( !n3.isNull() ) { - if ( n3.tagName() == "year" ) - y = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "month" ) - m = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "day" ) - d = n3.firstChild().toText().data().toInt(); - n3 = n3.nextSibling().toElement(); - } - v = "TQDate(%1,%2,%3)"; - v = v.arg(y).arg(m).arg(d); - } else if ( e.tagName() == "time" ) { - TQDomElement n3 = e.firstChild().toElement(); - int h, m, s; - h = m = s = 0; - while ( !n3.isNull() ) { - if ( n3.tagName() == "hour" ) - h = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "minute" ) - m = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "second" ) - s = n3.firstChild().toText().data().toInt(); - n3 = n3.nextSibling().toElement(); - } - v = "TQTime(%1,%2,%3)"; - v = v.arg(h).arg(m).arg(s); - } else if ( e.tagName() == "datetime" ) { - TQDomElement n3 = e.firstChild().toElement(); - int h, mi, s, y, mo, d; - h = mi = s = y = mo = d = 0; - while ( !n3.isNull() ) { - if ( n3.tagName() == "hour" ) - h = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "minute" ) - mi = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "second" ) - s = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "year" ) - y = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "month" ) - mo = n3.firstChild().toText().data().toInt(); - else if ( n3.tagName() == "day" ) - d = n3.firstChild().toText().data().toInt(); - n3 = n3.nextSibling().toElement(); - } - v = "TQDateTime(TQDate(%1,%2,%3),TQTime(%4,%5,%6))"; - v = v.arg(y).arg(mo).arg(d).arg(h).arg(mi).arg(s); - } else if ( e.tagName() == "stringlist" ) { - TQStringList l; - TQDomElement n3 = e.firstChild().toElement(); - TQString listname = "l"; - if ( !obj.isEmpty() ) { - listname = obj + "_stringlist"; - listname = registerObject( listname ); - out << indent << listname << " = TQStringList()" << endl; - } else { - out << indent << listname << " = TQStringList()" << endl; - } - while ( !n3.isNull() ) { - if ( n3.tagName() == "string" ) - out << indent << listname << ".append(\"" << n3.firstChild().toText().data().simplifyWhiteSpace() << "\")" << endl; - n3 = n3.nextSibling().toElement(); - } - v = listname; - } - return v; -} - - - - -/*! Extracts a named object property from \a e. - */ -TQDomElement Uic::getObjectProperty( const TQDomElement& e, const TQString& name ) -{ - TQDomElement n; - for ( n = e.firstChild().toElement(); - !n.isNull(); - n = n.nextSibling().toElement() ) { - if ( n.tagName() == "property" && n.toElement().attribute("name") == name ) - return n; - } - return n; -} - diff --git a/pyuic3/parser.cpp b/pyuic3/parser.cpp deleted file mode 100644 index fc6aae4..0000000 --- a/pyuic3/parser.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** This file is part of TQt Designer. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#include "parser.h" -#include -#include - -class NormalizeObject : public TQObject -{ -public: - NormalizeObject() : TQObject() {} - static TQCString normalizeSignalSlot( const char *signalSlot ) { return TQObject::normalizeSignalSlot( signalSlot ); } -}; - -TQString Parser::cleanArgs( const TQString &func ) -{ - TQString slot( func ); - int begin = slot.find( "(" ) + 1; - TQString args = slot.mid( begin ); - args = args.left( args.find( ")" ) ); - TQStringList lst = TQStringList::split( ',', args ); - TQString res = slot.left( begin ); - for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { - if ( it != lst.begin() ) - res += ","; - TQString arg = *it; - int pos = 0; - if ( ( pos = arg.find( "&" ) ) != -1 ) { - arg = arg.left( pos + 1 ); - } else if ( ( pos = arg.find( "*" ) ) != -1 ) { - arg = arg.left( pos + 1 ); - } else { - arg = arg.simplifyWhiteSpace(); - if ( ( pos = arg.find( ':' ) ) != -1 ) - arg = arg.left( pos ).simplifyWhiteSpace() + ":" + arg.mid( pos + 1 ).simplifyWhiteSpace(); - TQStringList l = TQStringList::split( ' ', arg ); - if ( l.count() == 2 ) { - if ( l[ 0 ] != "const" && l[ 0 ] != "unsigned" && l[ 0 ] != "var" ) - arg = l[ 0 ]; - } else if ( l.count() == 3 ) { - arg = l[ 0 ] + " " + l[ 1 ]; - } - } - res += arg; - } - res += ")"; - - return TQString::fromUtf8( NormalizeObject::normalizeSignalSlot( res.utf8() ) ); -} diff --git a/pyuic3/parser.h b/pyuic3/parser.h deleted file mode 100644 index 5fdbdc2..0000000 --- a/pyuic3/parser.h +++ /dev/null @@ -1,33 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** This file is part of TQt Designer. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#ifndef PARSER_H -#define PARSER_H - -#include - -class Parser -{ -public: - static TQString cleanArgs( const TQString &func ); - -}; - -#endif diff --git a/pyuic3/pyuic-prof.sbf b/pyuic3/pyuic-prof.sbf deleted file mode 100644 index c982fd1..0000000 --- a/pyuic3/pyuic-prof.sbf +++ /dev/null @@ -1,24 +0,0 @@ -# This is the build file for pyuic for TQt v3 Professional Edition. -# -# Copyright (c) 2007 -# Riverbank Computing Limited -# -# 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. - -target = pyuic -sources = main.cpp uic.cpp form.cpp object.cpp subclassing.cpp embed.cpp widgetdatabase.cpp domtool.cpp parser.cpp qdom.cpp qxml.cpp -headers = domtool.h globaldefs.h parser.h uic.h widgetdatabase.h widgetinterface.h diff --git a/pyuic3/pyuic.pro.in b/pyuic3/pyuic.pro.in deleted file mode 100644 index 5c9b3e8..0000000 --- a/pyuic3/pyuic.pro.in +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2001 -# Phil Thompson -# Copyright (c) 2002, 2003 -# Riverbank Computing Limited -# -# The project file for pyuic for TQt v3. - - -TEMPLATE = app -CONFIG += qt console warn_on release @PYQT_RBPROF@ -INCLUDEPATH += @BLX_INCLUDEPATH@ $(TQTDIR)/src/3rdparty/zlib -DEFINES += UIC QT_INTERNAL_XML @BLX_DEFINES@ - -DESTDIR = @PYQT_BINDIR@ -TARGET = pyuic - -HEADERS = uic.h \ - widgetdatabase.h \ - domtool.h \ - parser.h \ - widgetinterface.h - -SOURCES = main.cpp \ - uic.cpp \ - form.cpp \ - object.cpp \ - subclassing.cpp \ - embed.cpp \ - widgetdatabase.cpp \ - domtool.cpp \ - parser.cpp - -rbprof:exists($(TQTDIR)/src/qt_professional.pri) { - QT_SOURCE_TREE = $(TQTDIR) - include($(TQTDIR)/src/qt_professional.pri) -} diff --git a/pyuic3/pyuic.sbf b/pyuic3/pyuic.sbf deleted file mode 100644 index d8fdccf..0000000 --- a/pyuic3/pyuic.sbf +++ /dev/null @@ -1,24 +0,0 @@ -# This is the build file for pyuic for TQt v3. -# -# Copyright (c) 2007 -# Riverbank Computing Limited -# -# 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. - -target = pyuic -sources = main.cpp uic.cpp form.cpp object.cpp subclassing.cpp embed.cpp widgetdatabase.cpp domtool.cpp parser.cpp -headers = domtool.h globaldefs.h parser.h uic.h widgetdatabase.h widgetinterface.h diff --git a/pyuic3/subclassing.cpp b/pyuic3/subclassing.cpp deleted file mode 100644 index 9cb1ee1..0000000 --- a/pyuic3/subclassing.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** This file is part of TQt Designer. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#include "uic.h" -#include "parser.h" -#include "widgetdatabase.h" -#include "domtool.h" -#include -#include -#include -#define NO_STATIC_COLORS -#include -#include -#include -#include - - -/*! - Creates an implementation for a subclass \a subClass of the form - given in \a e - - \sa createSubDecl() - */ -void Uic::createSubImpl( const TQDomElement &e, const TQString& subClass ) -{ - TQDomElement n; - TQDomNodeList nl; - int i; - - TQString objClass = getClassName( e ); - if ( objClass.isEmpty() ) - return; - - TQString supClsMod = fileName; - int tail = supClsMod.findRev('.',-1); - if (tail >= 0) - supClsMod.truncate(tail); - - out << indent << "from " << supClsMod << " import " << nameOfClass << endl; - out << endl; - out << endl; - - out << indent << "class " << subClass << "(" << nameOfClass << "):" << endl; - ++indent; - out << endl; - - // constructor - if ( objClass == "TQDialog" || objClass == "TQWizard" ) { - out << indent << "def __init__(self,parent = None,name = None,modal = 0,fl = 0):" << endl; - ++indent; - out << indent << nameOfClass << ".__init__(self,parent,name,modal,fl)" << endl; - } else { // standard TQWidget - out << indent << "def __init__(self,parent = None,name = None,fl = 0):" << endl; - ++indent; - out << indent << nameOfClass << ".__init__(self,parent,name,fl)" << endl; - } - --indent; - - // find additional functions - TQStringList publicSlots, protectedSlots, privateSlots; - TQStringList publicSlotTypes, protectedSlotTypes, privateSlotTypes; - TQStringList publicSlotSpecifier, protectedSlotSpecifier, privateSlotSpecifier; - TQStringList publicFuncts, protectedFuncts, privateFuncts; - TQStringList publicFunctRetTyp, protectedFunctRetTyp, privateFunctRetTyp; - TQStringList publicFunctSpec, protectedFunctSpec, privateFunctSpec; - - nl = e.parentNode().toElement().elementsByTagName( "slot" ); - for ( i = 0; i < (int) nl.length(); i++ ) { - n = nl.item(i).toElement(); - if ( n.parentNode().toElement().tagName() != "slots" - && n.parentNode().toElement().tagName() != "connections" ) - continue; - if ( n.attribute( "language", "C++" ) != "C++" ) - continue; - TQString returnType = n.attribute( "returnType", "void" ); - TQString functionName = n.firstChild().toText().data().stripWhiteSpace(); - if ( functionName.endsWith( ";" ) ) - functionName = functionName.left( functionName.length() - 1 ); - TQString specifier = n.attribute( "specifier" ); - TQString access = n.attribute( "access" ); - if ( access == "protected" ) { - protectedSlots += functionName; - protectedSlotTypes += returnType; - protectedSlotSpecifier += specifier; - } else if ( access == "private" ) { - privateSlots += functionName; - privateSlotTypes += returnType; - privateSlotSpecifier += specifier; - } else { - publicSlots += functionName; - publicSlotTypes += returnType; - publicSlotSpecifier += specifier; - } - } - - nl = e.parentNode().toElement().elementsByTagName( "function" ); - for ( i = 0; i < (int) nl.length(); i++ ) { - n = nl.item(i).toElement(); - if ( n.parentNode().toElement().tagName() != "functions" ) - continue; - if ( n.attribute( "language", "C++" ) != "C++" ) - continue; - TQString returnType = n.attribute( "returnType", "void" ); - TQString functionName = n.firstChild().toText().data().stripWhiteSpace(); - if ( functionName.endsWith( ";" ) ) - functionName = functionName.left( functionName.length() - 1 ); - TQString specifier = n.attribute( "specifier" ); - TQString access = n.attribute( "access" ); - if ( access == "protected" ) { - protectedFuncts += functionName; - protectedFunctRetTyp += returnType; - protectedFunctSpec += specifier; - } else if ( access == "private" ) { - privateFuncts += functionName; - privateFunctRetTyp += returnType; - privateFunctSpec += specifier; - } else { - publicFuncts += functionName; - publicFunctRetTyp += returnType; - publicFunctSpec += specifier; - } - } - - if ( !publicFuncts.isEmpty() ) - writeFunctionsSubImpl( publicFuncts, publicFunctRetTyp, publicFunctSpec, subClass, "public function" ); - - // create stubs for public additional slots - if ( !publicSlots.isEmpty() ) - writeFunctionsSubImpl( publicSlots, publicSlotTypes, publicSlotSpecifier, subClass, "public slot" ); - - if ( !protectedFuncts.isEmpty() ) - writeFunctionsSubImpl( protectedFuncts, protectedFunctRetTyp, protectedFunctSpec, subClass, "protected function" ); - - // create stubs for protected additional slots - if ( !protectedSlots.isEmpty() ) - writeFunctionsSubImpl( protectedSlots, protectedSlotTypes, protectedSlotSpecifier, subClass, "protected slot" ); - - if ( !privateFuncts.isEmpty() ) - writeFunctionsSubImpl( privateFuncts, privateFunctRetTyp, privateFunctSpec, subClass, "private function" ); - - // create stubs for private additional slots - if ( !privateSlots.isEmpty() ) - writeFunctionsSubImpl( privateSlots, privateSlotTypes, privateSlotSpecifier, subClass, "private slot" ); - - --indent; -} - -void Uic::writeFunctionsSubImpl( const TQStringList &fuLst, const TQStringList &typLst, const TQStringList &specLst, - const TQString &subClass, const TQString &descr ) -{ - TQValueListConstIterator it, it2, it3; - for ( it = fuLst.begin(), it2 = typLst.begin(), it3 = specLst.begin(); - it != fuLst.end(); ++it, ++it2, ++it3 ) { - TQString type = *it2; - if ( type.isEmpty() ) - type = "void"; - if ( *it3 == "non virtual" ) - continue; - out << endl; - out << indent << "# " << descr << endl; - pySlot(it); - ++indent; - out << endl; - out << indent << "print(\"" << subClass << "." << (*it) << ": Not implemented yet\")" << endl; - --indent; - } - out << endl; -} diff --git a/pyuic3/uic.cpp b/pyuic3/uic.cpp deleted file mode 100644 index 8d0613c..0000000 --- a/pyuic3/uic.cpp +++ /dev/null @@ -1,1145 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** Copyright (c) 2004 Phil Thompson -** -** This file is part of TQt Designer. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#include "uic.h" -#include "parser.h" -#include "widgetdatabase.h" -#include "domtool.h" -#include -#include -#include -#define NO_STATIC_COLORS -#include -#include -#include -#include - -bool Uic::isMainWindow = FALSE; -PyIndent Uic::indent; -PyIndent Uic::trindent; - - -// Re-calculate the indent string based on the current number and nature of the -// indent. -void PyIndent::calc() -{ - indstr.truncate(0); - - for (uint i = current; i > 0; --i) - if (tabStop == 0) - indstr += '\t'; - else - for (uint t = 0; t < tabStop; ++t) - indstr += ' '; -} - - -TQString Uic::getComment( const TQDomNode& n ) -{ - TQDomNode child = n.firstChild(); - while ( !child.isNull() ) { - if ( child.toElement().tagName() == "comment" ) - return child.toElement().firstChild().toText().data(); - child = child.nextSibling(); - } - return TQString::null; -} - -TQString Uic::mkBool( bool b ) -{ - return b? "1" : "0"; -} - -TQString Uic::mkBool( const TQString& s ) -{ - return mkBool( s == "true" || s == "1" ); -} - -bool Uic::toBool( const TQString& s ) -{ - return s == "true" || s.toInt() != 0; -} - -TQString Uic::fixString( const TQString &str, bool encode ) -{ -#if TQT_VERSION >= 0x030100 - TQString s; - if ( !encode ) { - s = str; - s.replace( "\\", "\\\\" ); - s.replace( "\"", "\\\"" ); - s.replace( "\r", "" ); - s.replace( "\n", "\\n\"\n\"" ); - } else { - TQCString utf8 = str.utf8(); - const int l = utf8.length(); - - for ( int i = 0; i < l; ++i ) { - uchar ch = (uchar)utf8[i]; - - if (ch != 0x0d) { // skip \r - s += "\\x"; - - if (ch <= 0x0f) - s += "0"; - - s += TQString::number( ch, 16 ); - } - } - } -#else - TQString s( str ); - s.replace( TQRegExp( "\\\\" ), "\\\\" ); - s.replace( TQRegExp( "\"" ), "\\\"" ); - s.replace( TQRegExp( "\r?\n" ), "\\n\"\n\"" ); -#endif - return "\"" + s + "\""; -} - -TQString Uic::trcall( const TQString& sourceText, const TQString& comment ) -{ - if ( sourceText.isEmpty() && comment.isEmpty() ) - return "TQString.null"; - - TQString t = trmacro; - bool encode = FALSE; - if ( t.isNull() ) { - t = "self.__tr"; - for ( int i = 0; i < (int) sourceText.length(); i++ ) { - if ( sourceText[i].unicode() >= 0x80 ) { - t = "self.__trUtf8"; - encode = TRUE; - break; - } - } - - if (encode) - pyNeedTrUtf8 = TRUE; - else - pyNeedTr = TRUE; - } - - if ( comment.isEmpty() ) { - return t + "(" + fixString( sourceText, encode ) + ")"; - } else { - return t + "(" + fixString( sourceText, encode ) + "," + - fixString( comment, encode ) + ")"; - } -} - -TQString Uic::mkStdSet( const TQString& prop ) -{ - return TQString( "set" ) + prop[0].upper() + prop.mid(1); -} - - - -/*! - \class Uic uic.h - \brief User Interface Compiler - - The class Uic encapsulates the user interface compiler (uic). - */ -Uic::Uic( const TQString &fn, const char *outputFn, TQTextStream &outStream, - TQDomDocument doc, bool subcl, const TQString &trm, - const TQString& subClass, TQString &uicClass ) - : out( outStream ), trout (&languageChangeBody ), - outputFileName( outputFn ), trmacro( trm ), - pyNeedTr(FALSE), pyNeedTrUtf8(FALSE) -{ - fileName = fn; - writeFunctImpl = TRUE; - defMargin = BOXLAYOUT_DEFAULT_MARGIN; - defSpacing = BOXLAYOUT_DEFAULT_SPACING; - externPixmaps = FALSE; - - trindent.setIndent(2); - - item_used = cg_used = pal_used = 0; - - layouts << "hbox" << "vbox" << "grid"; - tags = layouts; - tags << "widget"; - - pixmapLoaderFunction = getPixmapLoaderFunction( doc.firstChild().toElement() ); - nameOfClass = getFormClassName( doc.firstChild().toElement() ); - -#if TQT_VERSION >= 0x030300 - uiFileVersion = doc.firstChild().toElement().attribute("version"); -#endif - stdsetdef = toBool( doc.firstChild().toElement().attribute("stdsetdef") ); - - if ( doc.firstChild().isNull() || doc.firstChild().firstChild().isNull() ) - return; - - // Extract any Python code in the comments. - TQStringList comm = TQStringList::split('\n',getComment(doc.firstChild())); - - for (TQStringList::Iterator it = comm.begin(); it != comm.end(); ++it) - if ((*it).startsWith("Python:")) - pyCode += (*it).mid(7) + "\n"; - - TQDomElement e = doc.firstChild().firstChild().toElement(); - TQDomElement widget; - while ( !e.isNull() ) { - if ( e.tagName() == "widget" ) { - widget = e; - } else if ( e.tagName() == "pixmapinproject" ) { - externPixmaps = TRUE; - } else if ( e.tagName() == "layoutdefaults" ) { - defSpacing = e.attribute( "spacing", defSpacing.toString() ); - defMargin = e.attribute( "margin", defMargin.toString() ); - } else if ( e.tagName() == "layoutfunctions" ) { - defSpacing = e.attribute( "spacing", defSpacing.toString() ); - - bool ok; - defSpacing.toInt( &ok ); - if ( !ok ) { - TQString buf = defSpacing.toString(); - defSpacing = buf.append( "()" ); - } - defMargin = e.attribute( "margin", defMargin.toString() ); - defMargin.toInt( &ok ); - if ( !ok ) { - TQString buf = defMargin.toString(); - defMargin = buf.append( "()" ); - } - } - e = e.nextSibling().toElement(); - } - e = widget; - - if ( nameOfClass.isEmpty() ) - nameOfClass = getObjectName( e ); - - uicClass = nameOfClass; - - namespaces = TQStringList::split( "::", nameOfClass ); - bareNameOfClass = namespaces.last(); - namespaces.remove( namespaces.fromLast() ); - - if ( subcl ) { - createSubImpl( e, subClass ); - } else { - createFormImpl( e ); - } - - ++indent; - - if (pyNeedTr) - { - out << "\n"; - out << indent << "def __tr(self,s,c = None):\n"; - ++indent; - out << indent << "return tqApp.translate(b\"" << nameOfClass << "\",s.encode(),c)\n"; - --indent; - } - - if (pyNeedTrUtf8) - { - out << "\n"; - out << indent << "def __trUtf8(self,s,c = None):\n"; - ++indent; - out << indent << "return tqApp.translate(b\"" << nameOfClass << "\",s.encode(),c,TQApplication.UnicodeUTF8)\n"; - --indent; - } - - --indent; -} - -/*! Extracts a pixmap loader function from \a e - */ -TQString Uic::getPixmapLoaderFunction( const TQDomElement& e ) -{ - TQDomElement n; - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "pixmapfunction" ) - return n.firstChild().toText().data(); - } - return TQString::null; -} - - -/*! Extracts the forms class name from \a e - */ -TQString Uic::getFormClassName( const TQDomElement& e ) -{ - TQDomElement n; - TQString cn; - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "class" ) { - TQString s = n.firstChild().toText().data(); - int i; - while ( ( i = s.find(' ' )) != -1 ) - s[i] = '_'; - cn = s; - } - } - return cn; -} - -/*! Extracts a class name from \a e. - */ -TQString Uic::getClassName( const TQDomElement& e ) -{ - TQString s = e.attribute( "class" ); - if ( s.isEmpty() && e.tagName() == "toolbar" ) - s = "TQToolBar"; - else if ( s.isEmpty() && e.tagName() == "menubar" ) - s = "TQMenuBar"; - return s; -} - -/*! Returns TRUE if database framework code is generated, else FALSE. -*/ - -bool Uic::isFrameworkCodeGenerated( const TQDomElement& e ) -{ - TQDomElement n = getObjectProperty( e, "frameworkCode" ); - if ( n.attribute("name") == "frameworkCode" && - !DomTool::elementToVariant( n.firstChild().toElement(), TQVariant( TRUE ) ).toBool() ) - return FALSE; - return TRUE; -} - -/*! Extracts an object name from \a e. It's stored in the 'name' - property. - */ -TQString Uic::getObjectName( const TQDomElement& e ) -{ - TQDomElement n = getObjectProperty( e, "name" ); - if ( n.firstChild().toElement().tagName() == "cstring" ) - return n.firstChild().toElement().firstChild().toText().data(); - return TQString::null; -} - -/*! Extracts an layout name from \a e. It's stored in the 'name' - property of the preceeding sibling (the first child of a TQLayoutWidget). - */ -TQString Uic::getLayoutName( const TQDomElement& e ) -{ - TQDomElement p = e.parentNode().toElement(); - TQString name; - - if ( getClassName(p) != "TQLayoutWidget" ) - name = "Layout"; - - TQDomElement n = getObjectProperty( p, "name" ); - if ( n.firstChild().toElement().tagName() == "cstring" ) { - name.prepend( n.firstChild().toElement().firstChild().toText().data() ); - return TQStringList::split( "::", name ).last(); - } - return e.tagName(); -} - - -TQString Uic::getDatabaseInfo( const TQDomElement& e, const TQString& tag ) -{ - TQDomElement n; - TQDomElement n1; - int child = 0; - // database info is a stringlist stored in this order - if ( tag == "connection" ) - child = 0; - else if ( tag == "table" ) - child = 1; - else if ( tag == "field" ) - child = 2; - else - return TQString::null; - n = getObjectProperty( e, "database" ); - if ( n.firstChild().toElement().tagName() == "stringlist" ) { - // find correct stringlist entry - TQDomElement n1 = n.firstChild().firstChild().toElement(); - for ( int i = 0; i < child && !n1.isNull(); ++i ) - n1 = n1.nextSibling().toElement(); - if ( n1.isNull() ) - return TQString::null; - return n1.firstChild().toText().data(); - } - return TQString::null; -} - - -/*! - Returns include file for class \a className or a null string. - */ -TQString Uic::getInclude( const TQString& className ) -{ - int wid = WidgetDatabase::idFromClassName( className ); - if ( wid != -1 ) - return WidgetDatabase::includeFile( wid ); - return TQString::null; -} - - -void Uic::createActionImpl( const TQDomElement &n, const TQString &parent ) -{ - for ( TQDomElement ae = n; !ae.isNull(); ae = ae.nextSibling().toElement() ) { - TQString objName = registerObject( getObjectName( ae ) ); - if ( ae.tagName() == "action" ) - out << indent << "self." << objName << " = TQAction(" << parent << ",\"" << objName << "\")" << endl; - else if ( ae.tagName() == "actiongroup" ) - out << indent << "self." << objName << " = TQActionGroup(" << parent << ",\"" << objName << "\")" << endl; - else - continue; - bool subActionsDone = FALSE; -#if TQT_VERSION >= 0x030300 - bool hasMenuText = FALSE; - TQString actionText; -#endif - for ( TQDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { - if ( n2.tagName() == "property" ) { - bool stdset = stdsetdef; - if ( n2.hasAttribute( "stdset" ) ) - stdset = toBool( n2.attribute( "stdset" ) ); - TQString prop = n2.attribute("name"); - if ( prop == "name" ) - continue; - TQString value = setObjectProperty( "TQAction", objName, prop, n2.firstChild().toElement(), stdset ); - if ( value.isEmpty() ) - continue; - - TQString call = "self." + objName + "."; - if ( stdset ) - call += mkStdSet( prop ) + "(" + value + ")"; - else - call += "setProperty(\"" + prop + "\",TQVariant(" + value + "))"; - -#if TQT_VERSION >= 0x030300 - if (prop == "menuText") - hasMenuText = TRUE; - else if (prop == "text") - actionText = value; -#endif - - if ( n2.firstChild().toElement().tagName() == "string" ) { - trout << trindent << call << endl; - } else { - out << indent << call << endl; - } - } else if ( !subActionsDone && ( n2.tagName() == "actiongroup" || n2.tagName() == "action" ) ) { - createActionImpl( n2, "self." + objName ); - subActionsDone = TRUE; - } - } -#if TQT_VERSION >= 0x030300 - // workaround for loading pre-3.3 files expecting bogus TQAction behavior - if (!hasMenuText && !actionText.isEmpty() && uiFileVersion < "3.3") - trout << indent << "self." << objName << ".setMenuText(" << actionText << ")" << endl; -#endif - } -} - -TQString get_dock( const TQString &d ) -{ - if ( d == "0" ) - return "TQt.DockUnmanaged"; - if ( d == "1" ) - return "TQt.DockTornOff"; - if ( d == "2" ) - return "TQt.DockTop"; - if ( d == "3" ) - return "TQt.DockBottom"; - if ( d == "4" ) - return "TQt.DockRight"; - if ( d == "5" ) - return "TQt.DockLeft"; - if ( d == "6" ) - return "TQt.DockMinimized"; - return ""; -} - -void Uic::createToolbarImpl( const TQDomElement &n, const TQString &parentClass, const TQString &parent ) -{ - TQDomNodeList nl = n.elementsByTagName( "toolbar" ); - for ( int i = 0; i < (int) nl.length(); i++ ) { - TQDomElement ae = nl.item( i ).toElement(); - TQString dock = get_dock( ae.attribute( "dock" ) ); - TQString objName = getObjectName( ae ); - out << indent << "self." << objName << " = TQToolBar(TQString(\"\"),self," << dock << ")" << endl; - createObjectImpl( ae, parentClass, parent ); - for ( TQDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { - if ( n2.tagName() == "action" ) { - out << indent << "self." << n2.attribute( "name" ) << ".addTo(self." << objName << ")" << endl; - } else if ( n2.tagName() == "separator" ) { - out << indent << "self." << objName << ".addSeparator()" << endl; - } else if ( n2.tagName() == "widget" ) { - if ( n2.attribute( "class" ) != "Spacer" ) { - createObjectImpl( n2, "TQToolBar", "self." + objName ); - } else { - TQString child = createSpacerImpl( n2, parentClass, parent, objName ); - out << indent << "TQApplication.sendPostedEvents(self." << objName - << ",TQEvent.ChildInserted)" << endl; - out << indent << "self." << objName << ".boxLayout().addItem(" << child << ")" << endl; - } - } - } - } -} - -void Uic::createMenuBarImpl( const TQDomElement &n, const TQString &parentClass, const TQString &parent ) -{ - TQString objName = getObjectName( n ); - out << indent << "self." << objName << " = TQMenuBar(self,\"" << objName << "\")" << endl; - createObjectImpl( n, parentClass, parent ); - - int i = 0; - TQDomElement c = n.firstChild().toElement(); - while ( !c.isNull() ) { - if ( c.tagName() == "item" ) { - TQString itemName = "self." + c.attribute( "name" ); - out << endl; - out << indent << itemName << " = TQPopupMenu(self)" << endl; - createPopupMenuImpl( c, parentClass, itemName ); - out << indent << "self." << objName << ".insertItem(TQString(\"\")," << itemName << "," << i << ")" << endl; - TQString findItem("self." + objName + ".findItem(%1)"); - findItem = findItem.arg(i); - trout << indent << "if " << findItem << ":" << endl; - ++indent; - trout << indent << findItem << ".setText(" << trcall( c.attribute( "text" ) ) << ")" << endl; - --indent; - } else if ( c.tagName() == "separator" ) { - out << endl; - out << indent << "self." << objName << ".insertSeparator(" << i << ")" << endl; - } - c = c.nextSibling().toElement(); - i++; - } -} - -void Uic::createPopupMenuImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent ) -{ - int i = 0; - for ( TQDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "action" || n.tagName() == "actiongroup" ) { - TQDomElement n2 = n.nextSibling().toElement(); - if ( n2.tagName() == "item" ) { // the action has a sub menu - TQString itemName = "self." + n2.attribute( "name" ); - TQString itemText = n2.attribute( "text" ); - out << indent << itemName << " = TQPopupMenu(self)" << endl; - out << indent << parent << ".setAccel(" << trcall( n2.attribute( "accel" ) ) << ","; - out << parent << ".insertItem(" << "self." << n.attribute( "name" ) << ".iconSet(),"; - out << trcall( itemText ) << "," << itemName << "))" << endl; - trout << indent << parent << ".changeItem(" << parent << ".idAt(" << i << "),"; - trout << trcall( itemText ) << ")" << endl; - createPopupMenuImpl( n2, parentClass, itemName ); - n = n2; - } else { - out << indent << "self." << n.attribute( "name" ) << ".addTo(" << parent << ")" << endl; - } - } else if ( n.tagName() == "separator" ) { - out << indent << parent << ".insertSeparator()" << endl; - } - ++i; - } -} - -/*! - Creates implementation of an listbox item tag. -*/ - -TQString Uic::createListBoxItemImpl( const TQDomElement &e, const TQString &parent , - TQString *value ) -{ - TQDomElement n = e.firstChild().toElement(); - TQString txt; - TQString com; - TQString pix; - while ( !n.isNull() ) { - if ( n.tagName() == "property" ) { - TQString attrib = n.attribute( "name" ); - TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); - if ( attrib == "text" ) { - txt = v.toString(); - com = getComment( n ); - } else if ( attrib == "pixmap" ) { - pix = v.toString(); - if ( !pix.isEmpty() ) { - if ( pixmapLoaderFunction.isEmpty() ) { - pix.prepend( "self." ); - } else { - pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "self." ) ); - pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); - } - } - } - } - n = n.nextSibling().toElement(); - } - - if ( value ) - *value = trcall( txt, com ); - - if ( pix.isEmpty() ) - return parent + ".insertItem(" + trcall( txt, com ) + ")"; - - return parent + ".insertItem(" + pix + "," + trcall( txt, com ) + ")"; -} - -/*! - Creates implementation of an iconview item tag. -*/ - -TQString Uic::createIconViewItemImpl( const TQDomElement &e, const TQString &parent ) -{ - TQDomElement n = e.firstChild().toElement(); - TQString txt; - TQString com; - TQString pix; - while ( !n.isNull() ) { - if ( n.tagName() == "property" ) { - TQString attrib = n.attribute( "name" ); - TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); - if ( attrib == "text" ) { - txt = v.toString(); - com = getComment( n ); - } else if ( attrib == "pixmap" ) { - pix = v.toString(); - if ( !pix.isEmpty() ) { - if ( pixmapLoaderFunction.isEmpty() ) { - pix.prepend( "self." ); - } else { - pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "self." ) ); - pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); - } - } - } - } - n = n.nextSibling().toElement(); - } - - if ( pix.isEmpty() ) - return "TQIconViewItem(" + parent + "," + trcall( txt, com ) + ")"; - else - return "TQIconViewItem(" + parent + "," + trcall( txt, com ) + "," + pix + ")"; -} - -/*! - Creates implementation of an listview item tag. -*/ - -TQString Uic::createListViewItemImpl( const TQDomElement &e, const TQString &parent, - const TQString &parentItem ) -{ - TQString s; - - TQDomElement n = e.firstChild().toElement(); - - bool hasChildren = e.elementsByTagName( "item" ).count() > 0; - TQString item; - - if ( hasChildren ) { - item = registerObject( "item" ); - } else { - item = "item"; - item_used = TRUE; - } - s = trindent + item + " = "; - - if ( !parentItem.isEmpty() ) - s += "TQListViewItem(" + parentItem + "," + lastItem + ")\n"; - else - s += "TQListViewItem(" + parent + "," + lastItem + ")\n"; - - TQStringList texts; - TQStringList pixmaps; - while ( !n.isNull() ) { - if ( n.tagName() == "property" ) { - TQString attrib = n.attribute("name"); - TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); - if ( attrib == "text" ) - texts << v.toString(); - else if ( attrib == "pixmap" ) { - TQString pix = v.toString(); - if ( !pix.isEmpty() ) { - if ( pixmapLoaderFunction.isEmpty() ) { - pix.prepend( "self." ); - } else { - pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "self." ) ); - pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); - } - } - pixmaps << pix; - } - } else if ( n.tagName() == "item" ) { - s += trindent + item + ".setOpen(1)\n"; - s += createListViewItemImpl( n, parent, item ); - } - n = n.nextSibling().toElement(); - } - - for ( int i = 0; i < (int)texts.count(); ++i ) { - if ( !texts[ i ].isEmpty() ) - s += trindent + item + ".setText(" + TQString::number( i ) + "," + trcall( texts[ i ] ) + ")\n"; - if ( !pixmaps[ i ].isEmpty() ) - s += trindent + item + ".setPixmap(" + TQString::number( i ) + "," + pixmaps[ i ] + ")\n"; - } - - lastItem = item; - return s; -} - -/*! - Creates implementation of an listview column tag. -*/ - -TQString Uic::createListViewColumnImpl( const TQDomElement &e, const TQString &parent, - TQString *value ) -{ - TQDomElement n = e.firstChild().toElement(); - TQString txt; - TQString com; - TQString pix; - bool clickable = FALSE, resizable = FALSE; - while ( !n.isNull() ) { - if ( n.tagName() == "property" ) { - TQString attrib = n.attribute("name"); - TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); - if ( attrib == "text" ) { - txt = v.toString(); - com = getComment( n ); - } else if ( attrib == "pixmap" ) { - pix = v.toString(); - if ( !pix.isEmpty() ) { - if ( pixmapLoaderFunction.isEmpty() ) { - pix.prepend( "self." ); - } else { - pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "self." ) ); - pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); - } - } - } else if ( attrib == "clickable" ) - clickable = v.toBool(); - else if ( attrib == "resizable" || attrib == "resizeable" ) - resizable = v.toBool(); - } - n = n.nextSibling().toElement(); - } - - if ( value ) - *value = trcall( txt, com ); - - TQString s; - s = indent + parent + ".addColumn(" + trcall( txt, com ) + ")\n"; - if ( !pix.isEmpty() ) - s += indent + parent + ".header().setLabel(" + parent + ".header().count() - 1,TQIconSet(" + pix + ")," + trcall( txt, com ) + ")\n"; - if ( !clickable ) - s += indent + parent + ".header().setClickEnabled(0," + parent + ".header().count() - 1)\n"; - if ( !resizable ) - s += indent + parent + ".header().setResizeEnabled(0," + parent + ".header().count() - 1)\n"; - return s; -} - -TQString Uic::createTableRowColumnImpl( const TQDomElement &e, const TQString &parent, - TQString *value ) -{ - TQString objClass = getClassName( e.parentNode().toElement() ); - TQDomElement n = e.firstChild().toElement(); - TQString txt; - TQString com; - TQString pix; - TQString field; - bool isRow = e.tagName() == "row"; - while ( !n.isNull() ) { - if ( n.tagName() == "property" ) { - TQString attrib = n.attribute("name"); - TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); - if ( attrib == "text" ) { - txt = v.toString(); - com = getComment( n ); - } else if ( attrib == "pixmap" ) { - pix = v.toString(); - if ( !pix.isEmpty() ) { - if ( pixmapLoaderFunction.isEmpty() ) { - pix.prepend( "self." ); - } else { - pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "self." ) ); - pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); - } - } - } else if ( attrib == "field" ) - field = v.toString(); - } - n = n.nextSibling().toElement(); - } - - if ( value ) - *value = trcall( txt, com ); - - // ### This generated code sucks! We have to set the number of - // rows/cols before and then only do setLabel/() - // ### careful, though, since TQDataTable has an API which makes this code pretty good - - TQString s; - if ( isRow ) { - s = indent + parent + ".setNumRows(" + parent + ".numRows() + 1)\n"; - if ( pix.isEmpty() ) - s += indent + parent + ".verticalHeader().setLabel(" + parent + ".numRows() - 1," - + trcall( txt, com ) + ")\n"; - else - s += indent + parent + ".verticalHeader().setLabel(" + parent + ".numRows() - 1,TQIconSet(" - + pix + ")," + trcall( txt, com ) + ")\n"; - } else { - if ( objClass == "TQTable" ) { - s = indent + parent + ".setNumCols(" + parent + ".numCols() + 1)\n"; - if ( pix.isEmpty() ) - s += indent + parent + ".horizontalHeader().setLabel(" + parent + ".numCols() - 1," - + trcall( txt, com ) + ")\n"; - else - s += indent + parent + ".horizontalHeader().setLabel(" + parent + ".numCols() - 1,TQIconSet(" - + pix + ")," + trcall( txt, com ) + ")\n"; - } else if ( objClass == "TQDataTable" ) { - if ( !txt.isEmpty() && !field.isEmpty() ) { - if ( pix.isEmpty() ) - out << indent << parent << ".addColumn(" << fixString( field ) << "," << trcall( txt, com ) << ")" << endl; - else - out << indent << parent << ".addColumn(" << fixString( field ) << "," << trcall( txt, com ) << ",TQIconSet(" << pix << "))" << endl; - } - } - } - return s; -} - -/*! - Creates the implementation of a layout tag. Called from createObjectImpl(). - */ -TQString Uic::createLayoutImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout ) -{ - TQDomElement n; - TQString objClass, objName; - objClass = e.tagName(); - - TQString qlayout = "TQVBoxLayout"; - if ( objClass == "hbox" ) - qlayout = "TQHBoxLayout"; - else if ( objClass == "grid" ) - qlayout = "TQGridLayout"; - - bool isGrid = e.tagName() == "grid" ; - objName = registerObject( getLayoutName( e ) ); - layoutObjects += objName; - - TQString margin = DomTool::readProperty( e, "margin", defMargin ).toString(); - TQString spacing = DomTool::readProperty( e, "spacing", defSpacing ).toString(); - TQString resizeMode = DomTool::readProperty( e, "resizeMode", TQString::null ).toString(); - - TQString optcells; - if ( isGrid ) - optcells = "1,1,"; - if ( (parentClass == "TQGroupBox" || parentClass == "TQButtonGroup") && layout.isEmpty() ) { - // special case for group box - out << indent << parent << ".setColumnLayout(0,TQt.Vertical)" << endl; - out << indent << parent << ".layout().setSpacing(" << spacing << ")" << endl; - out << indent << parent << ".layout().setMargin(" << margin << ")" << endl; - out << indent << objName << " = " << qlayout << "(" << parent << ".layout())" << endl; - out << indent << objName << ".setAlignment(TQt.AlignTop)" << endl; - } else { - out << indent << objName << " = " << qlayout << "("; - if ( layout.isEmpty() ) - out << parent; - else { - out << "None"; - if ( !DomTool::hasProperty( e, "margin" ) ) - margin = "0"; - } - out << "," << optcells << margin << "," << spacing << ",\"" << objName << "\")" << endl; - } - if ( !resizeMode.isEmpty() ) - out << indent << objName << ".setResizeMode(TQLayout." << resizeMode << ")" << endl; - - if ( !isGrid ) { - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - if ( n.tagName() == "spacer" ) { - TQString child = createSpacerImpl( n, parentClass, parent, objName ); - out << indent << objName << ".addItem(" << child << ")" << endl; - } else if ( tags.contains( n.tagName() ) ) { - TQString child = createObjectImpl( n, parentClass, parent, objName ); - if ( isLayout( child ) ) - out << indent << objName << ".addLayout(" << child << ")" << endl; - else - out << indent << objName << ".addWidget(" << child << ")" << endl; - } - } - } else { - for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - TQDomElement ae = n; - int row = ae.attribute( "row" ).toInt(); - int col = ae.attribute( "column" ).toInt(); - int rowspan = ae.attribute( "rowspan" ).toInt(); - int colspan = ae.attribute( "colspan" ).toInt(); - if ( rowspan < 1 ) - rowspan = 1; - if ( colspan < 1 ) - colspan = 1; - if ( n.tagName() == "spacer" ) { - TQString child = createSpacerImpl( n, parentClass, parent, objName ); - if ( rowspan * colspan != 1 ) - out << indent << objName << ".addMultiCell(" << child << "," - << row << "," << ( row + rowspan - 1 ) << "," << col << "," << ( col + colspan - 1 ) << ")" << endl; - else - out << indent << objName << ".addItem(" << child << "," - << row << "," << col << ")" << endl; - } else if ( tags.contains( n.tagName() ) ) { - TQString child = createObjectImpl( n, parentClass, parent, objName ); - out << endl; - TQString o = "Widget"; - if ( isLayout( child ) ) - o = "Layout"; - if ( rowspan * colspan != 1 ) - out << indent << objName << ".addMultiCell" << o << "(" << child << "," - << row << "," << ( row + rowspan - 1 ) << "," << col << "," << ( col + colspan - 1 ) << ")" << endl; - else - out << indent << objName << ".add" << o << "(" << child << "," - << row << "," << col << ")" << endl; - } - } - } - - return objName; -} - - - -TQString Uic::createSpacerImpl( const TQDomElement &e, const TQString& /*parentClass*/, const TQString& /*parent*/, const TQString& /*layout*/) -{ - TQDomElement n; - TQString objClass, objName; - objClass = e.tagName(); - objName = registerObject( getObjectName( e ) ); - - TQSize size = DomTool::readProperty( e, "sizeHint", TQSize( 0, 0 ) ).toSize(); - TQString sizeType = DomTool::readProperty( e, "sizeType", "Expanding" ).toString(); - bool isVspacer = DomTool::readProperty( e, "orientation", "Horizontal" ) == "Vertical"; - - if ( sizeType != "Expanding" && sizeType != "MinimumExpanding" && - DomTool::hasProperty( e, "geometry" ) ) { // compatibility TQt 2.2 - TQRect geom = DomTool::readProperty( e, "geometry", TQRect(0,0,0,0) ).toRect(); - size = geom.size(); - } - - if ( isVspacer ) - out << indent << objName << " = TQSpacerItem(" - << size.width() << "," << size.height() - << ",TQSizePolicy.Minimum,TQSizePolicy." << sizeType << ")" << endl; - else - out << indent << objName << " = TQSpacerItem(" - << size.width() << "," << size.height() - << ",TQSizePolicy." << sizeType << ",TQSizePolicy.Minimum)" << endl; - - return objName; -} - -static const char* const ColorRole[] = { - "Foreground", "Button", "Light", "Midlight", "Dark", "Mid", - "Text", "BrightText", "ButtonText", "Base", "Background", "Shadow", - "Highlight", "HighlightedText", "Link", "LinkVisited", 0 -}; - - -/*! - Creates a colorgroup with name \a name from the color group \a cg - */ -void Uic::createColorGroupImpl( const TQString& name, const TQDomElement& e ) -{ - TQColorGroup cg; - int r = -1; - TQDomElement n = e.firstChild().toElement(); - TQString color; - while ( !n.isNull() ) { - if ( n.tagName() == "color" ) { - r++; - TQColor col = DomTool::readColor( n ); - color = "TQColor(%1,%2,%3)"; - color = color.arg( col.red() ).arg( col.green() ).arg( col.blue() ); - if ( col == white ) - color = "TQt.white"; - else if ( col == black ) - color = "TQt.black"; - if ( n.nextSibling().toElement().tagName() != "pixmap" ) { - out << indent << name << ".setColor(TQColorGroup." << ColorRole[r] << "," << color << ")" << endl; - } - } else if ( n.tagName() == "pixmap" ) { - TQString pixmap = n.firstChild().toText().data(); - if ( pixmapLoaderFunction.isEmpty() ) { - pixmap.prepend( "self." ); - } else { - pixmap.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "self." ) ); - pixmap.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); - } - out << indent << name << ".setBrush(TQColorGroup." - << ColorRole[r] << ",TQBrush(" << color << "," << pixmap << "))" << endl; - } - n = n.nextSibling().toElement(); - } -} - -/*! - Auxiliary function to load a color group. The colorgroup must not - contain pixmaps. - */ -TQColorGroup Uic::loadColorGroup( const TQDomElement &e ) -{ - TQColorGroup cg; - int r = -1; - TQDomElement n = e.firstChild().toElement(); - TQColor col; - while ( !n.isNull() ) { - if ( n.tagName() == "color" ) { - r++; - cg.setColor( (TQColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) ); - } - n = n.nextSibling().toElement(); - } - return cg; -} - -/*! Returns TRUE if the widget properties specify that it belongs to - the database \a connection and \a table. -*/ - -bool Uic::isWidgetInTable( const TQDomElement& e, const TQString& connection, const TQString& table ) -{ - TQString conn = getDatabaseInfo( e, "connection" ); - TQString tab = getDatabaseInfo( e, "table" ); - if ( conn == connection && tab == table ) - return TRUE; - return FALSE; -} - -/*! - Registers all database connections, cursors and forms. -*/ - -void Uic::registerDatabases( const TQDomElement& e ) -{ - TQDomElement n; - TQDomNodeList nl; - int i; - nl = e.parentNode().toElement().elementsByTagName( "widget" ); - for ( i = 0; i < (int) nl.length(); ++i ) { - n = nl.item(i).toElement(); - TQString conn = getDatabaseInfo( n, "connection" ); - TQString tab = getDatabaseInfo( n, "table" ); - TQString fld = getDatabaseInfo( n, "field" ); - if ( !conn.isNull() ) { - dbConnections += conn; - if ( !tab.isNull() ) { - dbCursors[conn] += tab; - if ( !fld.isNull() ) - dbForms[conn] += tab; - } - } - } -} - -/*! - Registers an object with name \a name. - - The returned name is a valid variable identifier, as similar to \a - name as possible and guaranteed to be unique within the form. - - \sa registeredName(), isObjectRegistered() - */ -TQString Uic::registerObject( const TQString& name ) -{ - if ( objectNames.isEmpty() ) { - // some temporary variables we need - objectNames += "img"; - objectNames += "item"; - objectNames += "cg"; - objectNames += "pal"; - } - - TQString result = name; - int i; - while ( ( i = result.find(' ' )) != -1 ) { - result[i] = '_'; - } - - if ( objectNames.contains( result ) ) { - int i = 2; - while ( objectNames.contains( result + "_" + TQString::number(i) ) ) - i++; - result += "_"; - result += TQString::number(i); - } - objectNames += result; - objectMapper.insert( name, result ); - return result; -} - -/*! - Returns the registered name for the original name \a name - or \a name if \a name wasn't registered. - - \sa registerObject(), isObjectRegistered() - */ -TQString Uic::registeredName( const TQString& name ) -{ - if ( !objectMapper.contains( name ) ) - return name; - return objectMapper[name]; -} - -/*! - Returns whether the object \a name was registered yet or not. - */ -bool Uic::isObjectRegistered( const TQString& name ) -{ - return objectMapper.contains( name ); -} - - -/*! - Unifies the entries in stringlist \a list. Should really be a TQStringList feature. - */ -TQStringList Uic::unique( const TQStringList& list ) -{ - if ( list.isEmpty() ) - return list; - - TQStringList result; - for ( TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) { - if ( !result.contains(*it) ) - result += *it; - } - return result; -} - - - -/*! - Creates an instance of class \a objClass, with parent \a parent and name \a objName - */ -TQString Uic::createObjectInstance( const TQString& objClass, const TQString& parent, const TQString& objName ) -{ - - if ( objClass.mid( 1 ) == "ComboBox" ) { - return objClass + "(0," + parent + ",\"" + objName + "\")"; - } - return objClass + "(" + parent + ",\"" + objName + "\")"; -} - -bool Uic::isLayout( const TQString& name ) const -{ - return layoutObjects.contains( name ); -} diff --git a/pyuic3/uic.h b/pyuic3/uic.h deleted file mode 100644 index 1cda66b..0000000 --- a/pyuic3/uic.h +++ /dev/null @@ -1,183 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** Copyright (c) 2001 Phil Thompson -** -** This file is part of TQt Designer. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#ifndef UIC_H -#define UIC_H -#include -#include -#include -#include -#include -#include -#include - - -#define PYTQT_VERSION "3.18.1" - - -class PyIndent -{ -public: - PyIndent() : tabStop(4), current(0) {calc();} - - void setTabStop(uint n) {tabStop = n; calc();} - uint setIndent(uint i) {uint old = current; current = i; calc(); return old;} - void operator++() {++current; calc();} - void operator--() {--current; calc();} - operator TQString() {return indstr;} - -private: - uint tabStop; - uint current; - TQString indstr; - - void calc(); -}; - - -class Uic : public TQt -{ -public: - Uic( const TQString &fn, const char *outputFn, TQTextStream& out, - TQDomDocument doc, bool subcl, const TQString &trm, - const TQString& subclname, TQString &uicClass ); - - static void setIndent(const PyIndent &pyind) {indent = pyind; trindent = pyind;} - - void createFormImpl( const TQDomElement &e ); - - void createSubImpl( const TQDomElement &e, const TQString& subclname ); - - void createActionImpl( const TQDomElement& e, const TQString &parent ); - void createToolbarImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent ); - void createMenuBarImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent ); - void createPopupMenuImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent ); - TQString createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout = TQString::null ); - TQString createLayoutImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout = TQString::null ); - TQString createObjectInstance( const TQString& objClass, const TQString& parent, const TQString& objName ); - TQString createSpacerImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout = TQString::null ); - void createExclusiveProperty( const TQDomElement & e, const TQString& exclusiveProp ); - TQString createListBoxItemImpl( const TQDomElement &e, const TQString &parent, TQString *value = 0 ); - TQString createIconViewItemImpl( const TQDomElement &e, const TQString &parent ); - TQString createListViewColumnImpl( const TQDomElement &e, const TQString &parent, TQString *value = 0 ); - TQString createTableRowColumnImpl( const TQDomElement &e, const TQString &parent, TQString *value = 0 ); - TQString createListViewItemImpl( const TQDomElement &e, const TQString &parent, - const TQString &parentItem ); - void createColorGroupImpl( const TQString& cg, const TQDomElement& e ); - TQColorGroup loadColorGroup( const TQDomElement &e ); - - TQDomElement getObjectProperty( const TQDomElement& e, const TQString& name ); - TQString getPixmapLoaderFunction( const TQDomElement& e ); - TQString getFormClassName( const TQDomElement& e ); - TQString getClassName( const TQDomElement& e ); - TQString getObjectName( const TQDomElement& e ); - TQString getLayoutName( const TQDomElement& e ); - TQString getInclude( const TQString& className ); - - TQString setObjectProperty( const TQString& objClass, const TQString& obj, const TQString &prop, const TQDomElement &e, bool stdset ); - - TQString registerObject( const TQString& name ); - TQString registeredName( const TQString& name ); - bool isObjectRegistered( const TQString& name ); - TQStringList unique( const TQStringList& ); - - TQString trcall( const TQString& sourceText, const TQString& comment = "" ); - - static void embed( TQTextStream& out, const char* project, const TQStringList& images ); - -private: - TQTextStream& out; - TQTextOStream trout; - TQString languageChangeBody; - TQCString outputFileName; - TQStringList objectNames; - TQMap objectMapper; - TQStringList tags; - TQStringList layouts; - TQString formName; - TQString lastItem; - TQString trmacro; - static PyIndent indent, trindent; - - struct Buddy - { - Buddy( const TQString& k, const TQString& b ) - : key( k ), buddy( b ) {} - Buddy(){} // for valuelist - TQString key; - TQString buddy; - bool operator==( const Buddy& other ) const - { return (key == other.key); } - }; - struct CustomInclude - { - TQString header; - TQString location; - }; - TQValueList buddies; - - TQStringList layoutObjects; - bool isLayout( const TQString& name ) const; - - uint item_used : 1; - uint cg_used : 1; - uint pal_used : 1; - uint stdsetdef : 1; - uint externPixmaps : 1; - -#if TQT_VERSION >= 0x030300 - TQString uiFileVersion; -#endif - TQString nameOfClass; - TQStringList namespaces; - TQString bareNameOfClass; - TQString pixmapLoaderFunction; - - void registerDatabases( const TQDomElement& e ); - bool isWidgetInTable( const TQDomElement& e, const TQString& connection, const TQString& table ); - bool isFrameworkCodeGenerated( const TQDomElement& e ); - TQString getDatabaseInfo( const TQDomElement& e, const TQString& tag ); - void createFormImpl( const TQDomElement& e, const TQString& form, const TQString& connection, const TQString& table ); - void writeFunctionsSubImpl( const TQStringList &fuLst, const TQStringList &typLst, const TQStringList &specLst, - const TQString &subClass, const TQString &descr ); - TQStringList dbConnections; - TQMap< TQString, TQStringList > dbCursors; - TQMap< TQString, TQStringList > dbForms; - - static bool isMainWindow; - static TQString mkBool( bool b ); - static TQString mkBool( const TQString& s ); - bool toBool( const TQString& s ); - static TQString fixString( const TQString &str, bool encode = FALSE ); - static bool onlyAscii; - static TQString mkStdSet( const TQString& prop ); - static TQString getComment( const TQDomNode& n ); - TQVariant defSpacing, defMargin; - TQString fileName; - bool writeFunctImpl; - - void pySlot(TQStringList::ConstIterator &it); - - TQString pyCode; - bool pyNeedTr, pyNeedTrUtf8; -}; - -#endif diff --git a/pyuic3/widgetdatabase.cpp b/pyuic3/widgetdatabase.cpp deleted file mode 100644 index 78273a4..0000000 --- a/pyuic3/widgetdatabase.cpp +++ /dev/null @@ -1,953 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. -** -** This file is part of TQt Designer. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition -** licenses may use this file in accordance with the TQt Commercial License -** Agreement provided with the Software. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about TQt Commercial License Agreements. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#include "widgetdatabase.h" -#include "widgetinterface.h" - -#include -#define NO_STATIC_COLORS -#include -#include -#include -#include -#include -#include -#include - -#include - -const int dbsize = 300; -const int dbcustom = 200; -const int dbdictsize = 211; -static WidgetDatabaseRecord* db[ dbsize ]; -static TQDict *className2Id = 0; -static int dbcount = 0; -static int dbcustomcount = 200; -static TQStrList *wGroups; -static TQStrList *invisibleGroups; -static bool whatsThisLoaded = FALSE; -static TQPluginManager *widgetPluginManager = 0; -static bool plugins_set_up = FALSE; -static bool was_in_setup = FALSE; - -TQCleanupHandler > cleanup_manager; - -WidgetDatabaseRecord::WidgetDatabaseRecord() -{ - isForm = FALSE; - isContainer = FALSE; - icon = 0; - nameCounter = 0; - isCommon = FALSE; - isPlugin = FALSE; -} - -WidgetDatabaseRecord::~WidgetDatabaseRecord() -{ - delete icon; -} - - -/*! - \class WidgetDatabase widgetdatabase.h - \brief The WidgetDatabase class holds information about widgets - - The WidgetDatabase holds information about widgets like toolTip(), - iconSet(), ... It works Id-based, so all access functions take the - widget id as parameter. To get the id for a widget (classname), use - idFromClassName(). - - All access functions are static. Having multiple widgetdatabases in - one application doesn't make sense anyway and so you don't need more - than an instance of the widgetdatabase. - - For creating widgets, layouts, etc. see WidgetFactory. -*/ - -/*! - Creates widget database. Does nothing. -*/ - -WidgetDatabase::WidgetDatabase() -{ -} - -/*! Sets up the widget database. If the static widgetdatabase already - exists, the functions returns immediately. -*/ - -void WidgetDatabase::setupDataBase( int id ) -{ - was_in_setup = TRUE; -#ifndef UIC - Q_UNUSED( id ) - if ( dbcount ) - return; -#else - if ( dbcount && id != -2 ) - return; - if ( dbcount && !plugins_set_up ) { - setupPlugins(); - return; - } - if ( dbcount && plugins_set_up) - return; -#endif - - wGroups = new TQStrList; - invisibleGroups = new TQStrList; - invisibleGroups->append( "Forms" ); - invisibleGroups->append( "Temp" ); - className2Id = new TQDict( dbdictsize ); - className2Id->setAutoDelete( TRUE ); - - WidgetDatabaseRecord *r = 0; - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_pushbutton.png"; - r->name = "TQPushButton"; - r->group = widgetGroup( "Buttons" ); - r->toolTip = "Push Button"; - r->isCommon = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_toolbutton.png"; - r->name = "TQToolButton"; - r->group = widgetGroup( "Buttons" ); - r->toolTip = "Tool Button"; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_radiobutton.png"; - r->name = "TQRadioButton"; - r->group = widgetGroup( "Buttons" ); - r->toolTip = "Radio Button"; - r->isCommon = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_checkbox.png"; - r->name = "TQCheckBox"; - r->group = widgetGroup( "Buttons" ); - r->toolTip = "Check Box"; - r->isCommon = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_groupbox.png"; - r->name = "TQGroupBox"; - r->group = widgetGroup( "Containers" ); - r->toolTip = "Group Box"; - r->isContainer = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_buttongroup.png"; - r->name = "TQButtonGroup"; - r->group = widgetGroup( "Containers" ); - r->toolTip = "Button Group"; - r->isContainer = TRUE; - r->isCommon = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_frame.png"; - r->name = "TQFrame"; - r->group = widgetGroup( "Containers" ); - r->toolTip = "Frame"; - r->isContainer = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_tabwidget.png"; - r->name = "TQTabWidget"; - r->group = widgetGroup( "Containers" ); - r->toolTip = "Tabwidget"; - r->isContainer = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_widgetstack.png"; - r->name = "TQWidgetStack"; - r->group = widgetGroup( "Containers" ); - r->toolTip = "Widget Stack"; - r->isContainer = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_toolbox.png"; - r->name = "TQToolBox"; - r->group = widgetGroup( "Containers" ); - r->toolTip = "Tool Box"; - r->isContainer = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_listbox.png"; - r->name = "TQListBox"; - r->group = widgetGroup( "Views" ); - r->toolTip = "List Box"; - r->isCommon = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_listview.png"; - r->name = "TQListView"; - r->group = widgetGroup( "Views" ); - r->toolTip = "List View"; - - append( r ); - -#if !defined(TQT_NO_ICONVIEW) || defined(UIC) - r = new WidgetDatabaseRecord; - r->iconSet = "designer_iconview.png"; - r->name = "TQIconView"; - r->group = widgetGroup( "Views" ); - r->toolTip = "Icon View"; - - append( r ); -#endif - -#if !defined(TQT_NO_TABLE) - r = new WidgetDatabaseRecord; - r->iconSet = "designer_table.png"; - r->name = "TQTable"; - r->group = widgetGroup( "Views" ); - r->toolTip = "Table"; - - append( r ); -#endif - -#if !defined(TQT_NO_SQL) - r = new WidgetDatabaseRecord; - r->iconSet = "designer_datatable.png"; - r->includeFile = "qdatatable.h"; - r->name = "TQDataTable"; - r->group = widgetGroup( "Database" ); - r->toolTip = "Data Table"; - - append( r ); -#endif - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_lineedit.png"; - r->name = "TQLineEdit"; - r->group = widgetGroup( "Input" ); - r->toolTip = "Line Edit"; - r->isCommon = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_spinbox.png"; - r->name = "TQSpinBox"; - r->group = widgetGroup( "Input" ); - r->toolTip = "Spin Box"; - r->isCommon = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_dateedit.png"; - r->name = "TQDateEdit"; - r->group = widgetGroup( "Input" ); - r->toolTip = "Date Edit"; - r->includeFile = "qdatetimeedit.h"; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_timeedit.png"; - r->name = "TQTimeEdit"; - r->group = widgetGroup( "Input" ); - r->toolTip = "Time Edit"; - r->includeFile = "qdatetimeedit.h"; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_datetimeedit.png"; - r->name = "TQDateTimeEdit"; - r->group = widgetGroup( "Input" ); - r->toolTip = "Date-Time Edit"; - r->includeFile = "qdatetimeedit.h"; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_multilineedit.png"; - r->name = "TQMultiLineEdit"; - r->group = widgetGroup( "Temp" ); - r->toolTip = "Multi Line Edit"; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_richtextedit.png"; - r->name = "TQTextEdit"; - r->group = widgetGroup( "Input" ); - r->toolTip = "Rich Text Edit"; - r->isCommon = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_combobox.png"; - r->name = "TQComboBox"; - r->group = widgetGroup( "Input" ); - r->toolTip = "Combo Box"; - r->isCommon = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_slider.png"; - r->name = "TQSlider"; - r->group = widgetGroup( "Input" ); - r->toolTip = "Slider"; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_scrollbar.png"; - r->name = "TQScrollBar"; - r->group = widgetGroup( "Input" ); - r->toolTip = "Scrollbar"; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_dial.png"; - r->name = "TQDial"; - r->group = widgetGroup( "Input" ); - r->toolTip = "Dial"; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_label.png"; - r->name = "TQLabel"; - r->group = widgetGroup( "Temp" ); - r->toolTip = "Label"; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_label.png"; - r->name = "TextLabel"; - r->group = widgetGroup( "Display" ); - r->toolTip = "Text Label"; - r->whatsThis = "The Text Label provides a widget to display static text."; - r->isCommon = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_pixlabel.png"; - r->name = "PixmapLabel"; - r->group = widgetGroup( "Display" ); - r->toolTip = "Pixmap Label"; - r->whatsThis = "The Pixmap Label provides a widget to display pixmaps."; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_lcdnumber.png"; - r->name = "TQLCDNumber"; - r->group = widgetGroup( "Display" ); - r->toolTip = "LCD Number"; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_line.png"; - r->name = "Line"; - r->group = widgetGroup( "Display" ); - r->toolTip = "Line"; - r->includeFile = "qframe.h"; - r->whatsThis = "The Line widget provides horizontal and vertical lines."; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_progress.png"; - r->name = "TQProgressBar"; - r->group = widgetGroup( "Display" ); - r->toolTip = "Progress Bar"; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_textview.png"; - r->name = "TQTextView"; - r->group = widgetGroup( "Temp" ); - r->toolTip = "Text View"; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_textbrowser.png"; - r->name = "TQTextBrowser"; - r->group = widgetGroup( "Display" ); - r->toolTip = "Text Browser"; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_spacer.png"; - r->name = "Spacer"; - r->group = widgetGroup( "Temp" ); - r->toolTip = "Spacer"; - r->whatsThis = "The Spacer provides horizontal and vertical spacing to be able to manipulate the behaviour of layouts."; - - append( r ); - - r = new WidgetDatabaseRecord; - r->name = "TQWidget"; - r->isForm = TRUE; - r->group = widgetGroup( "Forms" ); - - append( r ); - - r = new WidgetDatabaseRecord; - r->name = "TQDialog"; - r->group = widgetGroup( "Forms" ); - r->isForm = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->name = "TQWizard"; - r->group = widgetGroup( "Forms" ); - r->isContainer = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->name = "TQDesignerWizard"; - r->group = widgetGroup( "Forms" ); - r->isContainer = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->name = "TQLayoutWidget"; - r->group = widgetGroup( "Temp" ); - r->includeFile = ""; - r->isContainer = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->name = "TQSplitter"; - r->group = widgetGroup( "Temp" ); - r->includeFile = "qsplitter.h"; - r->isContainer = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_tabwidget.png"; - r->name = "TQDesignerTabWidget"; - r->group = widgetGroup( "Temp" ); - r->isContainer = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_tabwidget.png"; - r->name = "TQDesignerWidget"; - r->group = widgetGroup( "Temp" ); - r->isContainer = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = "designer_tabwidget.png"; - r->name = "TQDesignerDialog"; - r->group = widgetGroup( "Temp" ); - r->isContainer = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = ""; - r->name = "TQMainWindow"; - r->includeFile = "qmainwindow.h"; - r->group = widgetGroup( "Temp" ); - r->isContainer = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = ""; - r->name = "TQDesignerAction"; - r->includeFile = "qaction.h"; - r->group = widgetGroup( "Temp" ); - r->isContainer = FALSE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = ""; - r->name = "TQDesignerActionGroup"; - r->includeFile = "qaction.h"; - r->group = widgetGroup( "Temp" ); - r->isContainer = FALSE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = ""; - r->name = "TQScrollView"; - r->includeFile = "qscrollview.h"; - r->group = widgetGroup( "Temp" ); - r->isContainer = TRUE; - - append( r ); - -#ifndef TQT_NO_SQL - r = new WidgetDatabaseRecord; - r->iconSet = ""; - r->name = "TQDataBrowser"; - r->includeFile = "qdatabrowser.h"; - r->group = widgetGroup( "Database" ); - r->toolTip = "Data Browser"; - r->iconSet = "designer_databrowser.png"; - r->isContainer = TRUE; - - append( r ); - - r = new WidgetDatabaseRecord; - r->iconSet = ""; - r->name = "TQDataView"; - r->includeFile = "qdataview.h"; - r->group = widgetGroup( "Database" ); - r->toolTip = "Data View"; - r->iconSet = "designer_dataview.png"; - r->isContainer = TRUE; - - append( r ); -#endif - -#ifndef UIC - setupPlugins(); -#endif -} - -void WidgetDatabase::setupPlugins() -{ - if ( plugins_set_up ) - return; - plugins_set_up = TRUE; - TQStringList widgets = widgetManager()->featureList(); - for ( TQStringList::Iterator it = widgets.begin(); it != widgets.end(); ++it ) { - if ( hasWidget( *it ) ) - continue; - WidgetDatabaseRecord *r = new WidgetDatabaseRecord; - WidgetInterface *iface = 0; - widgetManager()->queryInterface( *it, &iface ); - if ( !iface ) - continue; - -#ifndef UIC - TQIconSet icon = iface->iconSet( *it ); - if ( !icon.pixmap().isNull() ) - r->icon = new TQIconSet( icon ); -#endif - TQString grp = iface->group( *it ); - if ( grp.isEmpty() ) - grp = "3rd party widgets"; - r->group = widgetGroup( grp ); - r->toolTip = iface->toolTip( *it ); - r->whatsThis = iface->whatsThis( *it ); - r->includeFile = iface->includeFile( *it ); - r->isContainer = iface->isContainer( *it ); - r->name = *it; - r->isPlugin = TRUE; - append( r ); - iface->release(); - } -} - -/*! - Returns the number of elements in the widget database. -*/ - -int WidgetDatabase::count() -{ - setupDataBase( -1 ); - return dbcount; -} - -/*! - Returns the id at which the ids of custom widgets start. -*/ - -int WidgetDatabase::startCustom() -{ - setupDataBase( -1 ); - return dbcustom; -} - -/*! - Returns the iconset which represents the class registered as \a id. -*/ - -TQIconSet WidgetDatabase::iconSet( int id ) -{ - setupDataBase( id ); - WidgetDatabaseRecord *r = at( id ); - if ( !r ) - return TQIconSet(); -#if !defined(UIC) && !defined(RESOURCE) - if ( !r->icon ) { - if ( r->iconSet.isEmpty() ) - return TQIconSet(); - TQPixmap pix = TQPixmap::fromMimeSource( r->iconSet ); - if ( pix.isNull() ) - pix = TQPixmap( r->iconSet ); - r->icon = new TQIconSet( pix ); - } - return *r->icon; -#else - return TQIconSet(); -#endif -} - -/*! - Returns the classname of the widget which is registered as \a id. -*/ - -TQString WidgetDatabase::className( int id ) -{ - setupDataBase( id ); - WidgetDatabaseRecord *r = at( id ); - if ( !r ) - return TQString::null; - return r->name; -} - -/*! - Returns the group the widget registered as \a id belongs to. -*/ - -TQString WidgetDatabase::group( int id ) -{ - setupDataBase( id ); - WidgetDatabaseRecord *r = at( id ); - if ( !r ) - return TQString::null; - return r->group; -} - -/*! - Returns the tooltip text of the widget which is registered as \a id. -*/ - -TQString WidgetDatabase::toolTip( int id ) -{ - setupDataBase( id ); - WidgetDatabaseRecord *r = at( id ); - if ( !r ) - return TQString::null; - return r->toolTip; -} - -/*! - Returns the what's this? text of the widget which is registered as \a id. -*/ - -TQString WidgetDatabase::whatsThis( int id ) -{ - setupDataBase( id ); - WidgetDatabaseRecord *r = at( id ); - if ( !r ) - return TQString::null; - return r->whatsThis; -} - -/*! - Returns the include file if the widget which is registered as \a id. -*/ - -TQString WidgetDatabase::includeFile( int id ) -{ - setupDataBase( id ); - WidgetDatabaseRecord *r = at( id ); - if ( !r ) - return TQString::null; - if ( r->includeFile.isNull() ) - return r->name.lower() + ".h"; - return r->includeFile; -} - -/*! Returns whether the widget registered as \a id is a form. -*/ -bool WidgetDatabase::isForm( int id ) -{ - setupDataBase( id ); - WidgetDatabaseRecord *r = at( id ); - if ( !r ) - return FALSE; - return r->isForm; -} - -/*! Returns whether the widget registered as \a id can have children. -*/ - -bool WidgetDatabase::isContainer( int id ) -{ - setupDataBase( id ); - WidgetDatabaseRecord *r = at( id ); - if ( !r ) - return FALSE; - return r->isContainer || r->isForm; -} - -bool WidgetDatabase::isCommon( int id ) -{ - setupDataBase( id ); - WidgetDatabaseRecord *r = at( id ); - if ( !r ) - return FALSE; - return r->isCommon; -} - -TQString WidgetDatabase::createWidgetName( int id ) -{ - setupDataBase( id ); - TQString n = className( id ); - if ( n == "TQLayoutWidget" ) - n = "Layout"; - if ( n[ 0 ] == 'Q' && n[ 1 ].lower() != n[ 1 ] ) - n = n.mid( 1 ); - int colonColon = n.findRev( "::" ); - if ( colonColon != -1 ) - n = n.mid( colonColon + 2 ); - - WidgetDatabaseRecord *r = at( id ); - if ( !r ) - return n; - n += TQString::number( ++r->nameCounter ); - n[0] = n[0].lower(); - return n; -} - -/*! Returns the id for \a name or -1 if \a name is unknown. - */ -int WidgetDatabase::idFromClassName( const TQString &name ) -{ - setupDataBase( -1 ); - if ( name.isEmpty() ) - return 0; - int *i = className2Id->find( name ); - if ( i ) - return *i; - if ( name == "FormWindow" ) - return idFromClassName( "TQLayoutWidget" ); -#ifdef UIC - setupDataBase( -2 ); - i = className2Id->find( name ); - if ( i ) - return *i; -#endif - return -1; -} - -bool WidgetDatabase::hasWidget( const TQString &name ) -{ - return className2Id->find( name ) != 0; -} - -WidgetDatabaseRecord *WidgetDatabase::at( int index ) -{ - if ( index < 0 ) - return 0; - if ( index >= dbcustom && index < dbcustomcount ) - return db[ index ]; - if ( index < dbcount ) - return db[ index ]; - return 0; -} - -void WidgetDatabase::insert( int index, WidgetDatabaseRecord *r ) -{ - if ( index < 0 || index >= dbsize ) - return; - db[ index ] = r; - className2Id->insert( r->name, new int( index ) ); - if ( index < dbcustom ) - dbcount = TQMAX( dbcount, index ); -} - -void WidgetDatabase::append( WidgetDatabaseRecord *r ) -{ - if ( !was_in_setup ) - setupDataBase( -1 ); - insert( dbcount++, r ); -} - -TQString WidgetDatabase::widgetGroup( const TQString &g ) -{ - if ( wGroups->find( g ) == -1 ) - wGroups->append( g ); - return g; -} - -bool WidgetDatabase::isGroupEmpty( const TQString &grp ) -{ - WidgetDatabaseRecord *r = 0; - for ( int i = 0; i < dbcount; ++i ) { - if ( !( r = db[ i ] ) ) - continue; - if ( r->group == grp ) - return FALSE; - } - return TRUE; -} - -TQString WidgetDatabase::widgetGroup( int i ) -{ - setupDataBase( -1 ); - if ( i >= 0 && i < (int)wGroups->count() ) - return wGroups->at( i ); - return TQString::null; -} - -int WidgetDatabase::numWidgetGroups() -{ - setupDataBase( -1 ); - return wGroups->count(); -} - -bool WidgetDatabase::isGroupVisible( const TQString &g ) -{ - setupDataBase( -1 ); - return invisibleGroups->find( g ) == -1; -} - -int WidgetDatabase::addCustomWidget( WidgetDatabaseRecord *r ) -{ - insert( dbcustomcount++, r ); - return dbcustomcount - 1; -} - -void WidgetDatabase::customWidgetClassNameChanged( const TQString &oldName, - const TQString &newName ) -{ - int id = idFromClassName( oldName ); - if ( id == -1 ) - return; - WidgetDatabaseRecord *r = db[ id ]; - r->name = newName; - className2Id->remove( oldName ); - className2Id->insert( newName, new int( id ) ); -} - -bool WidgetDatabase::isCustomWidget( int id ) -{ - if ( id >= dbcustom && id < dbcustomcount ) - return TRUE; - return FALSE; -} - -bool WidgetDatabase::isCustomPluginWidget( int id ) -{ - setupDataBase( id ); - WidgetDatabaseRecord *r = at( id ); - if ( !r ) - return FALSE; - return r->isPlugin; -} - -bool WidgetDatabase::isWhatsThisLoaded() -{ - return whatsThisLoaded; -} - -void WidgetDatabase::loadWhatsThis( const TQString &docPath ) -{ - TQString whatsthisFile = docPath + "/whatsthis"; - TQFile f( whatsthisFile ); - if ( !f.open( IO_ReadOnly ) ) - return; - TQTextStream ts( &f ); - while ( !ts.atEnd() ) { - TQString s = ts.readLine(); - TQStringList l = TQStringList::split( " | ", s ); - int id = idFromClassName( l[ 1 ] ); - WidgetDatabaseRecord *r = at( id ); - if ( r ) - r->whatsThis = l[ 0 ]; - } - whatsThisLoaded = TRUE; -} - - -// ### TQt 3.1: make these publically accessible via TQWidgetDatabase API -#if defined(UIC) -bool dbnounload = FALSE; -TQStringList *dbpaths = 0; -#else -extern TQString *qwf_plugin_dir; -#endif - - -TQPluginManager *widgetManager() -{ - if ( !widgetPluginManager ) { - TQString pluginDir = "/designer"; -#if !defined(UIC) - if ( qwf_plugin_dir ) - pluginDir = *qwf_plugin_dir; -#endif - widgetPluginManager = new TQPluginManager( IID_Widget, TQApplication::libraryPaths(), pluginDir ); - cleanup_manager.add( &widgetPluginManager ); -#if defined(UIC) - if ( dbnounload ) - widgetPluginManager->setAutoUnload( FALSE ); - if ( dbpaths ) { - TQStringList::ConstIterator it = dbpaths->begin(); - for ( ; it != dbpaths->end(); ++it ) - widgetPluginManager->addLibraryPath( *it ); - } -#endif - } - return widgetPluginManager; -} diff --git a/pyuic3/widgetdatabase.h b/pyuic3/widgetdatabase.h deleted file mode 100644 index 18b63af..0000000 --- a/pyuic3/widgetdatabase.h +++ /dev/null @@ -1,96 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** This file is part of TQt Designer. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition -** licenses may use this file in accordance with the TQt Commercial License -** Agreement provided with the Software. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about TQt Commercial License Agreements. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#ifndef WIDGETDATABASE_H -#define WIDGETDATABASE_H - -#include -#include -#include "widgetinterface.h" // up here for GCC 2.7.* compatibility -#include - - -extern TQPluginManager *widgetManager(); - -struct WidgetDatabaseRecord -{ - WidgetDatabaseRecord(); - ~WidgetDatabaseRecord(); - TQString iconSet, name, group, toolTip, whatsThis, includeFile; - uint isContainer : 1; - uint isForm : 1; - uint isCommon : 1; - uint isPlugin : 1; - TQIconSet *icon; - int nameCounter; -}; - -class WidgetDatabase : public TQt -{ -public: - WidgetDatabase(); - static void setupDataBase( int id ); - static void setupPlugins(); - - static int count(); - static int startCustom(); - - static TQIconSet iconSet( int id ); - static TQString className( int id ); - static TQString group( int id ); - static TQString toolTip( int id ); - static TQString whatsThis( int id ); - static TQString includeFile( int id ); - static bool isForm( int id ); - static bool isContainer( int id ); - static bool isCommon( int id ); - - static int idFromClassName( const TQString &name ); - static TQString createWidgetName( int id ); - - static WidgetDatabaseRecord *at( int index ); - static void insert( int index, WidgetDatabaseRecord *r ); - static void append( WidgetDatabaseRecord *r ); - - static TQString widgetGroup( const TQString &g ); - static TQString widgetGroup( int i ); - static int numWidgetGroups(); - static bool isGroupVisible( const TQString &g ); - static bool isGroupEmpty( const TQString &grp ); - - static int addCustomWidget( WidgetDatabaseRecord *r ); - static bool isCustomWidget( int id ); - static bool isCustomPluginWidget( int id ); - - static bool isWhatsThisLoaded(); - static void loadWhatsThis( const TQString &docPath ); - - static bool hasWidget( const TQString &name ); - static void customWidgetClassNameChanged( const TQString &oldName, const TQString &newName ); - -}; - -#endif diff --git a/pyuic3/widgetinterface.h b/pyuic3/widgetinterface.h deleted file mode 100644 index 50f8e6d..0000000 --- a/pyuic3/widgetinterface.h +++ /dev/null @@ -1,29 +0,0 @@ - /********************************************************************** -** Copyright (C) 2000-2001 Trolltech AS. All rights reserved. -** -** This file is part of TQt Designer. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#ifndef WIDGETINTERFACE_H -#define WIDGETINTERFACE_H - -#include - -#define WidgetInterface TQWidgetFactoryInterface -#define IID_Widget IID_QWidgetFactory - -#endif diff --git a/sip/pyqt-gpl.sip b/sip/pyqt-gpl.sip deleted file mode 100644 index bec8f9e..0000000 --- a/sip/pyqt-gpl.sip +++ /dev/null @@ -1 +0,0 @@ -%License /Type="gpl"/ diff --git a/sip/pytqt-gpl.sip b/sip/pytqt-gpl.sip new file mode 100644 index 0000000..bec8f9e --- /dev/null +++ b/sip/pytqt-gpl.sip @@ -0,0 +1 @@ +%License /Type="gpl"/ diff --git a/sip/qt/copying.sip b/sip/qt/copying.sip deleted file mode 100644 index 6da646e..0000000 --- a/sip/qt/copying.sip +++ /dev/null @@ -1,51 +0,0 @@ -// This is the SIP file defining the PyTQt license. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 - -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 pyqt-internal.sip -%OptionalInclude pyqt-gpl.sip -%OptionalInclude pyqt-commercial.sip -%OptionalInclude pyqt-edu.sip -%OptionalInclude pyqt-eval.sip -%OptionalInclude pyqt-nc.sip -%OptionalInclude pyqt-tkc.sip diff --git a/sip/qt/qaccel.sip b/sip/qt/qaccel.sip deleted file mode 100644 index a10a9b9..0000000 --- a/sip/qt/qaccel.sip +++ /dev/null @@ -1,80 +0,0 @@ -// This is the SIP interface definition for TQAccel. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQAccel - -TQAccel is fully implemented. - - -%End - - -class TQAccel : TQObject -{ -%TypeHeaderCode -#include -%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/qt/qaction.sip b/sip/qt/qaction.sip deleted file mode 100644 index f74ca72..0000000 --- a/sip/qt/qaction.sip +++ /dev/null @@ -1,148 +0,0 @@ -// This is the SIP interface definition for TQAction and TQActionGroup. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQAction (TQt v2.2+) - -TQAction is fully implemented. - - - -TQActionGroup (TQt v2.2+) - -TQActionGroup is fully implemented. - - -%End - - -%If (TQt_ACTION) - -class TQAction : TQObject -{ -%TypeHeaderCode -#include -%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 -%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/qt/qapplication.sip b/sip/qt/qapplication.sip deleted file mode 100644 index 28e0d67..0000000 --- a/sip/qt/qapplication.sip +++ /dev/null @@ -1,467 +0,0 @@ -// This is the SIP interface definition for TQApplication. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQApplication - - TQApplication - int &argc - char **argv - - -This takes one parameter which is a list of argument strings. Arguments -used by TQt are removed from the list. - - - - TQApplication - int &argc - char **argv - bool GUIenabled - - -This takes two parameters, the first of which is a list of argument strings. -Arguments used by TQt are removed from the list. - - - - TQApplication - int &argc - char **argv - Type type - - -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+) - - - - int exec - - - -This has been renamed to exec_loop in Python. - - -%End - -%ModuleHeaderCode -#include -%End - -TQApplication *tqApp; - - -class TQApplication : TQObject -{ -%TypeHeaderCode -#include -#include -%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 - - -// 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 qInstallMsgHandler(SIP_PYCALLABLE /AllowNone/); -%MethodCode - void (*old)(TQtMsgType, const char *); - - // Treat None as the default handler. - old = qInstallMsgHandler((a0 != Py_None) ? pyqtMsgHandler : 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 == pyqtMsgHandler) ? pyqtPyMsgHandler : Py_None; - Py_INCREF(sipRes); - - // Save the new Python handler. - Py_XDECREF(pyqtPyMsgHandler); - pyqtPyMsgHandler = a0; - Py_INCREF(pyqtPyMsgHandler); -%End - -%ModuleCode -// The user supplied Python handler. -static PyObject *pyqtPyMsgHandler = 0; - -// The C++ wrapper around the Python handler. -static void pyqtMsgHandler(TQtMsgType type, const char *msg) -{ - PyObject *res; - - SIP_BLOCK_THREADS - - res = sipCallMethod(0, pyqtPyMsgHandler, "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/qt/qassistantclient.sip b/sip/qt/qassistantclient.sip deleted file mode 100644 index 3815962..0000000 --- a/sip/qt/qassistantclient.sip +++ /dev/null @@ -1,59 +0,0 @@ -// This is the SIP interface definition for TQAssistantClient. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQAssistantClient (TQt v3.1+) - -TQAssistantClient is fully implemented. - - -%End - - -%If (TQt_ASSISTANTCLIENT) - -class TQAssistantClient : TQObject -{ -%TypeHeaderCode -#include -%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/qt/qbitmap.sip b/sip/qt/qbitmap.sip deleted file mode 100644 index 3b499ba..0000000 --- a/sip/qt/qbitmap.sip +++ /dev/null @@ -1,48 +0,0 @@ -// This is the SIP interface definition for TQBitmap. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQBitmap - -TQBitmap is fully implemented. - - -%End - - -class TQBitmap : TQPixmap -{ -%TypeHeaderCode -#include -%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/qt/qbrush.sip b/sip/qt/qbrush.sip deleted file mode 100644 index 44d8f91..0000000 --- a/sip/qt/qbrush.sip +++ /dev/null @@ -1,55 +0,0 @@ -// This is the SIP interface definition for TQBrush. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQBrush - -TQBrush is fully implemented, including the Python -== and != operators. - - -%End - - -class TQBrush : TQt -{ -%TypeHeaderCode -#include -%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/qt/qbutton.sip b/sip/qt/qbutton.sip deleted file mode 100644 index 47c475f..0000000 --- a/sip/qt/qbutton.sip +++ /dev/null @@ -1,115 +0,0 @@ -// This is the SIP interface definition for TQButton. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQButton - -TQButton is fully implemented. - - -%End - - -class TQButton : TQWidget -{ -%TypeHeaderCode -#include -%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/qt/qbuttongroup.sip b/sip/qt/qbuttongroup.sip deleted file mode 100644 index 74fae53..0000000 --- a/sip/qt/qbuttongroup.sip +++ /dev/null @@ -1,82 +0,0 @@ -// This is the SIP interface definition for TQButtonGroup. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQButtonGroup - -TQButtonGroup is fully implemented. - - -%End - - -class TQButtonGroup : TQGroupBox -{ -%TypeHeaderCode -#include -%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/qt/qbytearray.sip b/sip/qt/qbytearray.sip deleted file mode 100644 index f25ecd6..0000000 --- a/sip/qt/qbytearray.sip +++ /dev/null @@ -1,244 +0,0 @@ -// This is the SIP interface definition for TQByteArray. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQByteArray - -A Python string can be used whenever a TQByteArray can be -used. A TQByteArray can be converted to a Python string -using the Python str() function. - - - - TQByteArray &assign - const char *data - uint size - - -Not implemented. - - - - char &at - uint i - - -Not yet implemented. - - - - int contains - const char &d - - -Not yet implemented. - - - - bool fill - const char &d - int size = -1 - - -Not yet implemented. - - - - int find - const char &d - uint i = 0 - - -Not yet implemented. - - - - void resetRawData - const char *data - uintsize - - -Not implemented. - - - - TQByteArray &setRawData - const char *data - uintsize - - -Not implemented. - - -%End - - -class TQByteArray -{ -%TypeHeaderCode -#include -%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(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/qt/qcdestyle.sip b/sip/qt/qcdestyle.sip deleted file mode 100644 index b11af4c..0000000 --- a/sip/qt/qcdestyle.sip +++ /dev/null @@ -1,55 +0,0 @@ -// This is the SIP interface definition for TQCDEStyle. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQCDEStyle (TQt v2+) - -TQCDEStyle is fully implemented. - - -%End - - -%If (TQt_STYLE_CDE) - -class TQCDEStyle : TQMotifStyle -{ -%TypeHeaderCode -#include -%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/qt/qcheckbox.sip b/sip/qt/qcheckbox.sip deleted file mode 100644 index 237a4b8..0000000 --- a/sip/qt/qcheckbox.sip +++ /dev/null @@ -1,63 +0,0 @@ -// This is the SIP interface definition for TQCheckBox. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQCheckBox - -TQCheckBox is fully implemented. - - -%End - - -class TQCheckBox : TQButton -{ -%TypeHeaderCode -#include -%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/qt/qclipboard.sip b/sip/qt/qclipboard.sip deleted file mode 100644 index 73057fa..0000000 --- a/sip/qt/qclipboard.sip +++ /dev/null @@ -1,132 +0,0 @@ -// This is the SIP interface definition for TQClipboard. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQClipboard - - void *data const - const char *format - - -Not yet implemented (TQt v1.x). - - - - void setData - const char *format - void * - - -Not yet implemented (TQt v1.x). - - -%End - - -%If (TQt_CLIPBOARD) - -class TQClipboard : TQObject -{ -%TypeHeaderCode -#include -%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/qt/qcolor.sip b/sip/qt/qcolor.sip deleted file mode 100644 index 8fb53d2..0000000 --- a/sip/qt/qcolor.sip +++ /dev/null @@ -1,156 +0,0 @@ -// This is the SIP interface definition for TQColor. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQColor - -The Python == and != operators are -supported. - - - - void getHsv - int *h - int *s - int *v - - -This takes no parameters and returns the h, -s and v values as a tuple. - - - - void getRgb - int *r - int *g - int *b - - -This takes no parameters and returns the r, -g and b values as a tuple. - - - - void hsv - int *h - int *s - int *v - - -This takes no parameters and returns the h, -s and v values as a tuple. - - - - void rgb - int *r - int *g - int *b - - -This takes no parameters and returns the r, -g and b values as a tuple. - - -%End - - -%ModuleHeaderCode -#include -%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 -%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/qt/qcolordialog.sip b/sip/qt/qcolordialog.sip deleted file mode 100644 index ff77210..0000000 --- a/sip/qt/qcolordialog.sip +++ /dev/null @@ -1,64 +0,0 @@ -// This is the SIP interface definition for TQColorDialog. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQColorDialog (TQt v2+) - - static TQRgb getRgba - TQRgb initial - bool *ok - TQWidget *parent = 0 - const char *name = 0 - - -This takes the initial, parent and -name parameters and returns a tuple containing the -TQRgb result and the ok value. - - -%End - - -%If (TQt_COLORDIALOG) - -class TQColorDialog : TQDialog -{ -%TypeHeaderCode -#include -%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/qt/qcolorgroup.sip b/sip/qt/qcolorgroup.sip deleted file mode 100644 index 8ab220b..0000000 --- a/sip/qt/qcolorgroup.sip +++ /dev/null @@ -1,89 +0,0 @@ -// This is the SIP interface definition for TQColorGroup. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQColorGroup - -TQColorGroup is fully implemented. - - -%End - - -class TQColorGroup -{ -%TypeHeaderCode -#include -%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/qt/qcombobox.sip b/sip/qt/qcombobox.sip deleted file mode 100644 index cc878ed..0000000 --- a/sip/qt/qcombobox.sip +++ /dev/null @@ -1,148 +0,0 @@ -// This is the SIP interface definition for TQComboBox. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQComboBox - -TQComboBox is fully implemented. - - -%End - - -class TQComboBox : TQWidget -{ -%TypeHeaderCode -#include -%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/qt/qcommonstyle.sip b/sip/qt/qcommonstyle.sip deleted file mode 100644 index 9eb4463..0000000 --- a/sip/qt/qcommonstyle.sip +++ /dev/null @@ -1,105 +0,0 @@ -// This is the SIP interface definition for TQCommonStyle. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQCommonStyle (TQt v2+) - - virtual void getButtonShift - int &x - int &y - - -This takes no parameters and returns a tuple of the x and -y values. (TQt v2) - - - - virtual void tabbarMetrics - const TQTabBar *t - int &hframe - int &vframe - int &overlap - - -This takes only the t parameter and returns a tuple of the -hframe, vframe and -overlap values. (TQt v2) - - -%End - - -class TQCommonStyle : TQStyle -{ -%TypeHeaderCode -#include -%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/qt/qcstring.sip b/sip/qt/qcstring.sip deleted file mode 100644 index 19387ae..0000000 --- a/sip/qt/qcstring.sip +++ /dev/null @@ -1,217 +0,0 @@ -// This is the SIP interface definition for TQCString. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQCString (TQt v2+) - -A Python string can be used whenever a TQCString can be used. -A TQCString can be converted to a Python string using the -Python str() function. - - - - TQCString &sprintf - const char *format - ... - - -Not implemented. - - - - short toShort - bool *ok = 0 - - -This returns a tuple of the short result and the -ok value. - - - - ushort toUShort - bool *ok = 0 - - -This returns a tuple of the ushort result and the -ok value. - - - - int toInt - bool *ok = 0 - - -This returns a tuple of the int result and the -ok value. - - - - uint toUInt - bool *ok = 0 - - -This returns a tuple of the uint result and the -ok value. - - - - long toLong - bool *ok = 0 - - -This returns a tuple of the long result and the -ok value. - - - - ulong toULong - bool *ok = 0 - - -This returns a tuple of the ulong result and the -ok value. - - - - float toFloat - bool *ok = 0 - - -This returns a tuple of the float result and the -ok value. - - - - double toDouble - bool *ok = 0 - - -This returns a tuple of the double result and the -ok value. - - -%End - - -class TQCString : TQByteArray -{ -%TypeHeaderCode -#include -%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(sipConvertToInstance(sipPy,sipClass_TQCString,sipTransferObj,SIP_NO_CONVERTORS,0,sipIsErr)); - - return 0; -%End -}; diff --git a/sip/qt/qcursor.sip b/sip/qt/qcursor.sip deleted file mode 100644 index 3a8d9ca..0000000 --- a/sip/qt/qcursor.sip +++ /dev/null @@ -1,69 +0,0 @@ -// This is the SIP interface definition for TQCursor. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQCursor - -TQCursor is fully implemented. - - -%End - - -%ModuleHeaderCode -#include -%End - - -class TQCursor : TQt -{ -%TypeHeaderCode -#include -%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/qt/qdatastream.sip b/sip/qt/qdatastream.sip deleted file mode 100644 index 8a1479b..0000000 --- a/sip/qt/qdatastream.sip +++ /dev/null @@ -1,218 +0,0 @@ -// This is the SIP interface definition for TQDataStream. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQDataStream - - TQDataStream &readBytes - const char *&s - uint &l - - -This takes no parameters. The TQDataStream result and the -data read are returned as a tuple. - - - - TQDataStream &readRawBytes - const char *s - uint l - - -This takes only the l parameter. The -TQDataStream result and the data read are returned as a -tuple. - - - - TQDataStream &writeBytes - const char *s - uint len - - -len is derived from s and not passed as a -parameter. - - - - TQDataStream &writeRawBytes - const char *s - uint len - - -len is derived from s and not passed as a -parameter. - - -%End - - -class TQDataStream -{ -%TypeHeaderCode -#include -%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/qt/qdatetime.sip b/sip/qt/qdatetime.sip deleted file mode 100644 index 3df731d..0000000 --- a/sip/qt/qdatetime.sip +++ /dev/null @@ -1,226 +0,0 @@ -// This is the SIP interface definition for TQDate, TQDateTime and TQTime. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQDate - -The Python -==, !=, -<, <=, ->, >= -and __nonzero__ -operators are supported. - - - - int weekNumber - int *yearNum = 0 - - -This takes no parameters and returns the week number and the year number as a -tuple. (TQt v3.1+) - - - -TQDateTime - -TQDateTime is fully implemented, including the Python -==, !=, -<, <=, ->, >= -and __nonzero__ -operators. - - - -TQTime - -TQTime is fully implemented, including the Python -==, !=, -<, <=, ->, >= -and __nonzero__ -operators. - - -%End - - -class TQDate -{ -%TypeHeaderCode -#include -%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 -%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 -%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/qt/qdatetimeedit.sip b/sip/qt/qdatetimeedit.sip deleted file mode 100644 index c32fcef..0000000 --- a/sip/qt/qdatetimeedit.sip +++ /dev/null @@ -1,220 +0,0 @@ -// This is the SIP interface definition for TQDateEdit, TQDateTimeEdit and -// TQTimeEdit. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQDateEdit (TQt v3+) - -TQDateEdit is fully implemented. - - - -TQTimeEdit (TQt v3+) - -TQTimeEdit is fully implemented. - - - -TQDateTimeEdit (TQt v3+) - -TQDateTimeEdit is fully implemented. - - -%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 -%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 -%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 -%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/qt/qdesktopwidget.sip b/sip/qt/qdesktopwidget.sip deleted file mode 100644 index ff8a3fa..0000000 --- a/sip/qt/qdesktopwidget.sip +++ /dev/null @@ -1,70 +0,0 @@ -// This is the SIP interface definition for TQDesktopWidget. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQDesktopWidget (TQt v3+) - -TQDesktopWidget is fully implemented. - - -%End - - -class TQDesktopWidget : TQWidget -{ -%TypeHeaderCode -#include -%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/qt/qdial.sip b/sip/qt/qdial.sip deleted file mode 100644 index d0f8913..0000000 --- a/sip/qt/qdial.sip +++ /dev/null @@ -1,105 +0,0 @@ -// This is the SIP interface definition for TQDial. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQDial (TQt v2.2+) - -TQDial is fully implemented. - - -%End - - -%If (TQt_DIAL) - -class TQDial : TQWidget, TQRangeControl -{ -%TypeHeaderCode -#include -%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/qt/qdialog.sip b/sip/qt/qdialog.sip deleted file mode 100644 index aa26196..0000000 --- a/sip/qt/qdialog.sip +++ /dev/null @@ -1,119 +0,0 @@ -// This is the SIP interface definition for TQDialog. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQDialog - - int exec - - - -This has been renamed to exec_loop in Python. - - -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 -TQObject.deleteLater() or other techniques. - - -%End - - -class TQDialog : TQWidget -{ -%TypeHeaderCode -#include -%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/qt/qdir.sip b/sip/qt/qdir.sip deleted file mode 100644 index 1d4c8db..0000000 --- a/sip/qt/qdir.sip +++ /dev/null @@ -1,292 +0,0 @@ -// This is the SIP interface definition for TQDir and TQFileInfoList. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQDir - -TQDir is fully implemented, including the Python -len, [] (for reading slices and -individual elements), ==, != and -in operators - - - -TQFileInfoList - -This class isn't implemented. Whenever a TQFileInfoList is -the return type of a function or the type of an argument, a Python list of -TQFileInfo instances is used instead. - - -%End - - -%MappedType TQFileInfoList -{ -%TypeHeaderCode -#include -%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(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 -%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/qt/qdockarea.sip b/sip/qt/qdockarea.sip deleted file mode 100644 index 7c01b85..0000000 --- a/sip/qt/qdockarea.sip +++ /dev/null @@ -1,84 +0,0 @@ -// This is the SIP interface definition for TQDockArea. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQDockArea (TQt v3+) - - bool hasDockWindow const - TQDockWindow *w - int *index = 0 - - -This takes the w parameter and returns the index of the -TQDockWIndow or -1 if the TQDockArea does not contain the TQDockWindow. - - -%End - - -class TQDockArea : TQWidget -{ -%TypeHeaderCode -#include -%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 dockWindowList() const; - - bool isDockWindowAccepted(TQDockWindow *); - void setAcceptDockWindow(TQDockWindow *,bool); - -public slots: - void lineUp(bool); - -private: - TQDockArea(const TQDockArea &); -}; diff --git a/sip/qt/qdockwindow.sip b/sip/qt/qdockwindow.sip deleted file mode 100644 index 1f078aa..0000000 --- a/sip/qt/qdockwindow.sip +++ /dev/null @@ -1,125 +0,0 @@ -// This is the SIP interface definition for TQDockWindow. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQDockWindow (TQt v3+) - -TQDockWindow is fully implemented. - - -%End - - -class TQDockWindow : TQFrame -{ -%TypeHeaderCode -#include -%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/qt/qdragobject.sip b/sip/qt/qdragobject.sip deleted file mode 100644 index da9e266..0000000 --- a/sip/qt/qdragobject.sip +++ /dev/null @@ -1,231 +0,0 @@ -// This is the SIP interface definition for TQDragObject, TQImageDrag, -// TQStoredDrag, TQTextDrag, TQUriDrag, TQUrlDrag, TQColorDrag. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQColorDrag (TQt v2.1+) - -TQColorDrag is fully implemented. - - - -TQDragObject - -TQDragObject is fully implemented. - - - -TQImageDrag - -TQImageDrag is fully implemented. - - - -TQStoredDrag - -TQStoredDrag is fully implemented. - - - -TQTextDrag - -TQTextDrag is fully implemented. - - - -TQUriDrag (TQt v2+) - -TQUriDrag is fully implemented. - - - -TQUrlDrag (TQt v1.x) - -TQUrlDrag is fully implemented. - - -%End - - -class TQDragObject : TQObject, TQMimeSource -{ -%TypeHeaderCode -#include -%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 -%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 -%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 -%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 -%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 -%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/qt/qdrawutil.sip b/sip/qt/qdrawutil.sip deleted file mode 100644 index 34e3033..0000000 --- a/sip/qt/qdrawutil.sip +++ /dev/null @@ -1,56 +0,0 @@ -// This is the SIP interface definition for the TQt drawing utilities. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -%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/qt/qdropsite.sip b/sip/qt/qdropsite.sip deleted file mode 100644 index dd216a9..0000000 --- a/sip/qt/qdropsite.sip +++ /dev/null @@ -1,44 +0,0 @@ -// This is the SIP interface definition for TQDropSite. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQDropSite - -TQDropSite is fully implemented. - - -%End - - -%If (TQt_DRAGANDDROP) - -class TQDropSite -{ -%TypeHeaderCode -#include -%End - -public: - TQDropSite(TQWidget *); -}; - -%End diff --git a/sip/qt/qerrormessage.sip b/sip/qt/qerrormessage.sip deleted file mode 100644 index b6eb433..0000000 --- a/sip/qt/qerrormessage.sip +++ /dev/null @@ -1,51 +0,0 @@ -// This is the SIP interface definition for TQErrorMessage. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQErrorMessage (TQt v3+) - -TQErrorMessage is fully implemented. - - -%End - - -class TQErrorMessage : TQDialog -{ -%TypeHeaderCode -#include -%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/qt/qevent.sip b/sip/qt/qevent.sip deleted file mode 100644 index 7fa9592..0000000 --- a/sip/qt/qevent.sip +++ /dev/null @@ -1,857 +0,0 @@ -// 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 -// -// 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 -TQEvent - -TQEvent is fully implemented. - - -Instances of TQEvents are automatically converted to the -correct sub-class. - - - -TQChildEvent - -TQChildEvent is fully implemented. - - - -TQCloseEvent - -TQCloseEvent is fully implemented. - - - -TQIconDragEvent (TQt v3.3+) - -TQIconDragEvent is fully implemented. - - - -TQContextMenuEvent (TQt v3+) - -TQContextMenuEvent is fully implemented. - - - -TQCustomEvent - -TQCustomEvent is fully implemented. Any Python object can be -passed as the event data and its reference count is increased. - - - -TQDragEnterEvent - -TQDragEnterEvent is fully implemented. - - - -TQDragLeaveEvent - -TQDragLeaveEvent is fully implemented. - - - -TQDragMoveEvent - -TQDragMoveEvent is fully implemented. - - - -TQDropEvent - -TQDropEvent is fully implemented. - - - -TQFocusEvent - -TQFocusEvent is fully implemented. - - - -TQHideEvent - -TQHideEvent is fully implemented. - - - -TQIMComposeEvent (TQt v3.1+) - -TQIMComposeEvent is fully implemented. - - - -TQIMEvent (TQt v3+) - -TQIMEvent is fully implemented. - - - -TQKeyEvent - -TQKeyEvent is fully implemented. - - - -TQMouseEvent - -TQMouseEvent is fully implemented. - - - -TQMoveEvent - -TQMoveEvent is fully implemented. - - - -TQPaintEvent - -TQPaintEvent is fully implemented. - - - -TQResizeEvent - -TQResizeEvent is fully implemented. - - - -TQShowEvent - -TQShowEvent is fully implemented. - - - -TQTabletEvent (TQt v3+) - -TQTabletEvent is fully implemented. - - - -TQTimerEvent - -TQTimerEvent is fully implemented. - - - -TQWheelEvent (TQt v2+) - -TQWheelEvent is fully implemented. - - -%End - - -%ModuleHeaderCode -#include -%End - - -class TQEvent : TQt -{ -%TypeHeaderCode -#include -%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 -%End - -public: - TQTimerEvent(int); - - int timerId() const; -}; - - -class TQMouseEvent : TQEvent -{ -%TypeHeaderCode -#include -%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 -%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 -%End - -public: - enum TabletDevice { - NoDevice, - Puck, - Stylus, - Eraser - }; - - TQTabletEvent(Type,const TQPoint &,const TQPoint &,int,int,int,int, - const TQPair &); - TQTabletEvent(const TQPoint &,const TQPoint &,int,int,int,int, - const TQPair &); - - 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 uniqueId(); -}; - - -class TQKeyEvent : TQEvent -{ -%TypeHeaderCode -#include -%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 -%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 -%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 -%End - -public: - TQMoveEvent(const TQPoint &,const TQPoint &); - - const TQPoint &pos() const; - const TQPoint &oldPos() const; -}; - - -class TQResizeEvent : TQEvent -{ -%TypeHeaderCode -#include -%End - -public: - TQResizeEvent(const TQSize &,const TQSize &); - - const TQSize &size() const; - const TQSize &oldSize() const; -}; - - -class TQCloseEvent : TQEvent -{ -%TypeHeaderCode -#include -%End - -public: - TQCloseEvent(); - - bool isAccepted() const; - void accept(); - void ignore(); -}; - - -class TQIconDragEvent : TQEvent -{ -%TypeHeaderCode -#include -%End - -public: - TQIconDragEvent(); - - bool isAccepted() const; - void accept(); - void ignore(); -}; - - -class TQShowEvent : TQEvent -{ -%TypeHeaderCode -#include -%End - -public: - TQShowEvent(); -}; - - -class TQHideEvent : TQEvent -{ -%TypeHeaderCode -#include -%End - -public: - TQHideEvent(); -}; - - -class TQContextMenuEvent : TQEvent -{ -%TypeHeaderCode -#include -%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 -%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 -%End - -public: - TQIMComposeEvent(Type,const TQString &,int,int); -}; - - -%If (TQt_DRAGANDDROP) - -class TQDropEvent : TQEvent, TQMimeSource -{ -%TypeHeaderCode -#include -%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 -%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 -%End - -public: - TQDragEnterEvent(const TQPoint &); -}; - - -class TQDragLeaveEvent : TQEvent -{ -%TypeHeaderCode -#include -%End - -public: - TQDragLeaveEvent(); -}; - -%End - - -class TQChildEvent : TQEvent -{ -%TypeHeaderCode -#include -%End - -public: - TQChildEvent(Type,TQObject *); - - TQObject *child() const; - bool inserted() const; - bool removed() const; -}; - - -class TQCustomEvent : TQEvent -{ -%TypeHeaderCode -#include -%End - -public: - TQCustomEvent(Type,SIP_PYOBJECT /Transfer/); - TQCustomEvent(int); - ~TQCustomEvent(); -%VirtualCatcherCode - // We need to garbage collect any current data. - - PyObject *old = reinterpret_cast(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(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(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(sipCpp -> TQCustomEvent::data()); - - if (obj) - sipRes = sipVisit(obj, sipArg); - else - sipRes = 0; -%End - -%GCClearCode - // Support the Python garbage collector. - - PyObject *obj = reinterpret_cast(sipCpp -> TQCustomEvent::data()); - - sipCpp -> TQCustomEvent::setData(0); - - Py_XDECREF(obj); - - sipRes = 0; -%End -}; diff --git a/sip/qt/qeventloop.sip b/sip/qt/qeventloop.sip deleted file mode 100644 index 2146996..0000000 --- a/sip/qt/qeventloop.sip +++ /dev/null @@ -1,83 +0,0 @@ -// This is the SIP interface definition for TQEventLoop. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQEventLoop (TQt v3.1+) - - virtual int exec - - - -This has been renamed to exec_loop in Python. - - -%End - - -class TQEventLoop : TQObject -{ -%TypeHeaderCode -#include -%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/qt/qfile.sip b/sip/qt/qfile.sip deleted file mode 100644 index 5536c98..0000000 --- a/sip/qt/qfile.sip +++ /dev/null @@ -1,199 +0,0 @@ -// This is the SIP interface definition for TQFile. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQFile - - bool open - int m - FILE *f - - -Not implemented. - - - - TQ_LONG readBlock - char *data - TQ_ULONG len - - -This takes a single len parameter. The -data is returned if there was no error, otherwise -None is returned. - - - - TQ_LONG readLine - char *data - TQ_ULONG maxlen - - -This takes a single maxlen parameter. The -data is returned if there was no error, otherwise -None is returned. - - - - static void setDecodingFunction - EncoderFn f - - -Not yet implemented. (TQt v2+) - - - - static void setEncodingFunction - EncoderFn f - - -Not yet implemented. (TQt v2+) - - - - TQ_LONG writeBlock - const char *data - TQ_ULONG len - - -len is derived from data and not passed -as a parameter. - - -%End - - -class TQFile : TQIODevice -{ -%TypeHeaderCode -#include -%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/qt/qfiledialog.sip b/sip/qt/qfiledialog.sip deleted file mode 100644 index 920a218..0000000 --- a/sip/qt/qfiledialog.sip +++ /dev/null @@ -1,224 +0,0 @@ -// This is the SIP interface definition for TQFileDialog, TQFileIconProvider and -// TQFilePreview. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQFileDialog - -TQFileDialog is fully implemented. - - - -TQFileIconProvider - -TQFileIconProvider is fully implemented. - - - -TQFilePreview - -TQFilePreview 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. - - -class FilePreview(TQFilePreview): - pass - -class Preview(TQLabel): - def __init__(self, parent=None): - TQLabel.__init__(self, parent) - self.preview = FilePreview() - self.preview.previewUrl = self.previewUrl - - -Note that TQFilePreview cannot be instantiated directly because it is abstract. -Thanks to Hans-Peter Jansen for this trick. - - -%End - - -%If (TQt_FILEDIALOG) - -class TQFileIconProvider : TQObject -{ -%TypeHeaderCode -#include -%End - -public: - TQFileIconProvider(TQObject * /TransferThis/ = 0,const char * = 0); - - virtual const TQPixmap *pixmap(const TQFileInfo &); - -private: - TQFileIconProvider(const TQFileIconProvider &); -}; - - -class TQFilePreview -{ -%TypeHeaderCode -#include -%End - -public: - TQFilePreview(); - - virtual void previewUrl(const TQUrl &) = 0; -}; - - -class TQFileDialog : TQDialog -{ -%TypeHeaderCode -#include -%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/qt/qfileinfo.sip b/sip/qt/qfileinfo.sip deleted file mode 100644 index 38b4609..0000000 --- a/sip/qt/qfileinfo.sip +++ /dev/null @@ -1,94 +0,0 @@ -// This is the SIP interface definition for TQFileInfo. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQFileInfo - -TQFileInfo is fully implemented. - - -%End - - -class TQFileInfo -{ -%TypeHeaderCode -#include -%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/qt/qfont.sip b/sip/qt/qfont.sip deleted file mode 100644 index cb2fe5c..0000000 --- a/sip/qt/qfont.sip +++ /dev/null @@ -1,236 +0,0 @@ -// This is the SIP interface definition for TQFont. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQFont - -TQFont is fully implemented, including the Python -== and != operators. - - -%End - - -class TQFont -{ -%TypeHeaderCode -#include -%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/qt/qfontdatabase.sip b/sip/qt/qfontdatabase.sip deleted file mode 100644 index da6501f..0000000 --- a/sip/qt/qfontdatabase.sip +++ /dev/null @@ -1,71 +0,0 @@ -// This is the SIP interface definition for TQFontDatabase. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQFontDatabase (TQt v2.1+) - -TQFontDatabase is fully implemented. - - -%End - - -%If (TQt_FONTDATABASE) - -class TQFontDatabase -{ -%TypeHeaderCode -#include -%End - -public: - TQFontDatabase(); - - static TQValueList standardSizes(); - - TQStringList families() const; - TQStringList families(TQFont::Script) const; - TQStringList styles(const TQString &) const; - TQValueList pointSizes(const TQString &, - const TQString & = TQString::null); - TQValueList 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/qt/qfontdialog.sip b/sip/qt/qfontdialog.sip deleted file mode 100644 index fdc0cb8..0000000 --- a/sip/qt/qfontdialog.sip +++ /dev/null @@ -1,73 +0,0 @@ -// This is the SIP interface definition for TQFontDialog. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQFontDialog (TQt v2+) - - static TQFont getFont - bool *ok - const TQFont &def - TQWidget *parent = 0 - const char *name = 0 - - -This takes the def, parent and -name parameters and returns a tuple containing the -TQFont result and the ok value. - - - - static TQFont getFont - bool *ok - TQWidget *parent = 0 - const char *name = 0 - - -This takes the parent and name parameters -and returns a tuple containing the TQFont result and the -ok value. - - -%End - - -%If (TQt_FONTDIALOG) - -class TQFontDialog : TQDialog -{ -%TypeHeaderCode -#include -%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/qt/qfontinfo.sip b/sip/qt/qfontinfo.sip deleted file mode 100644 index 7f714d4..0000000 --- a/sip/qt/qfontinfo.sip +++ /dev/null @@ -1,56 +0,0 @@ -// This is the SIP interface definition for TQFontInfo. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQFontInfo - -TQFontInfo is fully implemented. - - -%End - - -class TQFontInfo -{ -%TypeHeaderCode -#include -%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/qt/qfontmetrics.sip b/sip/qt/qfontmetrics.sip deleted file mode 100644 index 18e5b4e..0000000 --- a/sip/qt/qfontmetrics.sip +++ /dev/null @@ -1,167 +0,0 @@ -// This is the SIP interface definition for TQFontMetrics. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQFontMetrics - - TQRect boundingRect - int x - int y - int w - int h - int flags - const TQString &str - int len = -1 - int tabstops = 0 - int *tabarray = 0 - - -The tabarray parameter is a Python list of integers. - - - - TQSize size - int flags - const TQString &str - int len = -1 - int tabstops = 0 - int *tabarray = 0 - - -The tabarray parameter is a Python list of integers. - - -%End - - -class TQFontMetrics -{ -%TypeHeaderCode -#include -%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/qt/qframe.sip b/sip/qt/qframe.sip deleted file mode 100644 index ca47416..0000000 --- a/sip/qt/qframe.sip +++ /dev/null @@ -1,100 +0,0 @@ -// This is the SIP interface definition for TQFrame. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQFrame - -TQFrame is fully implemented. - - -%End - - -class TQFrame : TQWidget -{ -%TypeHeaderCode -#include -%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/qt/qglobal.sip b/sip/qt/qglobal.sip deleted file mode 100644 index 711f26d..0000000 --- a/sip/qt/qglobal.sip +++ /dev/null @@ -1,67 +0,0 @@ -// This is the SIP interface definition for some TQt globals. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -%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/qt/qgrid.sip b/sip/qt/qgrid.sip deleted file mode 100644 index 9047b70..0000000 --- a/sip/qt/qgrid.sip +++ /dev/null @@ -1,51 +0,0 @@ -// This is the SIP interface definition for TQGrid. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQGrid (TQt v2+) - -TQGrid is fully implemented. - - -%End - - -class TQGrid : TQFrame -{ -%TypeHeaderCode -#include -%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/qt/qgridview.sip b/sip/qt/qgridview.sip deleted file mode 100644 index ba73e64..0000000 --- a/sip/qt/qgridview.sip +++ /dev/null @@ -1,72 +0,0 @@ -// This is the SIP interface definition for TQGridView. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQGridView (TQt v3+) - -TQGridView is fully implemented. - - -%End - - -class TQGridView : TQScrollView -{ -%TypeHeaderCode -#include -%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/qt/qgroupbox.sip b/sip/qt/qgroupbox.sip deleted file mode 100644 index f4fdc61..0000000 --- a/sip/qt/qgroupbox.sip +++ /dev/null @@ -1,92 +0,0 @@ -// This is the SIP interface definition for TQGroupBox. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQGroupBox - -TQGroupBox is fully implemented. - - -%End - - -class TQGroupBox : TQFrame -{ -%TypeHeaderCode -#include -%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/qt/qhbox.sip b/sip/qt/qhbox.sip deleted file mode 100644 index 884db2e..0000000 --- a/sip/qt/qhbox.sip +++ /dev/null @@ -1,52 +0,0 @@ -// This is the SIP interface definition for TQHBox. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQHBox (TQt v2+) - -TQHBox is fully implemented. - - -%End - - -class TQHBox : TQFrame -{ -%TypeHeaderCode -#include -%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/qt/qhbuttongroup.sip b/sip/qt/qhbuttongroup.sip deleted file mode 100644 index 3cdcd49..0000000 --- a/sip/qt/qhbuttongroup.sip +++ /dev/null @@ -1,44 +0,0 @@ -// This is the SIP interface definition for TQHButtonGroup. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQHButtonGroup (TQt v2+) - -TQHButtonGroup is fully implemented. - - -%End - - -class TQHButtonGroup : TQButtonGroup -{ -%TypeHeaderCode -#include -%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/qt/qheader.sip b/sip/qt/qheader.sip deleted file mode 100644 index 2161dd3..0000000 --- a/sip/qt/qheader.sip +++ /dev/null @@ -1,127 +0,0 @@ -// This is the SIP interface definition for TQHeader. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQHeader - -TQHeader is fully implemented. - - -%End - - -class TQHeader : TQWidget -{ -%TypeHeaderCode -#include -%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/qt/qhgroupbox.sip b/sip/qt/qhgroupbox.sip deleted file mode 100644 index e287673..0000000 --- a/sip/qt/qhgroupbox.sip +++ /dev/null @@ -1,44 +0,0 @@ -// This is the SIP interface definition for TQHGroupBox. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQHGroupBox (TQt v2+) - -TQHGroupBox is fully implemented. - - -%End - - -class TQHGroupBox : TQGroupBox -{ -%TypeHeaderCode -#include -%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/qt/qiconset.sip b/sip/qt/qiconset.sip deleted file mode 100644 index 8fdba3a..0000000 --- a/sip/qt/qiconset.sip +++ /dev/null @@ -1,107 +0,0 @@ -// This is the SIP interface definition for TQIconSet and TQIconFactory. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQIconSet - -TQIconSet is fully implemented. - - - -TQIconFactory (TQt v3.1+) - -TQIconFactory is fully implemented. - - -%End - - -class TQIconSet -{ -%TypeHeaderCode -#include -%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 -%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/qt/qiconview.sip b/sip/qt/qiconview.sip deleted file mode 100644 index ceb6791..0000000 --- a/sip/qt/qiconview.sip +++ /dev/null @@ -1,381 +0,0 @@ -// This is the SIP interface definition for TQIconView, TQIconViewItem, TQIconDrag -// and TQIconDragItem. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQIconView (TQt v2.1+) - - TQIconViewItem *makeRowLayout - TQIconViewItem *begin - int &y - - -Not yet implemented. - - - -TQIconViewItem (TQt v2.1+) - -TQIconViewItem is fully implemented. - - - -TQIconDrag (TQt v2.1+) - -TQIconDrag is fully implemented. - - - -TQIconDragItem (TQt v2.1+) - -TQIconDragItem is fully implemented. - - -%End - - -%If (TQt_ICONVIEW) - -%If (TQt_DRAGANDDROP) - -class TQIconDragItem -{ -%TypeHeaderCode -#include -%End - -public: - TQIconDragItem(); - - virtual TQByteArray data() const; - virtual void setData(const TQByteArray &); -}; - - -class TQIconDrag : TQDragObject -{ -%TypeHeaderCode -#include -%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 -%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 &); -%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 -%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 &); -%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/qt/qimage.sip b/sip/qt/qimage.sip deleted file mode 100644 index 9fb7907..0000000 --- a/sip/qt/qimage.sip +++ /dev/null @@ -1,448 +0,0 @@ -// This is the SIP interface definition for TQImage, TQImageIO and -// TQImageTextKeyLang. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQImage - -The Python == and != operators are -supported. - - - - TQImage - const char *xpm[] - - -This takes a list of strings as its parameter. - - - - TQImage - uchar *data - int w - int h - int depth - TQRgb *colorTable - int numColors - Endian bitOrder - - -The colorTable parameter is a list of TQRgb instances or -None. (TQt v2.1+) - - - - uchar *bits - - - -The return value is a sip.voidptr object which is only -useful if passed to another Python module. - - - - TQRgb *colorTable - - - -The return value is a sip.voidptr object which is only -useful if passed to another Python module. - - - - TQImage convertDepthWithPalette - int - TQRgb *p - int pc - int cf = 0 - - -Not implemented. - - - - uchar **jumpTable - - - -The return value is a sip.voidptr object which is only -useful if passed to another Python module. - - - - bool loadFromData - const uchar *buf - uint len - const char *format = 0 - ColorMode mode = Auto - - -len is derived from buf and not passed as -a parameter. - - - - uchar *scanLine - int i - - -The return value is a sip.voidptr object which is only -useful if passed to another Python module. - - - -TQImageIO - - static void defineIOHandler - const char *format - const char *header - const char *flags - image_io_handler read_image - image_io_handler write_image - - -Not implemented. - - - -TQImageTextKeyLang - -TQImageTextKeyLang is fully implemented. - - -%End - - -class TQImage -{ -%TypeHeaderCode -#include -%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_qt_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 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 -%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 -%End - -public: - TQImageTextKeyLang(const char *,const char *); - TQImageTextKeyLang(); - - TQCString key; - TQCString lang; -}; - -%End - - -%ModuleHeaderCode -const char **PyTQt_qt_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_qt_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/qt/qinputdialog.sip b/sip/qt/qinputdialog.sip deleted file mode 100644 index f64baa7..0000000 --- a/sip/qt/qinputdialog.sip +++ /dev/null @@ -1,157 +0,0 @@ -// This is the SIP interface definition for TQInputDialog. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQInputDialog (TQt v2.1+) - - static TQString getText - const TQString &caption - const TQString &label - const TQString &text = TQString::null - bool *ok = 0 - TQWidget *parent = 0 - const char *name = 0 - - -The ok is not passed and the returned value is a tuple of -the TQString result and the ok flag. -(TQt v2.1 - v2.3.1) - - - - static TQString getText - const TQString &caption - const TQString &label - TQLineEdit::EchoModeecho - const TQString &text = TQString::null - bool *ok = 0 - TQWidget *parent = 0 - const char *name = 0 - - -The ok is not passed and the returned value is a tuple of -the TQString result and the ok flag. -(TQt v2.2 - v2.3.1) - - - - static TQString getText - const TQString &caption - const TQString &label - TQLineEdit::EchoModeecho = TQLineEdit::Normal - const TQString &text = TQString::null - bool *ok = 0 - TQWidget *parent = 0 - const char *name = 0 - - -The ok is not passed and the returned value is a tuple of -the TQString result and the ok flag. -(TQt v3+) - - - - static int getInteger - const TQString &caption - const TQString &label - int num = 0 - int from = -2147483647 - int to = 2147483647 - int step = 1 - bool *ok = 0 - TQWidget *parent = 0 - const char *name = 0 - - -The ok is not passed and the returned value is a tuple of -the int result and the ok flag. - - - - static double getDouble - const TQString &caption - const TQString &label - double num = 0 - double from = -2147483647 - double to = 2147483647 - int step = 1 - bool *ok = 0 - TQWidget *parent = 0 - const char *name = 0 - - -The ok is not passed and the returned value is a tuple of -the double result and the ok flag. - - - - static TQString getItem - const TQString &caption - const TQString &label - const TQStringList &list - int current = 0 - bool editable = TRUE - bool *ok = 0 - TQWidget *parent = 0 - const char *name = 0 - - -The ok is not passed and the returned value is a tuple of -the TQString result and the ok flag. - - -%End - - -%If (TQt_INPUTDIALOG) - -class TQInputDialog : TQDialog -{ -%TypeHeaderCode -#include -%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/qt/qinterlacestyle.sip b/sip/qt/qinterlacestyle.sip deleted file mode 100644 index 7e4445f..0000000 --- a/sip/qt/qinterlacestyle.sip +++ /dev/null @@ -1,103 +0,0 @@ -// This is the SIP interface definition for TQInterlaceStyle. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQInterlaceStyle (TQt v2.3.1+) - - void scrollBarMetrics - const TQTabBar *sb - int &sliderMin - int &sliderMax - int &sliderLength - int &buttonDim - - -This takes only the sb parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. - - -%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 -%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/qt/qiodevice.sip b/sip/qt/qiodevice.sip deleted file mode 100644 index 30ca235..0000000 --- a/sip/qt/qiodevice.sip +++ /dev/null @@ -1,257 +0,0 @@ -// This is the SIP interface definition for TQIODevice. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQIODevice - -TQIODevice is fully implemented. - - -%End - - -%ModuleHeaderCode -#include -%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 -%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/qt/qkeysequence.sip b/sip/qt/qkeysequence.sip deleted file mode 100644 index 8b94cfd..0000000 --- a/sip/qt/qkeysequence.sip +++ /dev/null @@ -1,113 +0,0 @@ -// This is the SIP interface definition for TQKeySequence. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQKeySequence (TQt v3+) - -TQKeySequence is fully implemented including the operators -==, !=, TQString() and -int(). A TQString instance or a Python -integer may be used whenever a TQKeySequence can be used. - - -%End - - -class TQKeySequence : TQt -{ -%TypeHeaderCode -#include -%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(sipConvertToInstance(sipPy,sipClass_TQKeySequence,sipTransferObj,SIP_NO_CONVERTORS,0,sipIsErr)); - - return 0; - } - - if (sipCanConvertToInstance(sipPy,sipClass_TQString,0)) - { - int state; - TQString *s = reinterpret_cast(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/qt/qlabel.sip b/sip/qt/qlabel.sip deleted file mode 100644 index 849b3a7..0000000 --- a/sip/qt/qlabel.sip +++ /dev/null @@ -1,85 +0,0 @@ -// This is the SIP interface definition for TQLabel. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQLabel - -TQLabel is fully implemented. - - -%End - - -class TQLabel : TQFrame -{ -%TypeHeaderCode -#include -%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/qt/qlayout.sip b/sip/qt/qlayout.sip deleted file mode 100644 index 82b86f2..0000000 --- a/sip/qt/qlayout.sip +++ /dev/null @@ -1,458 +0,0 @@ -// This is the SIP interface definition for TQBoxLayout, TQGLayoutIterator, -// TQGridLayout, TQHBoxLayout, TQLayout, TQLayoutItem, TQLayoutIterator, -// TQSpacerItem, TQVBoxLayout and TQWidgetItem. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQLayout - -TQLayout is fully implemented. - - - -TQBoxLayout - -TQBoxLayout is fully implemented. - - - -TQGLayoutIterator (TQt v2+) - -TQGLayoutIterator is fully implemented. - - - -TQGridLayout - - bool findWidget - TQWidget *w - int *row - int *col - - -This takes the w parameter and returns a tuple containing -the bool result, row and -col. (TQt v2+) - - - -TQHBoxLayout - -TQHBoxLayout is fully implemented. - - - -TQLayoutItem (TQt v2+) - -TQLayoutItem is fully implemented. - - - -TQLayoutIterator (TQt v2+) - - TQLayoutItem *next - - - -This is a wrapper around the TQLayoutIterator -++ operator. - - - -TQSpacerItem (TQt v2+) - -TQSpacerItem is fully implemented. - - - -TQVBoxLayout - -TQVBoxLayout is fully implemented. - - - -TQWidgetItem (TQt v2+) - -TQWidgetItem is fully implemented. - - -%End - - -class TQGLayoutIterator -{ -%TypeHeaderCode -#include -%End - -public: - virtual TQLayoutItem *next() = 0; - virtual TQLayoutItem *current() = 0; - virtual TQLayoutItem *takeCurrent() = 0 /TransferBack/; -}; - - -class TQLayoutIterator -{ -%TypeHeaderCode -#include -%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 -%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 -%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 -%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 -%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 -%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 -%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 -%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 -%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/qt/qlcdnumber.sip b/sip/qt/qlcdnumber.sip deleted file mode 100644 index ef8cb79..0000000 --- a/sip/qt/qlcdnumber.sip +++ /dev/null @@ -1,93 +0,0 @@ -// This is the SIP interface definition for TQLCDNumber. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQLCDNumber - -TQLCDNumber is fully implemented. - - -%End - - -class TQLCDNumber : TQFrame -{ -%TypeHeaderCode -#include -%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/qt/qlibrary.sip b/sip/qt/qlibrary.sip deleted file mode 100644 index 4d0a4cc..0000000 --- a/sip/qt/qlibrary.sip +++ /dev/null @@ -1,55 +0,0 @@ -// This is the SIP interface definition for TQLibrary. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQLibrary (TQt v3+) - -TQLibrary is fully implemented. - - -%End - - -class TQLibrary -{ -%TypeHeaderCode -#include -%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/qt/qlineedit.sip b/sip/qt/qlineedit.sip deleted file mode 100644 index 23488c3..0000000 --- a/sip/qt/qlineedit.sip +++ /dev/null @@ -1,209 +0,0 @@ -// This is the SIP interface definition for TQLineEdit. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQLineEdit - - int characterAt - int xpos - TQChar *chr - - -This takes only the xpos parameter and returns the int -result and the chr value as a tuple. (TQt v3+) - - - - void del - - - -This has been renamed delChar in Python. (TQt v2+) - - - - bool getSelection - int *start - int *end - - -This takes no parameters and returns the bool result and the -start and end values as a tuple. -(TQt v3+) - - -%End - - -class TQLineEdit : TQFrame -{ -%TypeHeaderCode -#include -%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/qt/qlistbox.sip b/sip/qt/qlistbox.sip deleted file mode 100644 index 9efb272..0000000 --- a/sip/qt/qlistbox.sip +++ /dev/null @@ -1,333 +0,0 @@ -// This is the SIP interface definition for TQListBox, TQListBoxItem, -// TQListBoxPixmap and TQListBoxText. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQListBox - - bool itemYPos - int index - int *yPos - - -This takes the index parameter and returns a tuple -containing the bool result and yPos. -(TQt v1.x) - - - -TQListBoxItem - -TQListBoxItem is fully implemented. - - - -TQListBoxPixmap - -TQListBoxPixmap is fully implemented. - - - -TQListBoxText - -TQListBoxText is fully implemented. - - -%End - - -class TQListBox : TQScrollView -{ -%TypeHeaderCode -#include -%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 -%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 -%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 -%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/qt/qlistview.sip b/sip/qt/qlistview.sip deleted file mode 100644 index fa2a5ab..0000000 --- a/sip/qt/qlistview.sip +++ /dev/null @@ -1,491 +0,0 @@ -// This is the SIP interface definition for TQListView, TQListViewItem, -// TQCheckListItem and TQListViewItemIterator. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQListView - -TQListView is fully implemented. - - -Note that to remove a child TQListViewItem you must first -call takeItem() and then del(). - - - -TQListViewItem - -TQListViewItem is fully implemented. - - -Note that to remove a child TQListViewItem you must first -call takeItem() and then del(). - - - -TQCheckListItem - -TQCheckListItem is fully implemented. - - - -TQListViewItemIterator (TQt v2+) - -TQListViewItemIterator is fully implemented. - - -%End - - -class TQListViewItem : TQt -{ -%TypeHeaderCode -#include -%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 -%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 -%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 -%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/qt/qlocale.sip b/sip/qt/qlocale.sip deleted file mode 100644 index 5352ac0..0000000 --- a/sip/qt/qlocale.sip +++ /dev/null @@ -1,533 +0,0 @@ -// This is the SIP interface definition for TQLocale. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQLocale (TQt v3.3+) - - short toShort - bool *ok = 0 - - -This returns a tuple of the short result and the -ok value. - - - - ushort toUShort - bool *ok = 0 - - -This returns a tuple of the ushort result and the -ok value. - - - - int toInt - bool *ok = 0 - - -This returns a tuple of the int result and the -ok value. - - - - uint toUInt - bool *ok = 0 - - -This returns a tuple of the uint result and the -ok value. - - - - TQ_LONG toLong - bool *ok = 0 - - -This returns a tuple of the long result and the -ok value. - - - - TQ_ULONG toULong - bool *ok = 0 - - -This returns a tuple of the ulong result and the -ok value. - - - - float toFloat - bool *ok = 0 - - -This returns a tuple of the float result and the -ok value. - - - - double toDouble - bool *ok = 0 - - -This returns a tuple of the double result and the -ok value. - - -%End - - -class TQLocale -{ -%TypeHeaderCode -#include -%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/qt/qmainwindow.sip b/sip/qt/qmainwindow.sip deleted file mode 100644 index b271b6c..0000000 --- a/sip/qt/qmainwindow.sip +++ /dev/null @@ -1,171 +0,0 @@ -// This is the SIP interface definition for TQMainWindow. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQMainWindow - - TQTextStream &operator<< - TQTextStream & - const TQMainWindow & - - -This operator is fully implemented. (TQt v3+) - - - - TQTextStream &operator>> - TQTextStream & - TQMainWindow & - - -This operator is fully implemented. (TQt v3+) - - - - bool getLocation - TQToolBar *tb - ToolBarDock &dock - int &index - bool &nl - int &extraOffset - - -This takes only the tb parameter and returns a tuple of the -result, dock, index, -nl and extraOffset values. (TQt v2.1.0+) - - - - TQPtrList<TQToolBar> toolBars - ToolBarDock dock - - -This returns a list of TQToolBar instances. (TQt v2.1.0+) - - -%End - - -class TQMainWindow : TQWidget -{ -%TypeHeaderCode -#include -%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 dockWindows(Dock) const; - TQPtrList dockWindows() const; - void lineUpDockWindows(bool = 0); - - void lineUpToolBars(bool = 0); - bool isDockMenuEnabled() const; - - bool hasDockWindow(TQDockWindow *); - TQPtrList 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/qt/qmemarray.sip b/sip/qt/qmemarray.sip deleted file mode 100644 index aebbcb4..0000000 --- a/sip/qt/qmemarray.sip +++ /dev/null @@ -1,164 +0,0 @@ -// This is the SIP interface definition for all types based on the TQMemArray -// template. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQMemArray<type> (TQt v3+) - -Types based on the TQMemArray template are automatically -converted to and from Python lists of the type. - - -%End - - -%MappedType TQMemArray -{ -%TypeHeaderCode -#include -%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 on the heap. - - if (sipIsErr == NULL) - return PyList_Check(sipPy); - - TQMemArray *qma = new TQMemArray(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 -%MappedType TQMemArray -{ -%TypeHeaderCode -#include -%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 *ql = new TQMemArray; - - for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) - { - int state; - TYPE *t = reinterpret_cast(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/qt/qmenubar.sip b/sip/qt/qmenubar.sip deleted file mode 100644 index a008e46..0000000 --- a/sip/qt/qmenubar.sip +++ /dev/null @@ -1,97 +0,0 @@ -// This is the SIP interface definition for TQMenuBar. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQMenuBar - -TQMenuBar is fully implemented. - - -%End - - -class TQMenuBar : TQFrame, TQMenuData -{ -%TypeHeaderCode -#include -%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/qt/qmenudata.sip b/sip/qt/qmenudata.sip deleted file mode 100644 index 7363902..0000000 --- a/sip/qt/qmenudata.sip +++ /dev/null @@ -1,190 +0,0 @@ -// This is the SIP interface definition for TQMenuData, TQCustomMenuItem and -// TQMenuItem. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQMenuData - - TQMenuItem *findItem - int id - TQMenuData **parent - - -Not implemented. - - - -TQCustomMenuItem (TQt v2.1+) - -TQCustomMenuItem is fully implemented. - - - -TQMenuItem - -TQMenuItem is an internal TQt class. - - -%End - - -// Even though this is an internal class, uic for TQt v3.1.0 generates code that -// uses it. -class TQMenuItem -{ -%TypeHeaderCode -#include -%End - -public: - TQMenuItem(); - - void setText(const TQString &); - -private: - TQMenuItem(const TQMenuItem &); -}; - - -class TQMenuData -{ -%TypeHeaderCode -#include -%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 -%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/qt/qmessagebox.sip b/sip/qt/qmessagebox.sip deleted file mode 100644 index 5844107..0000000 --- a/sip/qt/qmessagebox.sip +++ /dev/null @@ -1,139 +0,0 @@ -// This is the SIP interface definition for TQMessageBox. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQMessageBox - -TQMessageBox is fully implemented. - - -%End - - -%If (TQt_MESSAGEBOX) - -class TQMessageBox : TQDialog -{ -%TypeHeaderCode -#include -%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/qt/qmetaobject.sip b/sip/qt/qmetaobject.sip deleted file mode 100644 index 56e96e6..0000000 --- a/sip/qt/qmetaobject.sip +++ /dev/null @@ -1,117 +0,0 @@ -// This is the SIP interface definition for TQMetaObject and TQMetaProperty. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQMetaObject - - int numClassInfo const - bool super = FALSE - - -Not implemented. - - - - const TQClassInfo *classInfo const - bool super = FALSE - - -Not implemented. - - - -TQMetaProperty - -TQMetaProperty is fully implemented. - - -%End - - -class TQMetaObject -{ -%TypeHeaderCode -#include -%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 -%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/qt/qmime.sip b/sip/qt/qmime.sip deleted file mode 100644 index 630b6f2..0000000 --- a/sip/qt/qmime.sip +++ /dev/null @@ -1,88 +0,0 @@ -// This is the SIP interface definition for the TQt v2+ TQMimeSource, -// TQMimeSourceFactory and TQWindowsMime classes. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQMimeSource (TQt v2+) - -TQMimeSource is fully implemented. - - - -TQMimeSourceFactory (TQt v2+) - -TQMimeSourceFactory is fully implemented. - - - -TQWindowsMime (TQt v3+) - -TQWindowsMime is fully implemented. - - -%End - - -class TQMimeSource -{ -%TypeHeaderCode -#include -%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 -%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/qt/qmotifplusstyle.sip b/sip/qt/qmotifplusstyle.sip deleted file mode 100644 index d4d847b..0000000 --- a/sip/qt/qmotifplusstyle.sip +++ /dev/null @@ -1,102 +0,0 @@ -// This is the SIP interface definition for TQMotifPlusStyle. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQMotifPlusStyle (TQt v2.2+) - - void getButtonShift - int &x - int &y - - -This takes no parameters and returns a tuple of the x and -y values. (TQt v2) - - - - void scrollBarMetrics - const TQScrollBar *sb - int &sliderMin - int &sliderMax - int &sliderLength - int &buttonDim - - -This takes only the sb parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. -(TQt v2) - - -%End - - -%If (TQt_STYLE_MOTIFPLUS) - -class TQMotifPlusStyle : TQMotifStyle -{ -%TypeHeaderCode -#include -%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/qt/qmotifstyle.sip b/sip/qt/qmotifstyle.sip deleted file mode 100644 index e018a8e..0000000 --- a/sip/qt/qmotifstyle.sip +++ /dev/null @@ -1,112 +0,0 @@ -// This is the SIP interface definition for TQMotifStyle. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQMotifStyle (TQt v2+) - - void scrollBarMetrics - const TQTabBar *sb - int &sliderMin - int &sliderMax - int &sliderLength - int &buttonDim - - -This takes only the sb parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. -(TQt v2) - - - - void tabbarMetrics - const TQTabBar *t - int &hframe - int &vframe - int &overlap - - -This takes only the t parameter and returns a tuple of the -hframe, vframe and -overlap values. (TQt v2) - - -%End - - -%If (TQt_STYLE_MOTIF) - -class TQMotifStyle : TQCommonStyle -{ -%TypeHeaderCode -#include -%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/qt/qmovie.sip b/sip/qt/qmovie.sip deleted file mode 100644 index 6107321..0000000 --- a/sip/qt/qmovie.sip +++ /dev/null @@ -1,98 +0,0 @@ -// This is the SIP interface definition for TQMovie. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQMovie - - TQMovie - TQDataSource *src - int bufsize = 1024 - - -Not implemented. - - - - void pushData - const uchar *data - int length - - -length is derived from data and not -passed as a parameter. (TQt v2.2.0+) - - -%End - - -class TQMovie -{ -%TypeHeaderCode -#include -%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/qt/qmultilinedit.sip b/sip/qt/qmultilinedit.sip deleted file mode 100644 index 4b3b4f7..0000000 --- a/sip/qt/qmultilinedit.sip +++ /dev/null @@ -1,134 +0,0 @@ -// This is the SIP interface definition for TQMultiLineEdit. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQMultiLineEdit - - void cursorPosition const - int *line - int *col - - -This takes no parameters and returns a tuple of the line and -col values. (TQt v1.x, TQt v2.x) - - - - virtual void del - - - -This has been renamed delChar in Python. (TQt v1.x, TQt v2.x) - - - - void getCursorPosition const - int *line - int *col - - -This takes no parameters and returns a tuple of the line and -col values. (TQt v1.x, TQt v2.x) - - - - bool getMarkedRegion - int *line1 - int *col1 - int *line2 - int *col2 - - -This takes no parameters and returns a tuple of the bool result and the -line1, col1, line2 and -col2 values. - - -%End - - -class TQMultiLineEdit : TQTextEdit -{ -%TypeHeaderCode -#include -%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/qt/qmutex.sip b/sip/qt/qmutex.sip deleted file mode 100644 index 9d2051c..0000000 --- a/sip/qt/qmutex.sip +++ /dev/null @@ -1,74 +0,0 @@ -// This is the SIP interface definition for TQMutex and TQMutexLocker. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQMutex (TQt v2.2+) - -TQMutex is fully implemented. - - - -TQMutexLocker (TQt v3.1+) - -TQMutexLocker is fully implemented. - - -%End - - -%If (TQt_THREAD_SUPPORT) - -class TQMutex -{ -%TypeHeaderCode -#include -%End - -public: - TQMutex(bool = 0); - - void lock() /ReleaseGIL/; - void unlock(); - bool locked(); - bool tryLock(); - -private: - TQMutex(const TQMutex &); -}; - - -class TQMutexLocker -{ -%TypeHeaderCode -#include -%End - -public: - TQMutexLocker(TQMutex *) /ReleaseGIL/; - - TQMutex *mutex() const; - -private: - TQMutexLocker(const TQMutexLocker &); -}; - -%End diff --git a/sip/qt/qnamespace.sip b/sip/qt/qnamespace.sip deleted file mode 100644 index 695c71f..0000000 --- a/sip/qt/qnamespace.sip +++ /dev/null @@ -1,746 +0,0 @@ -// This is the SIP interface definition for the TQt v2+ TQt class. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQt (TQt v2+) - -TQt is fully implemented. - - -%End - - -class TQt -{ -%TypeHeaderCode -#include -%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/pyuic, 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/qt/qnetworkprotocol.sip b/sip/qt/qnetworkprotocol.sip deleted file mode 100644 index 034f0f3..0000000 --- a/sip/qt/qnetworkprotocol.sip +++ /dev/null @@ -1,186 +0,0 @@ -// This is the SIP interface definition for TQNetworkOperation, TQNetworkProtocol -// and TQNetworkProtocolFactoryBase. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQNetworkOperation (TQt v2.1+) - -TQNetworkOperation is fully implemented. - - - -TQNetworkProtocol (TQt v2.1+) - -TQNetworkProtocol is fully implemented. - - - -TQNetworkProtocolFactoryBase (TQt v2.1+) - -TQNetworkProtocolFactoryBase is fully implemented. - - -%End - - -%If (TQt_NETWORKPROTOCOL) - -class TQNetworkProtocolFactoryBase -{ -%TypeHeaderCode -#include -%End - -public: - virtual TQNetworkProtocol *createObject() = 0 /Factory/; - -}; - - -class TQNetworkProtocol : TQObject -{ -%TypeHeaderCode -#include -%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 &,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 -%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/qt/qobject.sip b/sip/qt/qobject.sip deleted file mode 100644 index c0c30e5..0000000 --- a/sip/qt/qobject.sip +++ /dev/null @@ -1,2086 +0,0 @@ -// This is the SIP interface definition for TQObject. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQObject - - bool disconnect - const TQObject *receiver - const char *member = 0 - - -Not yet implemented. - - - - bool disconnect - const char *signal = 0 - const TQObject *receiver = 0 - const char *member = 0 - - -Not yet implemented. - - - - static bool disconnect - const TQObject *sender - const char *signal - const TQObject *receiver - const char *member - - -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 -signal and receiver parameters is not yet -supported. - - -%End - - -class TQObject : TQt -{ -%TypeHeaderCode -#include -#include -%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(PYQT_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_qt_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(QString::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_qt_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_QOBJECT,SIP_SIGNAL,SIP_QOBJECT,SIP_SLOT); -%MethodCode - sipRes = sipConnectRx(a0,a1,a2,a3,0); -%End - - static SIP_PYOBJECT connect(SIP_QOBJECT,SIP_SIGNAL,SIP_PYCALLABLE); -%MethodCode - sipRes = sipConnectRx(a0,a1,a2,0,0); -%End - - SIP_PYOBJECT connect(SIP_QOBJECT,SIP_SIGNAL,SIP_SLOT) const; -%MethodCode - sipRes = sipConnectRx(a0,a1,sipSelf,a2,0); -%End - - static SIP_PYOBJECT disconnect(SIP_QOBJECT,SIP_SIGNAL,SIP_QOBJECT,SIP_SLOT); -%MethodCode - sipRes = sipDisconnectRx(a0,a1,a2,a3); -%End - - static SIP_PYOBJECT disconnect(SIP_QOBJECT,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 (pyqt3EmitSignal(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 = pyqt3GetSender(); -%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="QT_SLOT"/; -%MethodCode - if (!a0) - { - PyErr_Format(PyExc_TypeError,"qt.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="QT_SIGNAL"/; -%MethodCode - if (!a0) - { - PyErr_Format(PyExc_TypeError,"qt.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,"qt.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 pyqt3EmitSignal(PyObject *self, const char *sig, PyObject *sigargs); -PyObject *pyqt3GetSender(); - -%End - - -// This is the TQt support code for SIP v4.4 and later. -%ModuleCode - -#include - -#include -#include -#include -#include -#include - - -// 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 pyqtWrapperType_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "qt.pyqtWrapperType", /* 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 _pyqt3SlotList { - /* The receiver. */ - sipSlot rx; - - /* Next in the list. */ - struct _pyqt3SlotList *next; -} pyqt3SlotList; - - -/* - * A Python signal. - */ -typedef struct _pyqt3PySig { - /* The name of the signal. */ - char *name; - - /* The list of receivers. */ - pyqt3SlotList *rxlist; - - /* Next in the list. */ - struct _pyqt3PySig *next; -} pyqt3PySig; - - -/* - * The C++ wrapper object used by PyTQt3. - */ -typedef struct _pyqtWrapper { - /* The super-type. */ - sipWrapper super; - - /* The list of Python signals. */ - pyqt3PySig *pySigList; -} pyqtWrapper; - - -/* - * Clear any slots connected to any Python signals. - */ -static void clear_py_signals_slots(pyqtWrapper *pw) -{ - pyqt3PySig *ps; - - for (ps = pw->pySigList; ps != NULL; ps = ps->next) - { - pyqt3SlotList *psrx; - - for (psrx = ps->rxlist; psrx != NULL; psrx = psrx->next) - sipClearAnySlotReference(&psrx->rx); - } -} - - -/* - * Find the given Python signal. - */ -static pyqt3PySig *find_py_signal(pyqtWrapper *pw, const char *sig) -{ - pyqt3PySig *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(pyqt3SlotList *sl) -{ - sipFreeSipslot(&sl->rx); - sipFree(sl); -} - - -/* - * The instance clear slot. - */ -static int pyqtWrapper_clear(pyqtWrapper *self) -{ - clear_py_signals_slots(self); - - return sipWrapper_Type->tp_clear((PyObject *)self); -} - - -/* - * The instance dealloc slot. - */ -static void pyqtWrapper_dealloc(pyqtWrapper *self) -{ - clear_py_signals_slots(self); - - while (self->pySigList != NULL) - { - pyqt3PySig *ps; - pyqt3SlotList *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 pyqtWrapper_traverse(pyqtWrapper *self, visitproc visit, void *arg) -{ - int vret; - pyqt3PySig *ps; - - if ((vret = sipWrapper_Type->tp_traverse((PyObject *)self, visit, arg)) != 0) - return vret; - - for (ps = self->pySigList; ps != NULL; ps = ps->next) - { - pyqt3SlotList *psrx; - - for (psrx = ps->rxlist; psrx != NULL; psrx = psrx->next) - if ((vret = sipVisitSlot(&psrx->rx, visit, arg)) != 0) - return vret; - } - - return 0; -} - - -static sipWrapperType pyqtWrapper_Type = { -#if !defined(STACKLESS) - { -#endif - { - PyVarObject_HEAD_INIT(&pyqtWrapperType_Type, 0) - "qt.pyqtWrapper", /* tp_name */ - sizeof (pyqtWrapper), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)pyqtWrapper_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)pyqtWrapper_traverse, /* tp_traverse */ - (inquiry)pyqtWrapper_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 pyqt3SigArgType { - 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 pyqt3SigArg -{ - // The type. - pyqt3SigArgType 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 pyqt3Signature { - // The number of arguments. - int sg_nrargs; - - // The parsed arguments (heap). - pyqt3SigArg *sg_args; - - // The unparsed signature (heap). - char *sg_signature; - - // The next in the list. - pyqt3Signature *sg_next; -}; - - -// A connection to a universal slot. -struct pyqt3SlotConnection -{ - // The transmitter TQObject. - void *sc_transmitter; - - // The parsed signature. - const pyqt3Signature *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 *qtx, pyqt3SlotConnection *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; - pyqt3SlotConnection 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 *qtx, pyqt3SlotConnection *connection, const char **member) : TQObject() -{ - // Save the connection. - conn = *connection; - - // Detect when the transmitter is destroyed. - if (qtx) - connect(qtx, 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 pyqt3Signature *psig = conn.sc_signature; - TQVariant *qv; - - // Save in case it is asked for later. - lastSender = const_cast(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 pyqt3Signature *parseSignature(const char *sig); -static void parseType(const char *type, pyqt3SigArg *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) -{ - pyqt3SlotConnection 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 *qtx = 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)) - qtx = reinterpret_cast(conn.sc_transmitter); - - return new UniversalSlot(qtx, &conn, member); -} - - -// Parse the signal arguments for a connection. -static pyqt3Signature *parseSignature(const char *sig) -{ - static pyqt3Signature *psig_list = NULL; - pyqt3Signature *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 = (pyqt3Signature *)sipMalloc(sizeof (pyqt3Signature) + 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 = (pyqt3SigArg *)sipMalloc(sizeof (pyqt3SigArg) * 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, pyqt3SigArg *arg) -{ - size_t btlen = 0; - int unsup, isref = FALSE, indir = 0; - const char *ep; - pyqt3SigArgType 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(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) - { - pyqt3SlotConnection *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(tx), sig, - reinterpret_cast(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(tx), sig, - reinterpret_cast(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(context); - - if (!us) - us = UniversalSlot::unislots; - - sipSlot *slot = 0; - - while (us) - { - pyqt3SlotConnection *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) -{ - pyqt3PySig *ps; - pyqt3SlotList *psrx; - pyqtWrapper *pw = (pyqtWrapper *)txObj; - - /* Create a new one if necessary. */ - if ((ps = find_py_signal(pw, sig)) == NULL) - { - if ((ps = (pyqt3PySig *)sipMalloc(sizeof (pyqt3PySig))) == 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 = (pyqt3SlotList *)sipMalloc(sizeof (pyqt3SlotList))) == 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) -{ - pyqt3PySig *ps; - - if ((ps = find_py_signal((pyqtWrapper *)txObj, sig)) != NULL) - { - pyqt3SlotList **psrxp; - - for (psrxp = &ps->rxlist; *psrxp != NULL; psrxp = &(*psrxp)->next) - { - pyqt3SlotList *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 pyqt3EmitSignal(self, sig, sigargs); -} - - -// Emit a Python or TQt signal. -int pyqt3EmitSignal(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(tx)->signalsBlocked()) - return 0; - - // See if it is a TQt signal. - if (*sig == '2') - { - pyqt3QtSignal *tab; - - // Search the table. - for (tab = ((pyqt3ClassTypeDef *)((sipWrapperType *)(self->ob_type))->type)->qt3_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; - } - - pyqt3PySig *ps = find_py_signal((pyqtWrapper *)self, sig); - - if (ps) - { - int rc = 0; - pyqt3SlotList *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) - { - pyqt3SlotList *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 *pyqt3GetSender() -{ - 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. - pyqtWrapperType_Type.tp_base = sipWrapperType_Type; - - if (PyType_Ready(&pyqtWrapperType_Type) < 0) - Py_FatalError("qt: Failed to initialise pyqtWrapperType type"); - - // Register the meta-type. - if (sipRegisterPyType((PyTypeObject *)&pyqtWrapperType_Type) < 0) - Py_FatalError("qt: Failed to register pyqtWrapperType type"); - - // Initialise the super-type. - pyqtWrapper_Type.super.ht_type.tp_base = sipWrapper_Type; - - if (PyType_Ready((PyTypeObject *)&pyqtWrapper_Type) < 0) - Py_FatalError("qt: Failed to initialise pyqtWrapper type"); - - // Register the super-type. - if (sipRegisterPyType((PyTypeObject *)&pyqtWrapper_Type) < 0) - Py_FatalError("qt: Failed to register pyqtWrapper type"); -%End diff --git a/sip/qt/qobjectcleanuphandler.sip b/sip/qt/qobjectcleanuphandler.sip deleted file mode 100644 index f633e3b..0000000 --- a/sip/qt/qobjectcleanuphandler.sip +++ /dev/null @@ -1,45 +0,0 @@ -// This is the SIP interface definition for TQObjectCleanupHandler. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQObjectCleanupHandler (TQt v3+) - -TQObjectCleanupHandler is fully implemented. - - -%End - - -class TQObjectCleanupHandler : TQObject -{ -%TypeHeaderCode -#include -%End - -public: - TQObjectCleanupHandler(); - - TQObject *add(TQObject *); - void remove(TQObject *); - bool isEmpty() const; - void clear(); -}; diff --git a/sip/qt/qobjectlist.sip b/sip/qt/qobjectlist.sip deleted file mode 100644 index 1ea6a5a..0000000 --- a/sip/qt/qobjectlist.sip +++ /dev/null @@ -1,107 +0,0 @@ -// This is the SIP interface definition for TQObjectList. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQObjectList - -This class isn't implemented. Whenever a TQObjectList is the -return type of a function or the type of an argument, a Python list of -TQObject instances is used instead. - - -%End - - -%MappedType TQObjectList -{ -%TypeHeaderCode -#include -%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 *qol = new TQObjectList; - - for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) - { - TQObject *qobj; - - // 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. - qobj = reinterpret_cast(sipConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_TQObject,0,0,0,sipIsErr)); - - if (*sipIsErr) - { - delete qol; - return 0; - } - - qol -> append(qobj); - } - - *sipCppPtr = qol; - - return sipGetState(sipTransferObj); -%End -}; diff --git a/sip/qt/qpaintdevice.sip b/sip/qt/qpaintdevice.sip deleted file mode 100644 index 80a2765..0000000 --- a/sip/qt/qpaintdevice.sip +++ /dev/null @@ -1,170 +0,0 @@ -// This is the SIP interface definition for TQPaintDevice. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQPaintDevice - - virtual bool cmd - int - TQPainter * - TQPDevCmdParam * - - -Not implemented. - - -%End - - -%ModuleHeaderCode -#include -%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 -%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/qt/qpaintdevicemetrics.sip b/sip/qt/qpaintdevicemetrics.sip deleted file mode 100644 index a0358c8..0000000 --- a/sip/qt/qpaintdevicemetrics.sip +++ /dev/null @@ -1,51 +0,0 @@ -// This is the SIP interface definition for TQPaintDeviceMetrics. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQPaintDeviceMetrics - -TQPaintDeviceMetrics is fully implemented. - - -%End - - -class TQPaintDeviceMetrics -{ -%TypeHeaderCode -#include -%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/qt/qpainter.sip b/sip/qt/qpainter.sip deleted file mode 100644 index 8111400..0000000 --- a/sip/qt/qpainter.sip +++ /dev/null @@ -1,360 +0,0 @@ -// This is the SIP interface definition for TQPainter. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQPainter - - TQRect boundingRect - int x - int y - int w - int h - int flags - const char *str - int len = -1 - char **intern = 0 - - -The intern parameter is not supported. - - - - TQRect boundingRect - const TQRect& - int flags - const char *str - int len = -1 - char **intern = 0 - - -The intern parameter is not supported. - - - - void drawText - int x - int y - int w - int h - int flags - const char *str - int len = -1 - TQRect *br = 0 - char **intern = 0 - - -The intern parameter is not supported. - - - - void drawText - const TQRect& - int flags - const char *str - int len = -1 - TQRect *br = 0 - char **intern = 0 - - -The intern parameter is not supported. - - - - void setTabArray - int *ta - - -This takes a single parameter which is a list of tab stops. - - - - int *tabArray - - - -This returns a list of tab stops. - - -%End - - -class TQPainter : TQt -{ -%TypeHeaderCode -#include -%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/qt/qpair.sip b/sip/qt/qpair.sip deleted file mode 100644 index 1744b58..0000000 --- a/sip/qt/qpair.sip +++ /dev/null @@ -1,79 +0,0 @@ -// This is the SIP interface definition for all types based on the TQPair -// template. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQPair<type,type> (TQt v3+) - -Types based on the TQPair template are automatically -converted to and from Python tuples of two elements. - - -%End - - -%MappedType TQPair -{ -%TypeHeaderCode -#include -%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 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(fst,sec); - - return 1; -%End -}; diff --git a/sip/qt/qpalette.sip b/sip/qt/qpalette.sip deleted file mode 100644 index 6e4bd98..0000000 --- a/sip/qt/qpalette.sip +++ /dev/null @@ -1,82 +0,0 @@ -// This is the SIP interface definition for TQPalette. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQPalette - -TQPalette is fully implemented, including the Python -== and != operators. - - -%End - - -class TQPalette -{ -%TypeHeaderCode -#include -%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/qt/qpen.sip b/sip/qt/qpen.sip deleted file mode 100644 index b80752b..0000000 --- a/sip/qt/qpen.sip +++ /dev/null @@ -1,59 +0,0 @@ -// This is the SIP interface definition for TQPen. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQPen - -TQPen is fully implemented, including the Python -== and != operators. - - -%End - - -class TQPen : TQt -{ -%TypeHeaderCode -#include -%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/qt/qpicture.sip b/sip/qt/qpicture.sip deleted file mode 100644 index 9bcd839..0000000 --- a/sip/qt/qpicture.sip +++ /dev/null @@ -1,81 +0,0 @@ -// This is the SIP interface definition for TQPicture. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQPicture - - const char *data - - - -Not implemented. - - - - void setData - const char *data - uint size - - -size is derived from data and not passed -as a parameter. - - -%End - - -%If (TQt_PICTURE) - -class TQPicture : TQPaintDevice -{ -%TypeHeaderCode -#include -%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/qt/qpixmap.sip b/sip/qt/qpixmap.sip deleted file mode 100644 index da18766..0000000 --- a/sip/qt/qpixmap.sip +++ /dev/null @@ -1,165 +0,0 @@ -// This is the SIP interface definition for TQPixmap. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQPixmap - - TQPixmap - const char *xpm[] - - -This takes a list of strings as its parameter. - - - - bool loadFromData - const uchar *buf - uint len - const char *format = 0 - ColorMode mode = Auto - - -len is derived from buf and not passed as -a parameter. - - - - bool loadFromData - const uchar *buf - uint len - const char *format - int conversion_flags - - -Not implemented. - - -%End - - -class TQPixmap : TQPaintDevice, TQt -{ -%TypeHeaderCode -#include -%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_qt_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/qt/qpixmapcache.sip b/sip/qt/qpixmapcache.sip deleted file mode 100644 index c8a6c30..0000000 --- a/sip/qt/qpixmapcache.sip +++ /dev/null @@ -1,47 +0,0 @@ -// This is the SIP interface definition for TQPixmapCache. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQPixmapCache (TQt v3+) - -TQPixmapCache is fully implemented. - - -%End - - -class TQPixmapCache -{ -%TypeHeaderCode -#include -%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/qt/qplatinumstyle.sip b/sip/qt/qplatinumstyle.sip deleted file mode 100644 index 78da451..0000000 --- a/sip/qt/qplatinumstyle.sip +++ /dev/null @@ -1,85 +0,0 @@ -// This is the SIP interface definition for TQPlatinumStyle. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQPlatinumStyle (TQt v2+) - - void scrollBarMetrics - const TQTabBar *sb - int &sliderMin - int &sliderMax - int &sliderLength - int &buttonDim - - -This takes only the sb parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. -(TQt v2) - - -%End - - -%If (TQt_STYLE_PLATINUM) - -class TQPlatinumStyle : TQWindowsStyle -{ -%TypeHeaderCode -#include -%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/qt/qpoint.sip b/sip/qt/qpoint.sip deleted file mode 100644 index d82f529..0000000 --- a/sip/qt/qpoint.sip +++ /dev/null @@ -1,98 +0,0 @@ -// This is the SIP interface definition for TQPoint. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQPoint - -The Python -+, +=, --, -=, unary -, -*, *=, -/, /=, -==, != and __nonzero__ -operators are supported. - - - - TQCOORD &rx - - - -Not implemented. - - - - TQCOORD &ry - - - -Not implemented. - - -%End - - -class TQPoint -{ -%TypeHeaderCode -#include -%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/qt/qpointarray.sip b/sip/qt/qpointarray.sip deleted file mode 100644 index e0c83b8..0000000 --- a/sip/qt/qpointarray.sip +++ /dev/null @@ -1,230 +0,0 @@ -// This is the SIP interface definition for TQPointArray. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQPointArray - - TQPointArray - int nPoints - const TQCOORD *points - - -This takes a single parameter which is a list of points. - - - - void point - uint i - int *x - int *y - - -This takes the single parameter i and returns the -x and y values as a tuple. - - - - bool putPoints - int index - int nPoints - const TQCOORD *points - - -This takes two parameters, index and a list of points. - - - - bool putPoints - int index - int nPoints - int firstx - int firsty - ... - - -Not implemented. - - - - bool setPoints - int nPoints - const TQCOORD *points - - -This takes a single parameter which is a list of points. - - - - bool setPoints - int nPoints - int firstx - int firsty - ... - - -Not implemented. - - -%End - - -class TQPointArray -{ -%TypeHeaderCode -#include -%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/qt/qpopupmenu.sip b/sip/qt/qpopupmenu.sip deleted file mode 100644 index 0e08bf5..0000000 --- a/sip/qt/qpopupmenu.sip +++ /dev/null @@ -1,166 +0,0 @@ -// This is the SIP interface definition for TQPopupMenu. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQPopupMenu - - int exec - - - -This has been renamed exec_loop in Python. - - -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 -TQObject.deleteLater() or other techniques. - - - - int exec - const TQPoint &pos - int indexAtPoint = 0 - - -This has been renamed exec_loop in Python. - - -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 -TQObject.deleteLater() or other techniques. - - -%End - - -class TQPopupMenu : TQFrame, TQMenuData -{ -%TypeHeaderCode -#include -%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/qt/qprintdialog.sip b/sip/qt/qprintdialog.sip deleted file mode 100644 index ad2e952..0000000 --- a/sip/qt/qprintdialog.sip +++ /dev/null @@ -1,57 +0,0 @@ -// This is the SIP interface definition for TQPrintDialog. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQPrintDialog (X11) - -TQPrintDialog is fully implemented. - - -%End - - -%If (WS_X11) -%If (TQt_PRINTDIALOG) - -class TQPrintDialog : TQDialog -{ -%TypeHeaderCode -#include -%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/qt/qprinter.sip b/sip/qt/qprinter.sip deleted file mode 100644 index fbe7709..0000000 --- a/sip/qt/qprinter.sip +++ /dev/null @@ -1,174 +0,0 @@ -// This is the SIP interface definition for TQPrinter. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQPrinter - -TQPrinter is fully implemented. - - -%End - - -%If (TQt_PRINTER) - -class TQPrinter : TQPaintDevice -{ -%TypeHeaderCode -#include -%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/qt/qprocess.sip b/sip/qt/qprocess.sip deleted file mode 100644 index 8581534..0000000 --- a/sip/qt/qprocess.sip +++ /dev/null @@ -1,106 +0,0 @@ -// This is the SIP interface definition for TQProcess. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQProcess (TQt v3+) - -TQProcess is fully implemented. - - -%End - - -class TQProcess : TQObject -{ -%TypeHeaderCode -#include -%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/qt/qprogressbar.sip b/sip/qt/qprogressbar.sip deleted file mode 100644 index 0bae238..0000000 --- a/sip/qt/qprogressbar.sip +++ /dev/null @@ -1,73 +0,0 @@ -// This is the SIP interface definition for TQProgressBar. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQProgressBar - -TQProgressBar is fully implemented. - - -%End - - -class TQProgressBar : TQFrame -{ -%TypeHeaderCode -#include -%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/qt/qprogressdialog.sip b/sip/qt/qprogressdialog.sip deleted file mode 100644 index 4b21b55..0000000 --- a/sip/qt/qprogressdialog.sip +++ /dev/null @@ -1,97 +0,0 @@ -// This is the SIP interface definition for TQProgressDialog. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQProgressDialog - -TQProgressDialog is fully implemented. -value. - - -%End - - -%If (TQt_PROGRESSDIALOG) - -class TQProgressDialog : TQDialog -{ -%TypeHeaderCode -#include -%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/qt/qptrlist.sip b/sip/qt/qptrlist.sip deleted file mode 100644 index 5250eb8..0000000 --- a/sip/qt/qptrlist.sip +++ /dev/null @@ -1,107 +0,0 @@ -// This is the SIP interface definition for all types based on the TQPtrList -// template. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQPtrList<type> (TQt v2+) - -Types based on the TQPtrList template are automatically -converted to and from Python lists of the type. - - -%End - - -template -%MappedType TQPtrList -{ -%TypeHeaderCode -#include -%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 *qpl = new TQPtrList; - - 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(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/qt/qpushbutton.sip b/sip/qt/qpushbutton.sip deleted file mode 100644 index 77c4d7a..0000000 --- a/sip/qt/qpushbutton.sip +++ /dev/null @@ -1,83 +0,0 @@ -// This is the SIP interface definition for TQPushButton. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQPushButton - -TQPushButton is fully implemented. - - -%End - - -class TQPushButton : TQButton -{ -%TypeHeaderCode -#include -%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/qt/qradiobutton.sip b/sip/qt/qradiobutton.sip deleted file mode 100644 index ea5c5d3..0000000 --- a/sip/qt/qradiobutton.sip +++ /dev/null @@ -1,59 +0,0 @@ -// This is the SIP interface definition for TQRadioButton. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQRadioButton - -TQRadioButton is fully implemented. - - -%End - - -class TQRadioButton : TQButton -{ -%TypeHeaderCode -#include -%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/qt/qrangecontrol.sip b/sip/qt/qrangecontrol.sip deleted file mode 100644 index f6e760d..0000000 --- a/sip/qt/qrangecontrol.sip +++ /dev/null @@ -1,73 +0,0 @@ -// This is the SIP interface definition for TQRangeControl. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQRangeControl - -TQRangeControl is fully implemented. - - -%End - - -class TQRangeControl -{ -%TypeHeaderCode -#include -%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/qt/qrect.sip b/sip/qt/qrect.sip deleted file mode 100644 index f045752..0000000 --- a/sip/qt/qrect.sip +++ /dev/null @@ -1,194 +0,0 @@ -// This is the SIP interface definition for TQRect. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQRect - -The Python -&, &=, -|, |=, -==, !=, in and -__nonzero__ operators are supported. - - - - void coords - int *x1 - int *y1 - int *x2 - int *y2 - - -This takes no parameters and returns a tuple containing the four values. - - - - void rect - int *x - int *y - int *w - int *h - - -This takes no parameters and returns a tuple containing the four values. - - - - TQCOORD &rBottom - - - -Not implemented. (TQt v2+) - - - - TQCOORD &rLeft - - - -Not implemented. (TQt v2+) - - - - TQCOORD &rRight - - - -Not implemented. (TQt v2+) - - - - TQCOORD &rTop - - - -Not implemented. (TQt v2+) - - -%End - - -class TQRect -{ -%TypeHeaderCode -#include -%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/qt/qregexp.sip b/sip/qt/qregexp.sip deleted file mode 100644 index 02feb48..0000000 --- a/sip/qt/qregexp.sip +++ /dev/null @@ -1,102 +0,0 @@ -// This is the SIP interface definition for TQRegExp. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQRegExp - -The Python == and != operators are -supported. - - - - int match - const char *str - int index = 0 - int *len = 0 - - -This takes str and index parameters and -returns a tuple of the int result and the -len value. (TQt v1.x) - - - - int match - const TQString &str - int index = 0 - int *len = 0 - - -This takes str and index parameters and -returns a tuple of the int result and the -len value. (TQt v2+) - - -%End - - -class TQRegExp -{ -%TypeHeaderCode -#include -%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/qt/qregion.sip b/sip/qt/qregion.sip deleted file mode 100644 index 9ac4b3f..0000000 --- a/sip/qt/qregion.sip +++ /dev/null @@ -1,122 +0,0 @@ -// This is the SIP interface definition for TQRegion. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQRegion - -The Python -|, |=, -+, +=, -&, &=, --, -=, -^, ^=, -==, !=, in and -__nonzero__ operators are supported. - - - - TQArray<TQRect> rects - - - -Not implemented. - - - - void setRects - TQRect *rects - int num - - -Not yet implemented. (TQt v2.2+) - - -%End - - -class TQRegion -{ -%TypeHeaderCode -#include -%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 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/qt/qscrollbar.sip b/sip/qt/qscrollbar.sip deleted file mode 100644 index dc6a096..0000000 --- a/sip/qt/qscrollbar.sip +++ /dev/null @@ -1,102 +0,0 @@ -// This is the SIP interface definition for TQScrollBar. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQScrollBar - -TQScrollBar is fully implemented. - - -%End - - -class TQScrollBar : TQWidget, TQRangeControl -{ -%TypeHeaderCode -#include -%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/qt/qscrollview.sip b/sip/qt/qscrollview.sip deleted file mode 100644 index 91a4a16..0000000 --- a/sip/qt/qscrollview.sip +++ /dev/null @@ -1,230 +0,0 @@ -// This is the SIP interface definition for TQScrollView. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQScrollView - - void contentsToViewport - int x - int y - int &vx - int &vy - - -This takes the x and y parameters and -returns a tuple containing the vx and vy -values. (TQt v2+) - - - - void viewportToContents - int vx - int vy - int &x - int &y - - -This takes the vx and vy parameters and -returns a tuple containing the x and y -values. (TQt v2+) - - -%End - - -class TQScrollView : TQFrame -{ -%TypeHeaderCode -#include -%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/qt/qsemaphore.sip b/sip/qt/qsemaphore.sip deleted file mode 100644 index d164046..0000000 --- a/sip/qt/qsemaphore.sip +++ /dev/null @@ -1,84 +0,0 @@ -// This is the SIP interface definition for TQSemaphore. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSemaphore (TQt v2.2+) - -TQSemaphore is fully implemented. The += -and -= operators have also been implemented, but require -Python v2.0 or later. - - -%End - - -%If (TQt_THREAD_SUPPORT) - -class TQSemaphore -{ -%TypeHeaderCode -#include -%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/qt/qsessionmanager.sip b/sip/qt/qsessionmanager.sip deleted file mode 100644 index e282963..0000000 --- a/sip/qt/qsessionmanager.sip +++ /dev/null @@ -1,72 +0,0 @@ -// This is the SIP interface definition for TQSessionManager. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSessionManager (TQt v2+) - -TQSessionManager is fully implemented. - - -%End - - -class TQSessionManager : TQObject -{ -%TypeHeaderCode -#include -%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/qt/qsettings.sip b/sip/qt/qsettings.sip deleted file mode 100644 index 3831bfd..0000000 --- a/sip/qt/qsettings.sip +++ /dev/null @@ -1,163 +0,0 @@ -// This is the SIP interface definition for TQSettings. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSettings (TQt v3+) - - bool readBoolEntry - const TQString &key - bool def = 0 - bool *ok = 0 - - -The ok is not passed and the returned value is a tuple of -the bool result and the ok flag. - - - -double readDoubleEntry - const TQString &key - double def = 0 - bool *ok = 0 - - -The ok is not passed and the returned value is a tuple of -the double result and the ok flag. - - - -TQString readEntry - const TQString &key - const TQString &def = TQString::null - bool *ok = 0 - - -The ok is not passed and the returned value is a tuple of -the TQString result and the ok flag. - - - -TQStringList readListEntry - const TQString &key - bool *ok = 0 - - -The ok is not passed and the returned value is a tuple of -the TQStringList result and the ok flag. - - - -TQStringList readListEntry - const TQString &key - const TQChar &separator - bool *ok = 0 - - -The ok is not passed and the returned value is a tuple of -the TQStringList result and the ok flag. - - - -int readNumEntry - const TQString &key - int def = 0 - bool *ok = 0 - - -The ok is not passed and the returned value is a tuple of -the int result and the ok flag. - - - - bool writeEntry - const TQString &key - bool value - - -Not implemented. - - -%End - - -class TQSettings -{ -%TypeHeaderCode -#include -%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/qt/qsgistyle.sip b/sip/qt/qsgistyle.sip deleted file mode 100644 index 0dbba8f..0000000 --- a/sip/qt/qsgistyle.sip +++ /dev/null @@ -1,92 +0,0 @@ -// This is the SIP interface definition for TQSGIStyle. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSGIStyle (TQt v2.2+) - - void scrollBarMetrics - const TQScrollBar *sb - int &sliderMin - int &sliderMax - int &sliderLength - int &buttonDim - - -This takes only the sb parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. -(TQt v2) - - -%End - - -%If (TQt_STYLE_SGI) - -class TQSGIStyle : TQMotifStyle -{ -%TypeHeaderCode -#include -%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/qt/qsignalmapper.sip b/sip/qt/qsignalmapper.sip deleted file mode 100644 index 2ac99e6..0000000 --- a/sip/qt/qsignalmapper.sip +++ /dev/null @@ -1,51 +0,0 @@ -// This is the SIP interface definition for TQSignalMapper -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSignalMapper - -TQSignalMapper is fully implemented. - - -%End - - -class TQSignalMapper : TQObject -{ -%TypeHeaderCode -#include -%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/qt/qsimplerichtext.sip b/sip/qt/qsimplerichtext.sip deleted file mode 100644 index cc21df5..0000000 --- a/sip/qt/qsimplerichtext.sip +++ /dev/null @@ -1,64 +0,0 @@ -// This is the SIP interface definition for TQSimpleRichText. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSimpleRichText (TQt v2+) - -TQSimpleRichText is fully implemented. - - -%End - - -class TQSimpleRichText -{ -%TypeHeaderCode -#include -%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/qt/qsize.sip b/sip/qt/qsize.sip deleted file mode 100644 index c5d34ef..0000000 --- a/sip/qt/qsize.sip +++ /dev/null @@ -1,108 +0,0 @@ -// This is the SIP interface definition for TQSize. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSize - -The Python -+, +=, --, -=, -*, *=, -/, /=, -==, != and __nonzero__ -operators are supported. - - - - TQCOORD &rheight - - - -Not implemented. - - - - TQCOORD &rwidth - - - -Not implemented. - - -%End - - -class TQSize -{ -%TypeHeaderCode -#include -%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/qt/qsizegrip.sip b/sip/qt/qsizegrip.sip deleted file mode 100644 index 505f90b..0000000 --- a/sip/qt/qsizegrip.sip +++ /dev/null @@ -1,53 +0,0 @@ -// This is the SIP interface definition for TQSizeGrip. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSizeGrip (TQt v2+) - -TQSizeGrip is fully implemented. - - -%End - - -%If (TQt_SIZEGRIP) - -class TQSizeGrip : TQWidget -{ -%TypeHeaderCode -#include -%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/qt/qsizepolicy.sip b/sip/qt/qsizepolicy.sip deleted file mode 100644 index 4f981e4..0000000 --- a/sip/qt/qsizepolicy.sip +++ /dev/null @@ -1,85 +0,0 @@ -// This is the SIP interface definition for TQSizePolicy. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSizePolicy (TQt v2+) - -TQSizePolicy is fully implemented. - - -%End - - -class TQSizePolicy -{ -%TypeHeaderCode -#include -%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/qt/qslider.sip b/sip/qt/qslider.sip deleted file mode 100644 index 28d42e5..0000000 --- a/sip/qt/qslider.sip +++ /dev/null @@ -1,119 +0,0 @@ -// This is the SIP interface definition for TQSlider. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSlider - -TQSlider is fully implemented. - - -%End - - -class TQSlider : TQWidget, TQRangeControl -{ -%TypeHeaderCode -#include -%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/qt/qsocketnotifier.sip b/sip/qt/qsocketnotifier.sip deleted file mode 100644 index 0f2d27d..0000000 --- a/sip/qt/qsocketnotifier.sip +++ /dev/null @@ -1,61 +0,0 @@ -// This is the SIP interface definition for TQSocketNotifier. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSocketNotifier - -TQSocketNotifier is fully implemented. - - -%End - - -class TQSocketNotifier : TQObject -{ -%TypeHeaderCode -#include -%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/qt/qsound.sip b/sip/qt/qsound.sip deleted file mode 100644 index d0c442e..0000000 --- a/sip/qt/qsound.sip +++ /dev/null @@ -1,58 +0,0 @@ -// This is the SIP interface definition for TQSound. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSound (TQt v2.2+) - -TQSound is fully implemented. - - -%End - - -%If (TQt_SOUND) - -class TQSound : TQObject -{ -%TypeHeaderCode -#include -%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/qt/qspinbox.sip b/sip/qt/qspinbox.sip deleted file mode 100644 index 447ec7c..0000000 --- a/sip/qt/qspinbox.sip +++ /dev/null @@ -1,122 +0,0 @@ -// This is the SIP interface definition for TQSpinBox. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSpinBox - - virtual int mapTextToValue - bool *ok - - -This returns a tuple of the int result and the modified -ok value. - - -%End - - -class TQSpinBox : TQWidget, TQRangeControl -{ -%TypeHeaderCode -#include -%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/qt/qsplashscreen.sip b/sip/qt/qsplashscreen.sip deleted file mode 100644 index 5ef5433..0000000 --- a/sip/qt/qsplashscreen.sip +++ /dev/null @@ -1,57 +0,0 @@ -// This is the SIP interface definition for TQSplashScreen. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSplashScreen (TQt v3.2.0+) - -TQSplashScreen is fully implemented. - - -%End - - -class TQSplashScreen : TQWidget -{ -%TypeHeaderCode -#include -%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/qt/qsplitter.sip b/sip/qt/qsplitter.sip deleted file mode 100644 index 182b706..0000000 --- a/sip/qt/qsplitter.sip +++ /dev/null @@ -1,102 +0,0 @@ -// This is the SIP interface definition for TQSplitter. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSplitter - - void getRange - int id - int *min - int *max - - -This takes the id parameter and returns the -min and max values as a tuple. (TQt v2+) - - -%End - - -%If (TQt_SPLITTER) - -class TQSplitter : TQFrame -{ -%TypeHeaderCode -#include -%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 sizes() const; - void setSizes(TQValueList); - - 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/qt/qstatusbar.sip b/sip/qt/qstatusbar.sip deleted file mode 100644 index d1fadcf..0000000 --- a/sip/qt/qstatusbar.sip +++ /dev/null @@ -1,65 +0,0 @@ -// This is the SIP interface definition for TQStatusBar. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQStatusBar - -TQStatusBar is fully implemented. - - -%End - - -class TQStatusBar : TQWidget -{ -%TypeHeaderCode -#include -%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/qt/qstring.sip b/sip/qt/qstring.sip deleted file mode 100644 index a09e68d..0000000 --- a/sip/qt/qstring.sip +++ /dev/null @@ -1,946 +0,0 @@ -// This is the SIP interface definition for TQChar and TQString. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQChar (TQt v2+) - - uchar &cell const - - - -Not implemented. - - - - uchar &row const - - - -Not implemented. - - - -TQString - -A Python string object (or Unicode object) can be used whenever a -TQString can be used. A TQString can be -converted to a Python string object using the Python str() -function, and to a Python Unicode object using the Python -unicode() function. - - - -The Python +, +=, *, -*=, len, [] -(for reading slices and individual characters), in and -comparison operators are supported. - - - - TQCharRef at - uint i - - -Not yet implemented. (TQt v2+) - - - - TQChar constref const - uint i - - -Not yet implemented. (TQt v2+) - - - - TQChar &ref - uint i - - -Not yet implemented. (TQt v2+) - - - - TQString &setUnicodeCodes - const ushort *unicode_as_shorts - uint len - - -Not yet implemented. (TQt v2.1+) - - - - TQString &sprintf - const char *format - ... - - -Not implemented. - - - - short toShort - bool *ok = 0 - - -This returns a tuple of the short result and the -ok value. - - - - ushort toUShort - bool *ok = 0 - - -This returns a tuple of the ushort result and the -ok value. - - - - int toInt - bool *ok = 0 - - -This returns a tuple of the int result and the -ok value. - - - - uint toUInt - bool *ok = 0 - - -This returns a tuple of the uint result and the -ok value. - - - - long toLong - bool *ok = 0 - - -This returns a tuple of the long result and the -ok value. - - - - ulong toULong - bool *ok = 0 - - -This returns a tuple of the ulong result and the -ok value. - - - - float toFloat - bool *ok = 0 - - -This returns a tuple of the float result and the -ok value. - - - - double toDouble - bool *ok = 0 - - -This returns a tuple of the double result and the -ok value. - - -%End - - -class TQChar -{ -%TypeHeaderCode -#include -%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 -#include -%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_qt_PyObject_FromTQString(sipCpp); -%End - - SIP_PYOBJECT __str__(); -%MethodCode - sipRes = PyTQt_qt_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_qt_PyObject_AsTQString(sipPy); - - if (*sipCppPtr) - return sipGetState(sipTransferObj); - - *sipCppPtr = reinterpret_cast(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_qt_PyObject_FromTQString(const TQString *qstr); -%End - -%ModuleCode -// Convert a QString to a Python Unicode object. -PyObject *PyTQt_qt_PyObject_FromTQString(const TQString *qstr) -{ - 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 qt_len = qstr->length(); - Py_UCS4 maxchar = 0x007f; - - for (int qt_i = 0; qt_i < qt_len && maxchar < 0xffff; ++qt_i) - { - Py_UCS4 uch = qstr->at(qt_i).unicode(); - - if (uch > 0x00ff) - { - maxchar = 0xffff; - } - else if (uch > 0x007f) - { - maxchar = 0x00ff; - } - } - - // Create the correctly sized object. - if ((obj = PyUnicode_New(qt_len, maxchar)) == NULL) - return NULL; - - int kind = PyUnicode_KIND(obj); - void *data = PyUnicode_DATA(obj); - - for (int qt_i = 0; qt_i < qt_len; ++qt_i) - { - Py_UCS4 uch = qstr->at(qt_i).unicode(); - PyUnicode_WRITE(kind, data, qt_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 Qt. - - if ((obj = PyUnicode_FromUnicode(NULL, qstr->length())) == NULL) - return NULL; - - Py_UNICODE *pyu = PyUnicode_AS_UNICODE(obj); - - for (unsigned int i = 0; i < qstr->length(); ++i) - *pyu++ = (qstr->at(i)).unicode(); -#else - if ((obj = PyUnicode_FromUnicode(NULL, qstr->length())) == NULL) - return NULL; - - memcpy(PyUnicode_AS_UNICODE(obj), qstr->ucs2(), - qstr->length() * sizeof (Py_UNICODE)); -#endif - - return obj; -} -%End - - -%ModuleHeaderCode -extern TQString *PyTQt_qt_PyObject_AsTQString(PyObject *obj); -%End - -%ModuleCode -// Convert a Python Unicode object to a QString. -TQString *PyTQt_qt_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 Qt. - - TQString *qstr = new TQString; - - Py_UCS4 *ucode = PyUnicode_4BYTE_DATA(obj); - - for (SIP_SSIZE_T i = 0; i < len; ++i) - qstr->append(TQChar((uint)ucode[i])); - - return qstr; - } - - return NULL; -#else - TQString *qstr = 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) - qstr->append(TQChar((uint)ucode[i])); -# else - qstr->setUnicodeCodes((ushort *)PyUnicode_AS_UNICODE(obj),PyUnicode_GET_SIZE(obj)); -# endif - - return qstr; -#endif - } - else if (PyBytes_Check(obj)) - { - return new TQString(PyBytes_AS_STRING(obj)); - } - - return NULL; -} -%End - - -%ModuleHeaderCode -extern const char *PyTQt_qt_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_qt_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 Qt codec to get to a byte string, and then to a - // Python object. - TQString *qstr = PyTQt_qt_PyObject_AsTQString(obj); - TQString qs = *qstr; - TQByteArray ba = codec->fromUnicode(qs); - delete qstr; - - 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/qt/qstringlist.sip b/sip/qt/qstringlist.sip deleted file mode 100644 index 54e049d..0000000 --- a/sip/qt/qstringlist.sip +++ /dev/null @@ -1,227 +0,0 @@ -// This is the SIP interface definition for TQStringList. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQStringList (TQt v2+) - -The Python len, [] (for both reading and -writing slices and individual elements), del (for deleting -slices and individual elements), +, +=, -*, *=, ==, -!= and in operators are supported. - - - - Iterator append - const TQString &x - - -This does not return a value. - - - - Iterator prepend - const TQString &x - - -This does not return a value. - - -%End - - -class TQStringList -{ -%TypeHeaderCode -#include -%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/qt/qstrlist.sip b/sip/qt/qstrlist.sip deleted file mode 100644 index 40265a7..0000000 --- a/sip/qt/qstrlist.sip +++ /dev/null @@ -1,104 +0,0 @@ -// This is the SIP interface definition for TQStrList. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQStrList - -This class isn't implemented. Whenever a TQStrList is the -return type of a function or the type of an argument, a Python list of strings -is used instead. - - -%End - - -%MappedType TQStrList -{ -%TypeHeaderCode -#include -%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 *qsl = 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 qsl; - return 0; - } - - qsl -> append(s); - } - - *sipCppPtr = qsl; - - return sipGetState(sipTransferObj); -%End -}; diff --git a/sip/qt/qstyle.sip b/sip/qt/qstyle.sip deleted file mode 100644 index 0630d81..0000000 --- a/sip/qt/qstyle.sip +++ /dev/null @@ -1,841 +0,0 @@ -// This is the SIP interface definition for TQStyle and TQStyleOption. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQStyle (TQt v2+) - - virtual void getButtonShift - int &x - int &y - - -This takes no parameters and returns a tuple of the x and -y values. (TQt v2) - - - - virtual void scrollBarMetrics - const TQScrollBar *b - int &sliderMin - int &sliderMax - int &sliderLength - int &buttonDim - - -Thus takes only the b parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. -(TQt v2) - - - - virtual void tabbarMetrics - const TQTabBar *t - int &hframe - int &vframe - int &overlap - - -This takes only the t parameter and returns a tuple of the -hframe, vframe and -overlap values. (TQt v2) - - - -TQStyleOption (TQt v3+) - -TQStyleOption is fully implemented. - - -%End - - -class TQStyleOption -{ -%TypeHeaderCode -#define ENABLE_TQSTYLECONTROLELEMENTDATA_SLOW_COPY 1 -#include -%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 DialogButtonSizeMap; -typedef TQMap 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 -%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 -%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 ObjectEventSourceToHandlerMap; - typedef TQMap ObjectEventSourceDataToHandlerMap; - typedef TQMap 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/qt/qstylefactory.sip b/sip/qt/qstylefactory.sip deleted file mode 100644 index 5e1bd1c..0000000 --- a/sip/qt/qstylefactory.sip +++ /dev/null @@ -1,41 +0,0 @@ -// This is the SIP interface definition for TQStyleFactory. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQStyleFactory (TQt v3+) - -TQStyleFactory is fully implemented. - - -%End - - -class TQStyleFactory -{ -%TypeHeaderCode -#include -%End - -public: - static TQStringList keys(); - static TQStyle *create(const TQString &) /Factory/; -}; diff --git a/sip/qt/qstylesheet.sip b/sip/qt/qstylesheet.sip deleted file mode 100644 index 8f1d546..0000000 --- a/sip/qt/qstylesheet.sip +++ /dev/null @@ -1,194 +0,0 @@ -// This is the SIP interface definition for TQStyleSheet and TQStyleSheetItem. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQStyleSheet (TQt v2+) - -TQStyleSheet is fully implemented. - - - -TQStyleSheetItem (TQt v2+) - -TQStyleSheetItem is fully implemented. - - -%End - - -class TQStyleSheetItem : TQt -{ -%TypeHeaderCode -#include -%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 -%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 &, -// 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/qt/qsyntaxhighlighter.sip b/sip/qt/qsyntaxhighlighter.sip deleted file mode 100644 index c07cd0c..0000000 --- a/sip/qt/qsyntaxhighlighter.sip +++ /dev/null @@ -1,51 +0,0 @@ -// This is the SIP interface definition for TQSyntaxHighlighter. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSyntaxHighlighter (TQt v3.1+) - -TQSyntaxHighlighter is fully implemented. - - -%End - - -class TQSyntaxHighlighter : TQt -{ -%TypeHeaderCode -#include -%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/qt/qtabbar.sip b/sip/qt/qtabbar.sip deleted file mode 100644 index 10e886d..0000000 --- a/sip/qt/qtabbar.sip +++ /dev/null @@ -1,180 +0,0 @@ -// This is the SIP interface definition for TQTab and TQTabBar. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQTab - -TQTab is fully implemented. - - - -TQTabBar - - TQPtrList<TQTab> tabList - - - -This returns a list of TQTab instances. - - -%End - - -class TQTab : TQt -{ -%TypeHeaderCode -#include -%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 -%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 *()]; -%MethodCode - if ((sipRes = PyList_New(0)) == NULL) - sipIsErr = 1; - else - { - TQPtrList *tl; - TQTab *tab; - - Py_BEGIN_ALLOW_THREADS - tl = sipCpp -> sipProtect_tabList(); - Py_END_ALLOW_THREADS - - // Convert the list. - for (TQPtrListIterator 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/qt/qtabdialog.sip b/sip/qt/qtabdialog.sip deleted file mode 100644 index 0cfe69a..0000000 --- a/sip/qt/qtabdialog.sip +++ /dev/null @@ -1,108 +0,0 @@ -// This is the SIP interface definition for TQTabDialog. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQTabDialog - -TQTabDialog is fully implemented. - - -%End - - -%If (TQt_TABDIALOG) - -class TQTabDialog : TQDialog -{ -%TypeHeaderCode -#include -%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/qt/qtabwidget.sip b/sip/qt/qtabwidget.sip deleted file mode 100644 index 9435402..0000000 --- a/sip/qt/qtabwidget.sip +++ /dev/null @@ -1,120 +0,0 @@ -// This is the SIP interface definition for TQTabWidget. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQTabWidget (TQt v2+) - -TQTabWidget is fully implemented. - - -%End - - -class TQTabWidget : TQWidget -{ -%TypeHeaderCode -#include -%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/qt/qtextbrowser.sip b/sip/qt/qtextbrowser.sip deleted file mode 100644 index 3b0a11c..0000000 --- a/sip/qt/qtextbrowser.sip +++ /dev/null @@ -1,65 +0,0 @@ -// This is the SIP interface definition for TQTextBrowser. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQTextBrowser (TQt v2+) - -TQTextBrowser is fully implemented. - - -%End - - -class TQTextBrowser : TQTextEdit -{ -%TypeHeaderCode -#include -%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/qt/qtextcodec.sip b/sip/qt/qtextcodec.sip deleted file mode 100644 index 7a18efe..0000000 --- a/sip/qt/qtextcodec.sip +++ /dev/null @@ -1,132 +0,0 @@ -// This is the SIP interface definition for TQTextCodec, TQTextDecoder and -// TQTextEncoder. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQTextCodec (TQt v2+) - - virtual TQCString fromUnicode - const TQString &uc - int &lenInOut - - -The returned value is a tuple of the TQCString result and the -updated lenInOut. - - - -TQTextDecoder (TQt v2+) - -TQTextDecoder is fully implemented. - - - -TQTextEncoder (TQt v2+) - - virtual TQCString fromUnicode = 0 - const TQString &uc - int &lenInOut - - -The returned value is a tuple of the TQCString result and the -updated lenInOut. - - -%End - - -class TQTextEncoder -{ -%TypeHeaderCode -#include -%End - -public: - virtual TQCString fromUnicode(const TQString &,int & /In,Out/) = 0; -}; - - -class TQTextDecoder -{ -%TypeHeaderCode -#include -%End - -public: - virtual TQString toUnicode(const char *,int) = 0; -}; - - -class TQTextCodec -{ -%TypeHeaderCode -#include -%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/qt/qtextedit.sip b/sip/qt/qtextedit.sip deleted file mode 100644 index ef0f80c..0000000 --- a/sip/qt/qtextedit.sip +++ /dev/null @@ -1,402 +0,0 @@ -// This is the SIP interface definition for TQTextEdit. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQTextEdit (TQt v3+) - -int charAt - const TQPoint &pos - int *para = 0 - - -This takes only the pos parameter and returns a tuple of the -value returned via the para pointer and the int result. - - - - void del - - - -This has been renamed delChar in Python. - - - -virtual bool find - const TQString &expr - bool cs - bool wo - bool forward = TRUE - int *para = 0 - int *index = 0 - - -If the para and index 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 -para and index is returned. - - - -void getCursorPosition - int *para - int *index - - -This takes no parameters and returns a tuple of the values returned via the -para and index pointers. - - - -void getSelection - int *paraFrom - int *indexFrom - int *paraTo - int *indexTo - int selNum = 0 - - -This takes only the selNum parameter and returns a tuple of -the paraFrom, indexFrom, -paraTo and indexTo values. - - -%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 -%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/qt/qtextstream.sip b/sip/qt/qtextstream.sip deleted file mode 100644 index 83778c3..0000000 --- a/sip/qt/qtextstream.sip +++ /dev/null @@ -1,199 +0,0 @@ -// This is the SIP interface definition for TQTextStream, TQTextIStream and -// TQTextOStream. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQTextStream - - TQTextStream - FILE *fp - int mode - - -Not implemented. - - - - TQTextStream &readRawBytes - char *buf - uint len - - -Not yet implemented. - - - - TQTextStream &writeRawBytes - const char *buf - uint len - - -Not yet implemented. - - - -TQTextIStream (TQt v2+) - - TQTextIStream - FILE *fp - int mode - - -Not implemented. - - - -TQTextOStream (TQt v2+) - - TQTextOStream - FILE *fp - int mode - - -Not implemented. - - -%End - - -class TQTextStream -{ -%TypeHeaderCode -#include -%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 -%End - -public: - TQTextIStream(TQString *); - TQTextIStream(TQByteArray); -// TQTextIStream(FILE *); - -private: - TQTextIStream(const TQTextIStream &); -}; - - -class TQTextOStream : TQTextStream -{ -%TypeHeaderCode -#include -%End - -public: - TQTextOStream(TQString *); - TQTextOStream(TQByteArray); -// TQTextOStream(FILE *); - -private: - TQTextOStream(const TQTextOStream &); -}; diff --git a/sip/qt/qtextview.sip b/sip/qt/qtextview.sip deleted file mode 100644 index 1d30dad..0000000 --- a/sip/qt/qtextview.sip +++ /dev/null @@ -1,45 +0,0 @@ -// This is the SIP interface definition for TQTextView. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQTextView (TQt v2+) - -TQTextView is fully implemented. - - -%End - - -class TQTextView : TQTextEdit -{ -%TypeHeaderCode -#include -%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/qt/qthread.sip b/sip/qt/qthread.sip deleted file mode 100644 index b95301a..0000000 --- a/sip/qt/qthread.sip +++ /dev/null @@ -1,83 +0,0 @@ -// This is the SIP interface definition for TQThread. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQThread (TQt v2.2+) - -TQThread is fully implemented. - - -%End - - -%If (TQt_THREAD_SUPPORT) - -class TQThread : TQt /CreatesThread/ -{ -%TypeHeaderCode -#include -%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/qt/qtimer.sip b/sip/qt/qtimer.sip deleted file mode 100644 index 6dd2249..0000000 --- a/sip/qt/qtimer.sip +++ /dev/null @@ -1,57 +0,0 @@ -// This is the SIP interface definition for TQTimer. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQTimer - -TQTimer is fully implemented. - - -%End - - -class TQTimer : TQObject -{ -%TypeHeaderCode -#include -%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/qt/qtmod.sip b/sip/qt/qtmod.sip deleted file mode 100644 index c91847c..0000000 --- a/sip/qt/qtmod.sip +++ /dev/null @@ -1,279 +0,0 @@ -// This is the SIP interface definition for the qt module of PyTQt. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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.qt 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 -%End - -%PreInitialisationCode - if (!vendorid_check()) - { - PyErr_SetString(PyExc_RuntimeError, "PyTQt cannot be used with this Python interpreter"); - return; - } -%End - -%End - -%DefaultMetatype qt.pyqtWrapperType -%DefaultSupertype qt.pyqtWrapper - -// 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 qglobal.sip -%Include qnamespace.sip -%Include qwindowdefs.sip -%Include qpen.sip - -%Include qpaintdevice.sip - -%Include qpixmap.sip -%Include qbitmap.sip - -%Include qsize.sip -%Include qsizepolicy.sip - -%Include qaccel.sip -%Include qaction.sip -%Include qapplication.sip -%Include qassistantclient.sip -%Include qbrush.sip -%Include qbutton.sip -%Include qbuttongroup.sip -%Include qbytearray.sip -%Include qcdestyle.sip -%Include qcheckbox.sip -%Include qclipboard.sip -%Include qcolor.sip -%Include qcolordialog.sip -%Include qcolorgroup.sip -%Include qcombobox.sip -%Include qcommonstyle.sip -%Include qcstring.sip -%Include qcursor.sip -%Include qdatastream.sip -%Include qdatetime.sip -%Include qdatetimeedit.sip -%Include qdesktopwidget.sip -%Include qdial.sip -%Include qdialog.sip -%Include qdir.sip -%Include qdockarea.sip -%Include qdockwindow.sip -%Include qdragobject.sip -%Include qdrawutil.sip -%Include qdropsite.sip -%Include qerrormessage.sip -%Include qevent.sip -%Include qeventloop.sip -%Include qfile.sip -%Include qfiledialog.sip -%Include qfileinfo.sip -%Include qfont.sip -%Include qfontdatabase.sip -%Include qfontdialog.sip -%Include qfontinfo.sip -%Include qfontmetrics.sip -%Include qframe.sip -%Include qgrid.sip -%Include qgridview.sip -%Include qgroupbox.sip -%Include qhbox.sip -%Include qhbuttongroup.sip -%Include qheader.sip -%Include qhgroupbox.sip -%Include qiconset.sip -%Include qiconview.sip -%Include qimage.sip -%Include qinputdialog.sip -%Include qinterlacestyle.sip -%Include qiodevice.sip -%Include qkeysequence.sip -%Include qlabel.sip -%Include qlayout.sip -%Include qlcdnumber.sip -%Include qlibrary.sip -%Include qlineedit.sip -%Include qlistbox.sip -%Include qlistview.sip -%Include qlocale.sip -%Include qmainwindow.sip -%Include qmemarray.sip -%Include qmenubar.sip -%Include qmenudata.sip -%Include qmessagebox.sip -%Include qmetaobject.sip -%Include qmime.sip -%Include qmotifplusstyle.sip -%Include qmotifstyle.sip -%Include qmovie.sip -%Include qmutex.sip -%Include qmultilinedit.sip -%Include qnetworkprotocol.sip -%Include qobject.sip -%Include qobjectcleanuphandler.sip -%Include qobjectlist.sip -%Include qpaintdevicemetrics.sip -%Include qpainter.sip -%Include qpair.sip -%Include qpalette.sip -%Include qpicture.sip -%Include qpixmapcache.sip -%Include qplatinumstyle.sip -%Include qpoint.sip -%Include qpointarray.sip -%Include qpopupmenu.sip -%Include qprintdialog.sip -%Include qprinter.sip -%Include qprocess.sip -%Include qprogressbar.sip -%Include qprogressdialog.sip -%Include qptrlist.sip -%Include qpushbutton.sip -%Include qradiobutton.sip -%Include qrangecontrol.sip -%Include qrect.sip -%Include qregexp.sip -%Include qregion.sip -%Include qscrollbar.sip -%Include qscrollview.sip -%Include qsemaphore.sip -%Include qsessionmanager.sip -%Include qsettings.sip -%Include qsgistyle.sip -%Include qsignalmapper.sip -%Include qsimplerichtext.sip -%Include qsizegrip.sip -%Include qslider.sip -%Include qsocketnotifier.sip -%Include qsound.sip -%Include qspinbox.sip -%Include qsplashscreen.sip -%Include qsplitter.sip -%Include qstatusbar.sip -%Include qstring.sip -%Include qstringlist.sip -%Include qstrlist.sip -%Include qstyle.sip -%Include qstylefactory.sip -%Include qstylesheet.sip -%Include qsyntaxhighlighter.sip -%Include qtabbar.sip -%Include qtabdialog.sip -%Include qtabwidget.sip -%Include qtextbrowser.sip -%Include qtextcodec.sip -%Include qtextedit.sip -%Include qtextstream.sip -%Include qtextview.sip -%Include qthread.sip -%Include qtimer.sip -%Include qtoolbar.sip -%Include qtoolbox.sip -%Include qtoolbutton.sip -%Include qtooltip.sip -%Include qtranslator.sip -%Include qurl.sip -%Include qurlinfo.sip -%Include qurloperator.sip -%Include quuid.sip -%Include qvalidator.sip -%Include qvaluelist.sip -%Include qvariant.sip -%Include qvbox.sip -%Include qvbuttongroup.sip -%Include qvgroupbox.sip -%Include qwaitcondition.sip -%Include qwhatsthis.sip -%Include qwidget.sip -%Include qwidgetlist.sip -%Include qwidgetstack.sip -%Include qwindowsstyle.sip -%Include qwindowsxpstyle.sip -%Include qwizard.sip -%Include qwmatrix.sip -%Include qworkspace.sip - - -// The build file templates. - -%Makefile qt.pro.in -# The project file for the qt module. -# -# Copyright (c) 2007 -# Riverbank Computing Limited -# -# 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 = @PYQT_MODDIR@ -CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ -INCLUDEPATH = @BLX_INCLUDEPATH@ -DEFINES = @BLX_DEFINES@ -LIBS += @PYQT_QASSISTANTCLIENT_LIB@ @BLX_LIBS@ -macx:QMAKE_LFLAGS += -framework Python - -SOURCES = $B - -HEADERS = $H -%End diff --git a/sip/qt/qtoolbar.sip b/sip/qt/qtoolbar.sip deleted file mode 100644 index 5bab07f..0000000 --- a/sip/qt/qtoolbar.sip +++ /dev/null @@ -1,73 +0,0 @@ -// This is the SIP interface definition for TQToolBar. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQToolBar - -TQToolBar is fully implemented. - - -%End - - -class TQToolBar : TQDockWindow -{ -%TypeHeaderCode -#include -%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/qt/qtoolbox.sip b/sip/qt/qtoolbox.sip deleted file mode 100644 index 43486b5..0000000 --- a/sip/qt/qtoolbox.sip +++ /dev/null @@ -1,84 +0,0 @@ -// This is the SIP interface definition for TQToolBox. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQToolBox (TQt v3.2.0+) - -TQToolBox is fully implemented. - - -%End - - -class TQToolBox : TQFrame -{ -%TypeHeaderCode -#include -%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/qt/qtoolbutton.sip b/sip/qt/qtoolbutton.sip deleted file mode 100644 index ab8d195..0000000 --- a/sip/qt/qtoolbutton.sip +++ /dev/null @@ -1,105 +0,0 @@ -// This is the SIP interface definition for TQToolButton. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQToolButton - -TQToolButton is fully implemented. - - -%End - - -class TQToolButton : TQButton -{ -%TypeHeaderCode -#include -%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/qt/qtooltip.sip b/sip/qt/qtooltip.sip deleted file mode 100644 index 1a24264..0000000 --- a/sip/qt/qtooltip.sip +++ /dev/null @@ -1,105 +0,0 @@ -// This is the SIP interface definition for TQToolTip and TQToolTipGroup. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQToolTip - -TQToolTip is fully implemented. - - - -TQToolTipGroup - -TQToolTipGroup is fully implemented. - - -%End - - -class TQToolTipGroup : TQObject -{ -%TypeHeaderCode -#include -%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 -%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/qt/qtranslator.sip b/sip/qt/qtranslator.sip deleted file mode 100644 index 1edee94..0000000 --- a/sip/qt/qtranslator.sip +++ /dev/null @@ -1,113 +0,0 @@ -// This is the SIP interface definition for TQTranslator and TQTranslatorMessage. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQTranslator (TQt v2+) - -TQTranslator is fully implemented. - - - -TQTranslatorMessage (TQt v2.2+) - -TQTranslatorMessage is fully implemented. - - -%End - - -class TQTranslatorMessage -{ -%TypeHeaderCode -#include -%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 -%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 messages() const; - -private: - TQTranslator(const TQTranslator &); -}; diff --git a/sip/qt/qurl.sip b/sip/qt/qurl.sip deleted file mode 100644 index 004b653..0000000 --- a/sip/qt/qurl.sip +++ /dev/null @@ -1,110 +0,0 @@ -// This is the SIP interface definition for TQUrl. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQUrl (TQt v2.1+) - -TQUrl is fully implemented, including the -TQString(), == and != -operators. - - -%End - - -class TQUrl -{ -%TypeHeaderCode -#include -%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/qt/qurlinfo.sip b/sip/qt/qurlinfo.sip deleted file mode 100644 index f2f0467..0000000 --- a/sip/qt/qurlinfo.sip +++ /dev/null @@ -1,90 +0,0 @@ -// This is the SIP interface definition for TQUrlInfo. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQUrlInfo (TQt v2.1+) - -TQUrlInfo is fully implemented. - - -%End - - -%If (TQt_NETWORKPROTOCOL) - -class TQUrlInfo -{ -%TypeHeaderCode -#include -%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/qt/qurloperator.sip b/sip/qt/qurloperator.sip deleted file mode 100644 index 20e0d8d..0000000 --- a/sip/qt/qurloperator.sip +++ /dev/null @@ -1,96 +0,0 @@ -// This is the SIP interface definition for TQUrlOperator. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQUrlOperator (TQt v2.1+) - - virtual bool isDir - bool *ok - - -This returns a tuple of the bool result and the -ok value. - - -%End - - -%If (TQt_NETWORKPROTOCOL) - -class TQUrlOperator : TQObject, TQUrl -{ -%TypeHeaderCode -#include -%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 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 &,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 &); - 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/qt/quuid.sip b/sip/qt/quuid.sip deleted file mode 100644 index df334fa..0000000 --- a/sip/qt/quuid.sip +++ /dev/null @@ -1,74 +0,0 @@ -// This is the SIP interface definition for TQUuid. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQUuid (TQt v3.0+) - -TQUuid is fully implemented. - - -%End - - -class TQUuid -{ -%TypeHeaderCode -#include -%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/qt/qvalidator.sip b/sip/qt/qvalidator.sip deleted file mode 100644 index c400969..0000000 --- a/sip/qt/qvalidator.sip +++ /dev/null @@ -1,169 +0,0 @@ -// This is the SIP interface definition for TQValidator, TQDoubleValidator, -// TQIntValidator and TQRegExpValidator. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQValidator - - virtual State validate - TQString& input - int& pos - - -The returned value is a tuple of the State result and the -updated pos. - - - -TQDoubleValidator - - State validate - TQString& input - int& pos - - -The returned value is a tuple of the State result and the -updated pos. - - - -TQIntValidator - - State validate - TQString& input - int& pos - - -The returned value is a tuple of the State result and the -updated pos. - - - -TQRegExpValidator (TQt v3+) - - virtual State validate - TQString& input - int& pos - - -The returned value is a tuple of the State result and the -updated pos. - - -%End - - -class TQValidator : TQObject -{ -%TypeHeaderCode -#include -%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 -%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 -%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 -%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/qt/qvaluelist.sip b/sip/qt/qvaluelist.sip deleted file mode 100644 index d803861..0000000 --- a/sip/qt/qvaluelist.sip +++ /dev/null @@ -1,173 +0,0 @@ -// This is the SIP interface definition for all types based on the TQValueList -// template. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQValueList<type> (TQt v2+) - -Types based on the TQValueList template are automatically -converted to and from Python lists of the type. - - -%End - - -template -%MappedType TQValueList -{ -%TypeHeaderCode -#include -%End - -%ConvertFromTypeCode - int i; - PyObject *l; - - // Create the list. - - if ((l = PyList_New(sipCpp -> count())) == NULL) - return NULL; - - // Get it. - - i = 0; - TQValueListConstIterator 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 *qvl = new TQValueList; - - 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(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 -{ -%TypeHeaderCode -#include -%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 on the heap. - - if (sipIsErr == NULL) - return PyList_Check(sipPy); - - TQValueList *qvl = new TQValueList; - - 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/qt/qvariant.sip b/sip/qt/qvariant.sip deleted file mode 100644 index ea28fcf..0000000 --- a/sip/qt/qvariant.sip +++ /dev/null @@ -1,378 +0,0 @@ -// This is the SIP interface definition for TQVariant. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQVariant (TQt v2.1+) - - TQVariant - const char *val - - -Not implemented. - - - - TQVariant - const TQBitArray &val - - -Not yet implemented. (TQt v3+) - - - - TQVariant - const TQValueList<TQVariant> &val - - -Not yet implemented. - - - - TQVariant - const TQMap<TQString,TQVariant> &val - - -Not yet implemented. - - - - TQBitArray &asBitArray - - - -Not yet implemented. (TQt v3+) - - - - bool &asBool - - - -Not implemented. - - - - double &asDouble - - - -Not implemented. - - - - int &asInt - - - -Not implemented. - - - - TQValueList<TQVariant> &asList - - - -Not implemented. - - - - TQMap<TQString,TQVariant> &asMap - - - -Not implemented. - - - - uint &asUInt - - - -Not implemented. - - - - TQValueListConstIterator<TQVariant>listBegin const - - - -Not implemented. - - - - TQValueListConstIterator<TQVariant>listEnd const - - - -Not implemented. - - - - TQMapConstIterator<TQString,TQVariant>mapBegin const - - - -Not implemented. - - - - TQMapConstIterator<TQString,TQVariant>mapEnd const - - - -Not implemented. - - - - TQMapConstIterator<TQString,TQVariant>mapFind const - const TQString &key - - -Not implemented. - - - - TQValueListConstIterator<TQString>stringListBegin const - - - -Not implemented. - - - - TQValueListConstIterator<TQString>stringListEnd const - - - -Not implemented. - - - - const TQBitArray toBitArray const - - - -Not yet implemented. (TQt v3+) - - - - const TQValueList<TQVariant>toList const - - - -Not yet implemented. - - - - const TQMap<TQString,TQVariant>toMap const - - - -Not yet implemented. - - -%End - - -class TQVariant -{ -%TypeHeaderCode -#include -%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(const TQMap &); - 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 toList() const; -// const TQMap toMap() const; - TQSizePolicy toSizePolicy() const; - -// TQValueListConstIterator listBegin() const; -// TQValueListConstIterator listEnd() const; -// TQValueListConstIterator stringListBegin() const; -// TQValueListConstIterator stringListEnd() const; -// TQMapConstIterator mapBegin() const; -// TQMapConstIterator mapEnd() const; -// TQMapConstIterator 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 & asList(); -// TQMap & asMap(); - TQSizePolicy & asSizePolicy(); - - void load(TQDataStream &); - void save(TQDataStream &) const; - - static const char *typeToName(Type); - static Type nameToType(const char *); -}; diff --git a/sip/qt/qvbox.sip b/sip/qt/qvbox.sip deleted file mode 100644 index d88d324..0000000 --- a/sip/qt/qvbox.sip +++ /dev/null @@ -1,43 +0,0 @@ -// This is the SIP interface definition for TQVBox. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQVBox (TQt v2+) - -TQVBox is fully implemented. - - -%End - - -class TQVBox : TQHBox -{ -%TypeHeaderCode -#include -%End - -public: - TQVBox(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); - -private: - TQVBox(const TQVBox &); -}; diff --git a/sip/qt/qvbuttongroup.sip b/sip/qt/qvbuttongroup.sip deleted file mode 100644 index d024bfc..0000000 --- a/sip/qt/qvbuttongroup.sip +++ /dev/null @@ -1,44 +0,0 @@ -// This is the SIP interface definition for TQVButtonGroup. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQVButtonGroup (TQt v2+) - -TQVButtonGroup is fully implemented. - - -%End - - -class TQVButtonGroup : TQButtonGroup -{ -%TypeHeaderCode -#include -%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/qt/qvgroupbox.sip b/sip/qt/qvgroupbox.sip deleted file mode 100644 index 9714a08..0000000 --- a/sip/qt/qvgroupbox.sip +++ /dev/null @@ -1,44 +0,0 @@ -// This is the SIP interface definition for TQVGroupBox. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQVGroupBox (TQt v2+) - -TQVGroupBox is fully implemented. - - -%End - - -class TQVGroupBox : TQGroupBox -{ -%TypeHeaderCode -#include -%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/qt/qwaitcondition.sip b/sip/qt/qwaitcondition.sip deleted file mode 100644 index 8f96561..0000000 --- a/sip/qt/qwaitcondition.sip +++ /dev/null @@ -1,53 +0,0 @@ -// This is the SIP interface definition for TQWaitCondition. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQWaitCondition (TQt v2.2+) - -TQWaitCondition is fully implemented. - - -%End - - -%If (TQt_THREAD_SUPPORT) - -class TQWaitCondition -{ -%TypeHeaderCode -#include -%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/qt/qwhatsthis.sip b/sip/qt/qwhatsthis.sip deleted file mode 100644 index b6d5a3a..0000000 --- a/sip/qt/qwhatsthis.sip +++ /dev/null @@ -1,60 +0,0 @@ -// This is the SIP interface definition for TQWhatsThis. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQWhatsThis - -TQWhatsThis is fully implemented. - - -%End - - -class TQWhatsThis : TQt -{ -%TypeHeaderCode -#include -%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/qt/qwidget.sip b/sip/qt/qwidget.sip deleted file mode 100644 index 30c3af9..0000000 --- a/sip/qt/qwidget.sip +++ /dev/null @@ -1,410 +0,0 @@ -// This is the SIP interface definition for TQWidget. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQWidget - - TQWExtra *extraData - - - -Not implemented. - - - - TQFocusData *focusData - - - -Not implemented. - - - - void lower - - - -This has been renamed to lowerW in Python. - - - - void raise - - - -This has been renamed to raiseW in Python. - - -%End - - -class TQWidget : TQObject, TQPaintDevice -{ -%TypeHeaderCode -#include -%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/qt/qwidgetlist.sip b/sip/qt/qwidgetlist.sip deleted file mode 100644 index 9010b86..0000000 --- a/sip/qt/qwidgetlist.sip +++ /dev/null @@ -1,107 +0,0 @@ -// This is the SIP interface definition for TQWidgetList. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQWidgetList - -This class isn't implemented. Whenever a TQWidgetList is the -return type of a function or the type of an argument, a Python list of -instances is used instead. - - -%End - - -%MappedType TQWidgetList -{ -%TypeHeaderCode -#include -%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(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/qt/qwidgetstack.sip b/sip/qt/qwidgetstack.sip deleted file mode 100644 index 9451970..0000000 --- a/sip/qt/qwidgetstack.sip +++ /dev/null @@ -1,76 +0,0 @@ -// This is the SIP interface definition for TQWidgetStack. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQWidgetStack - -TQWidgetStack is fully implemented. - - -%End - - -class TQWidgetStack : TQFrame -{ -%TypeHeaderCode -#include -%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/qt/qwindowdefs.sip b/sip/qt/qwindowdefs.sip deleted file mode 100644 index 5e709db..0000000 --- a/sip/qt/qwindowdefs.sip +++ /dev/null @@ -1,51 +0,0 @@ -// This is the SIP interface definition for a variety of constant definitions. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQt Constants - -All constant values defined by TQt have equivalent constants defined to Python. - - -%End - - -%ModuleHeaderCode -#include -%End - - -%OptionalInclude qwindowdefs_mac.sip -%OptionalInclude qwindowdefs_qws.sip -%OptionalInclude qwindowdefs_win.sip -%OptionalInclude qwindowdefs_x11.sip - - -typedef TQ_INT32 TQCOORD; - -const TQCOORD TQCOORD_MIN; -const TQCOORD TQCOORD_MAX; - - -typedef unsigned TQRgb; - -const char *tqAppName(); diff --git a/sip/qt/qwindowdefs_qws.sip b/sip/qt/qwindowdefs_qws.sip deleted file mode 100644 index e6493df..0000000 --- a/sip/qt/qwindowdefs_qws.sip +++ /dev/null @@ -1,29 +0,0 @@ -// This is the SIP interface definition for a variety of constant definitions -// for TQt/Embedded. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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/qt/qwindowdefs_x11.sip b/sip/qt/qwindowdefs_x11.sip deleted file mode 100644 index db45346..0000000 --- a/sip/qt/qwindowdefs_x11.sip +++ /dev/null @@ -1,37 +0,0 @@ -// This is the SIP interface definition for a variety of constant definitions -// for X11. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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/qt/qwindowsstyle.sip b/sip/qt/qwindowsstyle.sip deleted file mode 100644 index 72e5f83..0000000 --- a/sip/qt/qwindowsstyle.sip +++ /dev/null @@ -1,120 +0,0 @@ -// This is the SIP interface definition for TQWindowsStyle. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQWindowsStyle (TQt v2+) - - void getButtonShift - int &x - int &y - - -This takes no parameters and returns a tuple of the x and -y values. (TQt v2) - - - - void scrollBarMetrics - const TQTabBar *sb - int &sliderMin - int &sliderMax - int &sliderLength - int &buttonDim - - -This takes only the sb parameter and returns a tuple of the -sliderMin, sliderMax, -sliderLength and buttonDim values. -(TQt v2) - - - - void tabbarMetrics - const TQTabBar *t - int &hframe - int &vframe - int &overlap - - -This takes only the t parameter and returns a tuple of the -hframe, vframe and -overlap values. (TQt v2) - - -%End - - -%If (TQt_STYLE_WINDOWS) - -class TQWindowsStyle : TQCommonStyle -{ -%TypeHeaderCode -#include -%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/qt/qwindowsxpstyle.sip b/sip/qt/qwindowsxpstyle.sip deleted file mode 100644 index 121e03b..0000000 --- a/sip/qt/qwindowsxpstyle.sip +++ /dev/null @@ -1,31 +0,0 @@ -// This is the SIP interface definition for TQWindowsXPStyle. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQWindowsXPStyle (TQt v3.0.1+, Windows) - -TQWindowsXPStyle is fully implemented. - - -%End - - diff --git a/sip/qt/qwizard.sip b/sip/qt/qwizard.sip deleted file mode 100644 index 278be85..0000000 --- a/sip/qt/qwizard.sip +++ /dev/null @@ -1,102 +0,0 @@ -// This is the SIP interface definition for TQWizard. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQWizard (TQt v2+) - -TQWizard is fully implemented. - - -%End - - -%If (TQt_WIZARD) - -class TQWizard : TQDialog -{ -%TypeHeaderCode -#include -%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/qt/qwmatrix.sip b/sip/qt/qwmatrix.sip deleted file mode 100644 index 965130e..0000000 --- a/sip/qt/qwmatrix.sip +++ /dev/null @@ -1,142 +0,0 @@ -// This is the SIP interface definition for TQWMatrix. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQWMatrix - -The Python ==, != and -*= operators are supported. - - - - TQWMatrix invert const - bool *invertible = 0 - - -This takes no parameters and returns a tuple of the TQWMatrix -result and the invertible value. - - - - void map const - int x - int y - int *tx - int *ty - - -This takes the x and y parameters and -returns a tuple containing the tx and ty -values. - - - - void map const - float x - float y - float *tx - float *ty - - -This takes the x and y parameters and -returns a tuple containing the tx and ty -values. (TQt v1.x) - - - - void map const - double x - double y - double *tx - double *ty - - -This takes the x and y parameters and -returns a tuple containing the tx and ty -values. (TQt v2+) - - -%End - - -class TQWMatrix -{ -%TypeHeaderCode -#include -%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/qt/qworkspace.sip b/sip/qt/qworkspace.sip deleted file mode 100644 index 06b85be..0000000 --- a/sip/qt/qworkspace.sip +++ /dev/null @@ -1,84 +0,0 @@ -// This is the SIP interface definition for TQWorkspace. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQWorkspace (TQt v2.1+) - -TQWorkspace is fully implemented. - - -%End - - -%If (TQt_WORKSPACE) - -class TQWorkspace : TQWidget -{ -%TypeHeaderCode -#include -%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/qt/versions.sip b/sip/qt/versions.sip deleted file mode 100644 index f47b1e0..0000000 --- a/sip/qt/versions.sip +++ /dev/null @@ -1,92 +0,0 @@ -// This defines the different versions of TQt that PyTQt knows about. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 diff --git a/sip/qtaxcontainer/copying.sip b/sip/qtaxcontainer/copying.sip deleted file mode 100644 index 6da646e..0000000 --- a/sip/qtaxcontainer/copying.sip +++ /dev/null @@ -1,51 +0,0 @@ -// This is the SIP file defining the PyTQt license. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 - -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 pyqt-internal.sip -%OptionalInclude pyqt-gpl.sip -%OptionalInclude pyqt-commercial.sip -%OptionalInclude pyqt-edu.sip -%OptionalInclude pyqt-eval.sip -%OptionalInclude pyqt-nc.sip -%OptionalInclude pyqt-tkc.sip diff --git a/sip/qtaxcontainer/qaxbase.sip b/sip/qtaxcontainer/qaxbase.sip deleted file mode 100644 index 02400b4..0000000 --- a/sip/qtaxcontainer/qaxbase.sip +++ /dev/null @@ -1,86 +0,0 @@ -// This is the SIP interface definition for TQAxBase. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQAxBase (Windows, TQt v3+) - - TQAxObject - IUnknown *iface = 0 - - -Not implemented. - - - - long queryInterface - const TQUuid &uuid - void **iface - - -Not implemented. - - - - PropertyBag propertyBag const - - - -Not implemented. - - - - void setPropertyBag - const PropertyBag &bag - - -Not implemented. - - - - unsigned long registerWeakActiveObject - const TQString &guid - - -This is a utility method provided by PyTQt to make it easier to use -Mark Hammond's win32com module to manipulate objects -created by the qtaxcontainer module. - - -The RegisterActiveObject() COM function is called to -register the TQAxBase instance as a weak object with the -guid GUID. The revoke handle is returned. - - - - static void revokeActiveObject - unsigned long rhandle - - -This is a wrapper around the RevokeActiveObject() COM -function and is called to revoke the object registered using -registerWeakActiveObject(). rhandle is -the revoke handle returned by registerWeakActiveObject(). - - -%End - - diff --git a/sip/qtaxcontainer/qaxobject.sip b/sip/qtaxcontainer/qaxobject.sip deleted file mode 100644 index 01521c2..0000000 --- a/sip/qtaxcontainer/qaxobject.sip +++ /dev/null @@ -1,37 +0,0 @@ -// This is the SIP interface definition for TQAxObject. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQAxObject (Windows, TQt v3+) - - TQAxObject - IUnknown *iface - TQObject *parent = 0 - const char *name = 0 - - -Not implemented. - - -%End - - diff --git a/sip/qtaxcontainer/qaxwidget.sip b/sip/qtaxcontainer/qaxwidget.sip deleted file mode 100644 index 3751088..0000000 --- a/sip/qtaxcontainer/qaxwidget.sip +++ /dev/null @@ -1,37 +0,0 @@ -// This is the SIP interface definition for TQAxWidget. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQAxWidget (Windows, TQt v3+) - - TQAxWidget - IUnknown *iface - TQWidget *parent = 0 - const char *name = 0 - - -Not implemented. - - -%End - - diff --git a/sip/qtaxcontainer/qtaxcontainermod.sip b/sip/qtaxcontainer/qtaxcontainermod.sip deleted file mode 100644 index 1d33487..0000000 --- a/sip/qtaxcontainer/qtaxcontainermod.sip +++ /dev/null @@ -1,32 +0,0 @@ -// This is the SIP interface definition for the qtaxcontainer module of PyTQt. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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.qtaxcontainer 1 - -%Import qt/qtmod.sip - -%Include copying.sip - - -%Include qaxbase.sip -%Include qaxobject.sip -%Include qaxwidget.sip diff --git a/sip/qtcanvas/copying.sip b/sip/qtcanvas/copying.sip deleted file mode 100644 index 6da646e..0000000 --- a/sip/qtcanvas/copying.sip +++ /dev/null @@ -1,51 +0,0 @@ -// This is the SIP file defining the PyTQt license. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 - -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 pyqt-internal.sip -%OptionalInclude pyqt-gpl.sip -%OptionalInclude pyqt-commercial.sip -%OptionalInclude pyqt-edu.sip -%OptionalInclude pyqt-eval.sip -%OptionalInclude pyqt-nc.sip -%OptionalInclude pyqt-tkc.sip diff --git a/sip/qtcanvas/qcanvas.sip b/sip/qtcanvas/qcanvas.sip deleted file mode 100644 index 2fc5c0b..0000000 --- a/sip/qtcanvas/qcanvas.sip +++ /dev/null @@ -1,749 +0,0 @@ -// This is the SIP interface definition for TQCanvas, TQCanvasEllipse, -// TQCanvasItem, TQCanvasItemList, TQCanvasLine, TQCanvasPixmap, -// TQCanvasPixmapArray, TQCanvasPolygon, TQCanvasPolygonalItem, TQCanvasRectangle, -// TQCanvasSpline, TQCanvasSprite, TQCanvasText and TQCanvasView. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQCanvas (TQt v2.2+) - -TQCanvas is fully implemented. - - - -TQCanvasEllipse (TQt v2.2+) - -TQCanvasEllipse is fully implemented. - - - -TQCanvasItem (TQt v2.2+) - -TQCanvasItem is fully implemented. - - - -TQCanvasItemList (TQt v2.2+) - -This class isn't implemented. Whenever a TQCanvasItemList is -the return type of a function or the type of an argument, a Python list of -TQCanvasItem instances is used instead. - - - -TQCanvasLine (TQt v2.2+) - -TQCanvasLine is fully implemented. - - - -TQCanvasPixmap (TQt v2.2+) - -TQCanvasPixmap is fully implemented. - - - -TQCanvasPixmapArray (TQt v2.2+) - - TQPixmapArray - TQPtrList<TQPixmap> pixmaps - TQPtrList<TQPoint> hotspots - - -The pixmaps argument is a Python list of TQPixmap instances, -and the hotspots argument is a Python list of TQPoint -instances. (TQt v2.2.0 - TQt v2.3.1) - - - - TQPixmapArray - TQValueList<TQPixmap> pixmaps - TQPointArray hotspots = TQPointArray() - - -The pixmaps argument is a Python list of TQPixmap instances. -(TQt v3+) - - - -TQCanvasPolygon (TQt v2.2+) - -TQCanvasPolygon is fully implemented. - - - -TQCanvasPolygonalItem (TQt v2.2+) - -TQCanvasPolygonalItem is fully implemented. - - - -TQCanvasRectangle (TQt v2.2+) - -TQCanvasRectangle is fully implemented. - - - -TQCanvasSpline (TQt v3.0+) - -TQCanvasSpline is fully implemented. - - - -TQCanvasSprite (TQt v2.2+) - -TQCanvasSprite is fully implemented. - - - -TQCanvasText (TQt v2.2+) - -TQCanvasText is fully implemented. - - - -TQCanvasView (TQt v2.2+) - -TQCanvasView is fully implemented. - - -%End - - -%MappedType TQCanvasItemList -{ -%TypeHeaderCode -#include -%End - -%ConvertFromTypeCode - // Convert to a Python list of TQCanvasItem instances. - - int i; - PyObject *l; - - // Create the list. - - if ((l = PyList_New(sipCpp -> count())) == NULL) - return NULL; - - // Get it. - - i = 0; - - for (TQCanvasItemList::Iterator it = sipCpp -> begin(); it != sipCpp -> end(); ++it) - { - PyObject *ci; - - if ((ci = sipConvertFromInstance(*it,sipClass_TQCanvasItem,sipTransferObj)) == NULL || PyList_SetItem(l,i,ci) < 0) - { - Py_XDECREF(ci); - Py_DECREF(l); - - return NULL; - } - - ++i; - } - - return l; -%End - -%ConvertToTypeCode - // At the moment this will never be called, so provide a null - // implementation. - - if (sipIsErr == NULL) - return PyList_Check(sipPy); - - PyErr_Format(PyExc_TypeError,"Converting to TQCanvasItemList not yet implemented"); - - *sipIsErr = 1; - - return 0; -%End -}; - - -class TQCanvasItem : TQt -{ -%TypeHeaderCode -#include -%End - -public: - TQCanvasItem(TQCanvas * /TransferThis/); - -%ConvertToSubClassCode - Py_BEGIN_ALLOW_THREADS - - // Use the numeric type values for compatibility with TQt v2. - switch (sipCpp -> rtti()) - { - case 1: - sipClass = sipClass_TQCanvasSprite; - break; - - case 2: - sipClass = sipClass_TQCanvasPolygonalItem; - break; - - case 3: - sipClass = sipClass_TQCanvasText; - break; - - case 4: - sipClass = sipClass_TQCanvasPolygon; - break; - - case 5: - sipClass = sipClass_TQCanvasRectangle; - break; - - case 6: - sipClass = sipClass_TQCanvasEllipse; - break; - - case 7: - sipClass = sipClass_TQCanvasLine; - break; - - case 8: - sipClass = sipClass_TQCanvasSpline; - break; - - default: - sipClass = 0; - } - - Py_END_ALLOW_THREADS -%End - - double x() const; - double y() const; - double z() const; - - virtual void moveBy(double,double); - void move(double,double); - void setX(double); - void setY(double); - void setZ(double); - - bool animated() const; - virtual void setAnimated(bool); - virtual void setVelocity(double,double); - void setXVelocity(double); - void setYVelocity(double); - double xVelocity() const; - double yVelocity() const; - virtual void advance(int); - - virtual bool collidesWith(const TQCanvasItem *) const = 0; - - TQCanvasItemList collisions(bool) const; - - virtual void setCanvas(TQCanvas * /GetWrapper/); -%MethodCode - if (sipCpp -> canvas() != a0) - { - if (a0) - sipTransferTo(sipSelf,a0Wrapper); - else - sipTransferBack(sipSelf); - } - - Py_BEGIN_ALLOW_THREADS - sipSelfWasArg ? sipCpp->TQCanvasItem::setCanvas(a0) : sipCpp->setCanvas(a0); - Py_END_ALLOW_THREADS -%End - - virtual void draw(TQPainter &) = 0; - - void show(); - void hide(); - - virtual void setVisible(bool); - bool isVisible() const; - virtual void setSelected(bool); - bool isSelected() const; - virtual void setEnabled(bool); - bool isEnabled() const; - virtual void setActive(bool); - bool isActive() const; - - enum RttiValues { - Rtti_Item, - Rtti_Sprite, - Rtti_PolygonalItem, - Rtti_Text, - Rtti_Polygon, - Rtti_Rectangle, - Rtti_Ellipse, - Rtti_Line, - Rtti_Spline - }; - - virtual int rtti() const; - - virtual TQRect boundingRect() const = 0; - virtual TQRect boundingRectAdvanced() const; - - TQCanvas *canvas() const; - -protected: - void update(); - -private: - virtual bool collidesWith(const TQCanvasSprite *, - const TQCanvasPolygonalItem *, - const TQCanvasRectangle *, - const TQCanvasEllipse *, - const TQCanvasText *) const = 0; -}; - - -class TQCanvas : TQObject -{ -%TypeHeaderCode -#include -%End - -public: - TQCanvas(TQObject * /TransferThis/ = 0,const char * = 0); - TQCanvas(int,int); - TQCanvas(TQPixmap,int,int,int,int); - -%ConvertToSubClassCode - static struct class_graph { - const char *name; - sipWrapperType **type; - int yes, no; - } graph[] = { - {sipName_TQCanvasView, &sipClass_TQCanvasView, -1, 1}, - {sipName_TQCanvas, &sipClass_TQCanvas, -1, -1}, - }; - - 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 - - virtual void setTiles(TQPixmap,int,int,int,int); - virtual void setBackgroundPixmap(const TQPixmap &); - TQPixmap backgroundPixmap() const; - - virtual void setBackgroundColor(const TQColor &); - TQColor backgroundColor() const; - - virtual void setTile(int,int,int); - int tile(int,int) const; - - int tilesHorizontally() const; - int tilesVertically() const; - - int tileWidth() const; - int tileHeight() const; - - virtual void resize(int,int); - int width() const; - int height() const; - TQSize size() const; - TQRect rect() const; - bool onCanvas(int,int) const; - bool onCanvas(const TQPoint &) const; - bool validChunk(int,int) const; - bool validChunk(const TQPoint &) const; - - int chunkSize() const; - virtual void retune(int,int = 100); - - // These next three are marked as internal in the TQt v2.x - // documentation. -// bool sameChunk() const; -// virtual void setChangedChunk(int,int); -// virtual void setChangedChunkContaining(int,int); - virtual void setAllChanged(); - virtual void setChanged(const TQRect &); - virtual void setUnchanged(const TQRect &); - - TQCanvasItemList allItems(); - TQCanvasItemList collisions(const TQPoint &) const; - TQCanvasItemList collisions(const TQRect &) const; - TQCanvasItemList collisions(const TQPointArray &,const TQCanvasItem *, - bool) const; - - void drawArea(const TQRect &,TQPainter *,bool = 0); - - virtual void setAdvancePeriod(int); - virtual void setUpdatePeriod(int); - - virtual void setDoubleBuffering(bool); - -signals: - void resized(); - -public slots: - virtual void advance(); - virtual void update(); - -protected: - virtual void drawBackground(TQPainter &,const TQRect &); - virtual void drawForeground(TQPainter &,const TQRect &); - -private: - TQCanvas(const TQCanvas &); -}; - - -class TQCanvasView : TQScrollView -{ -%TypeHeaderCode -#include -%End - -public: - TQCanvasView(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); - TQCanvasView(TQCanvas *,TQWidget * /TransferThis/ = 0,const char * = 0, - WFlags = 0); - - TQCanvas* canvas() const; - void setCanvas(TQCanvas *); - - const TQWMatrix &worldMatrix() const; - const TQWMatrix &inverseWorldMatrix() const; - bool setWorldMatrix(const TQWMatrix &); - -protected: - void drawContents(TQPainter *,int,int,int,int); - TQSize sizeHint() const; - -private: - TQCanvasView(const TQCanvasView &); -}; - - -class TQCanvasPixmap : TQPixmap -{ -%TypeHeaderCode -#include -%End - -public: - TQCanvasPixmap(const TQString &); - TQCanvasPixmap(const TQImage &); - TQCanvasPixmap(const TQPixmap &,const TQPoint &); - - int offsetX() const; - int offsetY() const; - void setOffset(int,int); - -private: - TQCanvasPixmap(const TQCanvasPixmap &); -}; - - -class TQCanvasPixmapArray -{ -%TypeHeaderCode -#include -%End - -public: - TQCanvasPixmapArray(); - TQCanvasPixmapArray(const TQString &,int = 0); - TQCanvasPixmapArray(TQValueList,TQPointArray = TQPointArray()); - - bool readPixmaps(const TQString &,int = 0) /ReleaseGIL/; - bool readCollisionMasks(const TQString &) /ReleaseGIL/; - - bool isValid() const; - - TQCanvasPixmap *image(int) const; - void setImage(int,TQCanvasPixmap * /Transfer/); - uint count() const; - -private: - TQCanvasPixmapArray(const TQCanvasPixmapArray &); -}; - - -class TQCanvasSprite : TQCanvasItem -{ -%TypeHeaderCode -#include -%End - -public: - TQCanvasSprite(TQCanvasPixmapArray *,TQCanvas * /TransferThis/); - - void setSequence(TQCanvasPixmapArray *); - - void move(double,double); - virtual void move(double,double,int); - void setFrame(int); - - enum FrameAnimationType { - Cycle, - Oscillate - }; - - virtual void setFrameAnimation(FrameAnimationType = Cycle,int = 1, - int = 0); - int frame() const; - int frameCount() const; - - int rtti() const; - - bool collidesWith(const TQCanvasItem *) const; - - TQRect boundingRect() const; - - int width() const; - int height() const; - - int leftEdge() const; - int topEdge() const; - int rightEdge() const; - int bottomEdge() const; - - int leftEdge(int) const; - int topEdge(int) const; - int rightEdge(int) const; - int bottomEdge(int) const; - TQCanvasPixmap *image() const; - virtual TQCanvasPixmap *imageAdvanced() const; - TQCanvasPixmap *image(int) const; - // This is really virtual, but we want to use the super-class's virtual - // handler. Having to do this is really a SIP bug. - void advance(int); - - void draw(TQPainter &); - -private: - TQCanvasSprite(const TQCanvasSprite &); -}; - - -class TQCanvasPolygonalItem : TQCanvasItem -{ -%TypeHeaderCode -#include -%End - -public: - TQCanvasPolygonalItem(TQCanvas * /TransferThis/); - - bool collidesWith(const TQCanvasItem *) const; - - virtual void setPen(TQPen); - virtual void setBrush(TQBrush); - - TQPen pen() const; - TQBrush brush() const; - - virtual TQPointArray areaPoints() const = 0; - virtual TQPointArray areaPointsAdvanced() const; - TQRect boundingRect() const; - - int rtti() const; - -protected: - void draw(TQPainter &); - virtual void drawShape(TQPainter &) = 0; - - bool winding() const; - void setWinding(bool); - - void invalidate(); - bool isValid() const; -}; - - -class TQCanvasRectangle : TQCanvasPolygonalItem -{ -%TypeHeaderCode -#include -%End - -public: - TQCanvasRectangle(TQCanvas * /TransferThis/); - TQCanvasRectangle(const TQRect &,TQCanvas * /TransferThis/); - TQCanvasRectangle(int,int,int,int,TQCanvas * /TransferThis/); - - int width() const; - int height() const; - void setSize(int,int); - TQSize size() const; - TQPointArray areaPoints() const; - TQRect rect() const; - - bool collidesWith(const TQCanvasItem *) const; - - int rtti() const; - -protected: - void drawShape(TQPainter &); - TQPointArray chunks() const; -}; - - -class TQCanvasPolygon : TQCanvasPolygonalItem -{ -%TypeHeaderCode -#include -%End - -public: - TQCanvasPolygon(TQCanvas * /TransferThis/); - - void setPoints(TQPointArray); - TQPointArray points() const; - void moveBy(double,double); - - TQPointArray areaPoints() const; - - int rtti() const; - -protected: - void drawShape(TQPainter &); -}; - - -class TQCanvasSpline : TQCanvasPolygon -{ -%TypeHeaderCode -#include -%End - -public: - TQCanvasSpline(TQCanvas * /TransferThis/); - - void setControlPoints(TQPointArray,bool = 1); - TQPointArray controlPoints() const; - bool closed() const; - - int rtti() const; -}; - - -class TQCanvasLine : TQCanvasPolygonalItem -{ -%TypeHeaderCode -#include -%End - -public: - TQCanvasLine(TQCanvas * /TransferThis/); - - void setPoints(int,int,int,int); - - TQPoint startPoint() const; - TQPoint endPoint() const; - - int rtti() const; - - void setPen(TQPen); - void moveBy(double,double); - -protected: - void drawShape(TQPainter &); - TQPointArray areaPoints() const; -}; - - -class TQCanvasEllipse : TQCanvasPolygonalItem -{ -%TypeHeaderCode -#include -%End - -public: - TQCanvasEllipse(TQCanvas * /TransferThis/); - TQCanvasEllipse(int,int,TQCanvas * /TransferThis/); - TQCanvasEllipse(int,int,int,int,TQCanvas * /TransferThis/); - - int width() const; - int height() const; - void setSize(int,int); - void setAngles(int,int); - int angleStart() const; - int angleLength() const; - TQPointArray areaPoints() const; - - bool collidesWith(const TQCanvasItem *) const; - - int rtti() const; - -protected: - void drawShape(TQPainter &); -}; - - -class TQCanvasText : TQCanvasItem -{ -%TypeHeaderCode -#include -%End - -public: - TQCanvasText(TQCanvas * /TransferThis/); - TQCanvasText(const TQString &,TQCanvas * /TransferThis/); - TQCanvasText(const TQString &,TQFont,TQCanvas * /TransferThis/); - - void setText(const TQString &); - void setFont(const TQFont &); - void setColor(const TQColor &); - TQString text() const; - TQFont font() const; - TQColor color() const; - - void moveBy(double,double); - - int textFlags() const; - void setTextFlags(int); - - TQRect boundingRect() const; - - bool collidesWith(const TQCanvasItem *) const; - - int rtti() const; - -protected: - virtual void draw(TQPainter &); - -private: - TQCanvasText(const TQCanvasText &); -}; diff --git a/sip/qtcanvas/qtcanvasmod.sip b/sip/qtcanvas/qtcanvasmod.sip deleted file mode 100644 index f89275f..0000000 --- a/sip/qtcanvas/qtcanvasmod.sip +++ /dev/null @@ -1,70 +0,0 @@ -// This is the SIP interface definition for the qtcanvas module of PyTQt. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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.qtcanvas 1 - -%Import qt/qtmod.sip - -%Include copying.sip - - -%Include qcanvas.sip - - -// The build file template. - -%Makefile qtcanvas.pro.in -# The project file for the qtcanvas module. -# -# Copyright (c) 2007 -# Riverbank Computing Limited -# -# 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 = @PYQT_MODDIR@ -CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ -INCLUDEPATH = @BLX_INCLUDEPATH@ -DEFINES = @BLX_DEFINES@ -LIBS += @PYQT_QT_MODULE@ @BLX_LIBS@ -macx:QMAKE_LFLAGS += -framework Python - -SOURCES = $B - -HEADERS = $H -%End diff --git a/sip/qtext/copying.sip b/sip/qtext/copying.sip deleted file mode 100644 index 6da646e..0000000 --- a/sip/qtext/copying.sip +++ /dev/null @@ -1,51 +0,0 @@ -// This is the SIP file defining the PyTQt license. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 - -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 pyqt-internal.sip -%OptionalInclude pyqt-gpl.sip -%OptionalInclude pyqt-commercial.sip -%OptionalInclude pyqt-edu.sip -%OptionalInclude pyqt-eval.sip -%OptionalInclude pyqt-nc.sip -%OptionalInclude pyqt-tkc.sip diff --git a/sip/qtext/qextscintilla.sip b/sip/qtext/qextscintilla.sip deleted file mode 100644 index f9a7592..0000000 --- a/sip/qtext/qextscintilla.sip +++ /dev/null @@ -1,411 +0,0 @@ -// This is the SIP interface definition for TQextScintilla. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -class TQextScintilla : TQextScintillaBase -{ -%TypeHeaderCode -#include -%End - -public: - enum { - AiMaintain, - AiOpening, - AiClosing - }; - - enum AutoCompletionSource { - AcsDocument, - AcsAPIs, -%If (TQScintilla_1_7 -) - AcsAll, -%End - }; - - enum BraceMatch { - NoBraceMatch, - StrictBraceMatch, - SloppyBraceMatch - }; - -%If (TQScintilla_1_4 -) - enum EdgeMode { - EdgeNone, - EdgeLine, - EdgeBackground - }; -%End - - enum EolMode { - EolWindows, - EolUnix, - EolMac - }; - - enum FoldStyle { - NoFoldStyle, - PlainFoldStyle, - CircledFoldStyle, - BoxedFoldStyle, - CircledTreeFoldStyle, - BoxedTreeFoldStyle - }; - - enum MarkerSymbol { - Circle, - Rectangle, - RightTriangle, - SmallRectangle, - RightArrow, - Invisible, - DownTriangle, - Minus, - Plus, - VerticalLine, - BottomLeftCorner, - LeftSideSplitter, - BoxedPlus, - BoxedPlusConnected, - BoxedMinus, - BoxedMinusConnected, - RoundedBottomLeftCorner, - LeftSideRoundedSplitter, - CircledPlus, - CircledPlusConnected, - CircledMinus, - CircledMinusConnected, - Background, - ThreeDots, - ThreeRightArrows - }; - - enum WhitespaceVisibility { - WsInvisible, - WsVisible, - WsVisibleAfterIndent - }; - - enum WrapMode { - WrapNone, - WrapWord, -%If (TQScintilla_1_7 -) - WrapCharacter, -%End - }; - -%If (TQScintilla_1_7 -) - enum WrapVisualFlag { - WrapFlagNone, - WrapFlagByText, - WrapFlagByBorder, - }; -%End - - TQextScintilla(TQWidget * /TransferThis/ = 0,const char * = 0, - WFlags = 0); - - bool autoCompletionCaseSensitivity(); -%If (TQScintilla_1_7 -) - bool autoCompletionFillupsEnabled(); -%End - bool autoCompletionReplaceWord(); - bool autoCompletionShowSingle(); - AutoCompletionSource autoCompletionSource() const; - int autoCompletionThreshold() const; - bool autoIndent() const; - bool backspaceUnindents(); - void beginUndoAction(); - BraceMatch braceMatching() const; - int callTipsVisible() const; -%If (TQScintilla_1_7 -) - void cancelList(); -%End - void clearRegisteredImages(); - void convertEols(EolMode); -%If (TQScintilla_1_3 -) - TQextScintillaDocument document(); -%End - void endUndoAction(); - -%If (TQScintilla_1_4 -) - TQColor edgeColor(); - int edgeColumn(); - EdgeMode edgeMode(); -%End - - EolMode eolMode(); - bool eolVisibility(); - -%If (TQScintilla_1_7 -) - TQColor color() const; - TQColor paper() const; -%End - -%If (TQScintilla_1_6 -) - virtual bool findFirst(const TQString &,bool,bool,bool,bool,bool = 1, - int = -1,int = -1,bool = 1); -%End -%If (- TQScintilla_1_6) - virtual bool findFirst(const TQString &,bool,bool,bool,bool,bool = 1, - int = -1,int = -1); -%End - virtual bool findNext(); - -%If (TQScintilla_1_7 -) - int firstVisibleLine(); -%End - - FoldStyle folding() const; - - void getCursorPosition(int *,int *); - void getSelection(int *,int *,int *,int *); - bool hasSelectedText(); - - int indentation(int); - bool indentationGuides(); - bool indentationsUseTabs(); - int indentationWidth(); - -%If (TQScintilla_1_7 -) - bool isCallTipActive(); - bool isListActive(); -%End - bool isModified(); - bool isReadOnly(); - bool isRedoAvailable(); - bool isUndoAvailable(); - bool isUtf8(); - int lineAt(const TQPoint &); - int lineLength(int); - int lines(); - int length(); -%If (TQScintilla_1_7 -) - TQextScintillaLexer *lexer() const; -%End - - bool marginLineNumbers(int); - int marginMarkerMask(int); - bool marginSensitivity(int); - int marginWidth(int); - - int markerDefine(MarkerSymbol,int = -1); - int markerDefine(char,int = -1); - int markerDefine(const TQPixmap *,int = -1); - int markerAdd(int,int); - unsigned markersAtLine(int); - void markerDelete(int,int = -1); - void markerDeleteAll(int = -1); - void markerDeleteHandle(int); - int markerLine(int); - int markerFindNext(int,unsigned); - int markerFindPrevious(int,unsigned); -%If (TQScintilla_1_3 -) - virtual void recolor(int = 0,int = -1); -%End - void registerImage(int,const TQPixmap *); - virtual void replace(const TQString &); - void resetFoldMarginColors(); - void setFoldMarginColors(const TQColor &,const TQColor &); - - void setAutoCompletionAPIs(TQextScintillaAPIs * = 0); - void setAutoCompletionFillups(const char *); -%If (TQScintilla_1_7 -) - void setAutoCompletionFillupsEnabled(bool); - void setAutoCompletionStartCharacters(const char *); -%End - - void setCallTipsAPIs(TQextScintillaAPIs * = 0); - void setCallTipsBackgroundColor(const TQColor &); - void setCallTipsForegroundColor(const TQColor &); - void setCallTipsHighlightColor(const TQColor &); - void setCallTipsVisible(int); - -%If (TQScintilla_1_3 -) - void setDocument(const TQextScintillaDocument &); -%End - -%If (TQScintilla_1_4 -) - void setEdgeColor(const TQColor &); - void setEdgeColumn(int); - void setEdgeMode(EdgeMode); -%End - -%If (TQScintilla_1_7 -) - virtual void setFont(const TQFont &); -%End - - void setMarkerBackgroundColor(const TQColor &,int = -1); - void setMarkerForegroundColor(const TQColor &,int = -1); - - void setMatchedBraceBackgroundColor(const TQColor &); - void setMatchedBraceForegroundColor(const TQColor &); - void setUnmatchedBraceBackgroundColor(const TQColor &); - void setUnmatchedBraceForegroundColor(const TQColor &); - -%If (TQScintilla_1_7 -) - void setWrapVisualFlags(WrapVisualFlag, - WrapVisualFlag = TQextScintilla::WrapFlagNone, int = 0); -%End - - TQString selectedText(); -%If (TQScintilla_1_7 -) - void showUserList(int, const TQStringList &); -%End - TQextScintillaCommandSet *standardCommands() const; - bool tabIndents(); - int tabWidth(); - TQString text(); - TQString text(int); -%If (TQScintilla_1_7 -) - int textHeight(int); -%End - WhitespaceVisibility whitespaceVisibility(); -%If (TQScintilla_1_4 -) - WrapMode wrapMode(); -%End - -public slots: - virtual void append(const TQString &); -%If (TQScintilla_1_7 -) - virtual void autoCompleteFromAll(); -%End - virtual void autoCompleteFromAPIs(); - virtual void autoCompleteFromDocument(); - virtual void callTip(); - virtual void clear(); - virtual void copy(); - virtual void cut(); - - virtual void ensureCursorVisible(); - virtual void ensureLineVisible(int); -%If (TQScintilla_1_7 -) - virtual void foldAll(bool = 0); -%End -%If (- TQScintilla_1_7) - virtual void foldAll(); -%End - virtual void foldLine(int); - virtual void indent(int); -%If (TQScintilla_1_4 -) - virtual void insert(const TQString &); -%End - virtual void insertAt(const TQString &,int,int); - virtual void moveToMatchingBrace(); - virtual void paste(); - virtual void redo(); - virtual void removeSelectedText(); -%If (TQScintilla_1_4 -) - virtual void resetSelectionBackgroundColor(); - virtual void resetSelectionForegroundColor(); -%End - virtual void selectAll(bool = 1); - virtual void selectToMatchingBrace(); - - virtual void setAutoCompletionCaseSensitivity(bool); - virtual void setAutoCompletionReplaceWord(bool); - virtual void setAutoCompletionShowSingle(bool); - virtual void setAutoCompletionSource(AutoCompletionSource); - virtual void setAutoCompletionThreshold(int); - virtual void setAutoIndent(bool); - virtual void setBraceMatching(BraceMatch); - virtual void setBackspaceUnindents(bool); -%If (TQScintilla_1_3 -) - virtual void setCaretForegroundColor(const TQColor &); - virtual void setCaretLineBackgroundColor(const TQColor &); - virtual void setCaretLineVisible(bool); - virtual void setCaretWidth(int); -%End -%If (TQScintilla_1_7 -) - virtual void setColor(const TQColor &); -%End - virtual void setCursorPosition(int,int); - virtual void setEolMode(EolMode); - virtual void setEolVisibility(bool); - virtual void setFolding(FoldStyle); - - virtual void setIndentation(int,int); - virtual void setIndentationGuides(bool); - virtual void setIndentationGuidesBackgroundColor(const TQColor &); - virtual void setIndentationGuidesForegroundColor(const TQColor &); - virtual void setIndentationsUseTabs(bool); - virtual void setIndentationWidth(int); - - virtual void setLexer(TQextScintillaLexer * = 0); - - virtual void setMarginsBackgroundColor(const TQColor &); - virtual void setMarginsFont(const TQFont &); - virtual void setMarginsForegroundColor(const TQColor &); - - virtual void setMarginLineNumbers(int,bool); - virtual void setMarginMarkerMask(int,int); - virtual void setMarginSensitivity(int,bool); - virtual void setMarginWidth(int,int); - virtual void setMarginWidth(int,const TQString &); - - virtual void setModified(bool); -%If (TQScintilla_1_7 -) - virtual void setPaper(const TQColor &); -%End - virtual void setReadOnly(bool); - virtual void setSelection(int,int,int,int); -%If (TQScintilla_1_3 -) - virtual void setSelectionBackgroundColor(const TQColor &); - virtual void setSelectionForegroundColor(const TQColor &); -%End - virtual void setTabIndents(bool); - virtual void setTabWidth(int); - virtual void setText(const TQString &); - virtual void setUtf8(bool); - virtual void setWhitespaceVisibility(WhitespaceVisibility); -%If (TQScintilla_1_4 -) - virtual void setWrapMode(WrapMode); -%End - - virtual void undo(); - virtual void unindent(int); - - virtual void zoomIn(int); - virtual void zoomIn(); - virtual void zoomOut(int); - virtual void zoomOut(); - virtual void zoomTo(int); - -signals: - void cursorPositionChanged(int,int); - void copyAvailable(bool); - void marginClicked(int,int,TQt::ButtonState); - void modificationAttempted(); - void modificationChanged(bool); - void selectionChanged(); - void textChanged(); -%If (TQScintilla_1_7 -) - void userListActivated(int, const TQString &); -%End - -private: - TQextScintilla(const TQextScintilla &); - -}; diff --git a/sip/qtext/qextscintillaapis.sip b/sip/qtext/qextscintillaapis.sip deleted file mode 100644 index 170a80b..0000000 --- a/sip/qtext/qextscintillaapis.sip +++ /dev/null @@ -1,42 +0,0 @@ -// This is the SIP interface definition for TQextScintillaAPIs. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -class TQextScintillaAPIs -{ -%TypeHeaderCode -#include -%End - -public: - TQextScintillaAPIs(); - - void add(const TQString &); - bool load(const TQString &); - void clear(); - -private: - TQextScintillaAPIs(const TQextScintillaAPIs &); -}; diff --git a/sip/qtext/qextscintillabase.sip b/sip/qtext/qextscintillabase.sip deleted file mode 100644 index 23a2a65..0000000 --- a/sip/qtext/qextscintillabase.sip +++ /dev/null @@ -1,1024 +0,0 @@ -// This is the SIP interface definition for TQextScintillaBase. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -class TQextScintillaBase : TQWidget -{ -%TypeHeaderCode -#include -%End - -public: - enum { - SCI_START, - SCI_OPTIONAL_START, - SCI_LEXER_START, - SCI_ADDTEXT, - SCI_ADDSTYLEDTEXT, - SCI_INSERTTEXT, - SCI_CLEARALL, - SCI_CLEARDOCUMENTSTYLE, - SCI_GETLENGTH, - SCI_GETCHARAT, - SCI_GETCURRENTPOS, - SCI_GETANCHOR, - SCI_GETSTYLEAT, - SCI_REDO, - SCI_SETUNDOCOLLECTION, - SCI_SELECTALL, - SCI_SETSAVEPOINT, - SCI_GETSTYLEDTEXT, - SCI_CANREDO, - SCI_MARKERLINEFROMHANDLE, - SCI_MARKERDELETEHANDLE, - SCI_GETUNDOCOLLECTION, - SCI_GETVIEWWS, - SCI_SETVIEWWS, - SCI_POSITIONFROMPOINT, - SCI_POSITIONFROMPOINTCLOSE, - SCI_GOTOLINE, - SCI_GOTOPOS, - SCI_SETANCHOR, - SCI_GETCURLINE, - SCI_GETENDSTYLED, - SCI_CONVERTEOLS, - SCI_GETEOLMODE, - SCI_SETEOLMODE, - SCI_STARTSTYLING, - SCI_SETSTYLING, - SCI_GETBUFFEREDDRAW, - SCI_SETBUFFEREDDRAW, - SCI_SETTABWIDTH, - SCI_GETTABWIDTH, - SCI_SETCODEPAGE, - SCI_SETUSEPALETTE, - SCI_MARKERDEFINE, - SCI_MARKERSETFORE, - SCI_MARKERSETBACK, - SCI_MARKERADD, - SCI_MARKERDELETE, - SCI_MARKERDELETEALL, - SCI_MARKERGET, - SCI_MARKERNEXT, - SCI_MARKERPREVIOUS, - SCI_MARKERDEFINEPIXMAP, - SCI_SETMARGINTYPEN, - SCI_GETMARGINTYPEN, - SCI_SETMARGINWIDTHN, - SCI_GETMARGINWIDTHN, - SCI_SETMARGINMASKN, - SCI_GETMARGINMASKN, - SCI_SETMARGINSENSITIVEN, - SCI_GETMARGINSENSITIVEN, - SCI_STYLECLEARALL, - SCI_STYLESETFORE, - SCI_STYLESETBACK, - SCI_STYLESETBOLD, - SCI_STYLESETITALIC, - SCI_STYLESETSIZE, - SCI_STYLESETFONT, - SCI_STYLESETEOLFILLED, - SCI_STYLERESETDEFAULT, - SCI_STYLESETUNDERLINE, - SCI_STYLESETCASE, - SCI_STYLESETCHARACTERSET, - SCI_SETSELFORE, - SCI_SETSELBACK, - SCI_SETCARETFORE, - SCI_ASSIGNCMDKEY, - SCI_CLEARCMDKEY, - SCI_CLEARALLCMDKEYS, - SCI_SETSTYLINGEX, - SCI_STYLESETVISIBLE, - SCI_GETCARETPERIOD, - SCI_SETCARETPERIOD, - SCI_SETWORDCHARS, - SCI_BEGINUNDOACTION, - SCI_ENDUNDOACTION, - SCI_INDICSETSTYLE, - SCI_INDICGETSTYLE, - SCI_INDICSETFORE, - SCI_INDICGETFORE, - SCI_SETWHITESPACEFORE, - SCI_SETWHITESPACEBACK, - SCI_SETSTYLEBITS, - SCI_GETSTYLEBITS, - SCI_SETLINESTATE, - SCI_GETLINESTATE, - SCI_GETMAXLINESTATE, - SCI_GETCARETLINEVISIBLE, - SCI_SETCARETLINEVISIBLE, - SCI_GETCARETLINEBACK, - SCI_SETCARETLINEBACK, - SCI_STYLESETCHANGEABLE, - SCI_AUTOCSHOW, - SCI_AUTOCCANCEL, - SCI_AUTOCACTIVE, - SCI_AUTOCPOSSTART, - SCI_AUTOCCOMPLETE, - SCI_AUTOCSTOPS, - SCI_AUTOCSETSEPARATOR, - SCI_AUTOCGETSEPARATOR, - SCI_AUTOCSELECT, - SCI_AUTOCSETCANCELATSTART, - SCI_AUTOCGETCANCELATSTART, - SCI_AUTOCSETFILLUPS, - SCI_AUTOCSETCHOOSESINGLE, - SCI_AUTOCGETCHOOSESINGLE, - SCI_AUTOCSETIGNORECASE, - SCI_AUTOCGETIGNORECASE, - SCI_USERLISTSHOW, - SCI_AUTOCSETAUTOHIDE, - SCI_AUTOCGETAUTOHIDE, - SCI_AUTOCSETDROPRESTOFWORD, - SCI_AUTOCGETDROPRESTOFWORD, - SCI_SETINDENT, - SCI_GETINDENT, - SCI_SETUSETABS, - SCI_GETUSETABS, - SCI_SETLINEINDENTATION, - SCI_GETLINEINDENTATION, - SCI_GETLINEINDENTPOSITION, - SCI_GETCOLUMN, - SCI_SETHSCROLLBAR, - SCI_GETHSCROLLBAR, - SCI_SETINDENTATIONGUIDES, - SCI_GETINDENTATIONGUIDES, - SCI_SETHIGHLIGHTGUIDE, - SCI_GETHIGHLIGHTGUIDE, - SCI_GETLINEENDPOSITION, - SCI_GETCODEPAGE, - SCI_GETCARETFORE, - SCI_GETUSEPALETTE, - SCI_GETREADONLY, - SCI_SETCURRENTPOS, - SCI_SETSELECTIONSTART, - SCI_GETSELECTIONSTART, - SCI_SETSELECTIONEND, - SCI_GETSELECTIONEND, - SCI_SETPRINTMAGNIFICATION, - SCI_GETPRINTMAGNIFICATION, - SCI_SETPRINTCOLOURMODE, - SCI_GETPRINTCOLOURMODE, - SCI_FINDTEXT, - SCI_FORMATRANGE, - SCI_GETFIRSTVISIBLELINE, - SCI_GETLINE, - SCI_GETLINECOUNT, - SCI_SETMARGINLEFT, - SCI_GETMARGINLEFT, - SCI_SETMARGINRIGHT, - SCI_GETMARGINRIGHT, - SCI_GETMODIFY, - SCI_SETSEL, - SCI_GETSELTEXT, - SCI_GETTEXTRANGE, - SCI_HIDESELECTION, - SCI_POINTXFROMPOSITION, - SCI_POINTYFROMPOSITION, - SCI_LINEFROMPOSITION, - SCI_POSITIONFROMLINE, - SCI_LINESCROLL, - SCI_SCROLLCARET, - SCI_REPLACESEL, - SCI_SETREADONLY, - SCI_NULL, - SCI_CANPASTE, - SCI_CANUNDO, - SCI_EMPTYUNDOBUFFER, - SCI_UNDO, - SCI_CUT, - SCI_COPY, - SCI_PASTE, - SCI_CLEAR, - SCI_SETTEXT, - SCI_GETTEXT, - SCI_GETTEXTLENGTH, - SCI_GETDIRECTFUNCTION, - SCI_GETDIRECTPOINTER, - SCI_SETOVERTYPE, - SCI_GETOVERTYPE, - SCI_SETCARETWIDTH, - SCI_GETCARETWIDTH, - SCI_SETTARGETSTART, - SCI_GETTARGETSTART, - SCI_SETTARGETEND, - SCI_GETTARGETEND, - SCI_REPLACETARGET, - SCI_REPLACETARGETRE, - SCI_SEARCHINTARGET, - SCI_SETSEARCHFLAGS, - SCI_GETSEARCHFLAGS, - SCI_CALLTIPSHOW, - SCI_CALLTIPCANCEL, - SCI_CALLTIPACTIVE, - SCI_CALLTIPPOSSTART, - SCI_CALLTIPSETHLT, - SCI_CALLTIPSETBACK, - SCI_CALLTIPSETFORE, - SCI_CALLTIPSETFOREHLT, -%If (TQScintilla_1_6 -) - SCI_AUTOCSETMAXWIDTH, - SCI_AUTOCGETMAXWIDTH, - SCI_AUTOCSETMAXHEIGHT, - SCI_AUTOCGETMAXHEIGHT, -%End -%If (TQScintilla_1_7 -) - SCI_CALLTIPUSESTYLE, -%End - SCI_VISIBLEFROMDOCLINE, - SCI_DOCLINEFROMVISIBLE, - SCI_SETFOLDLEVEL, - SCI_GETFOLDLEVEL, - SCI_GETLASTCHILD, - SCI_GETFOLDPARENT, - SCI_SHOWLINES, - SCI_HIDELINES, - SCI_GETLINEVISIBLE, - SCI_SETFOLDEXPANDED, - SCI_GETFOLDEXPANDED, - SCI_TOGGLEFOLD, - SCI_ENSUREVISIBLE, - SCI_SETFOLDFLAGS, - SCI_ENSUREVISIBLEENFORCEPOLICY, -%If (TQScintilla_1_6 -) - SCI_WRAPCOUNT, -%End - SCI_SETTABINDENTS, - SCI_GETTABINDENTS, - SCI_SETBACKSPACEUNINDENTS, - SCI_GETBACKSPACEUNINDENTS, - SCI_SETMOUSEDWELLTIME, - SCI_GETMOUSEDWELLTIME, - SCI_WORDSTARTPOSITION, - SCI_WORDENDPOSITION, - SCI_SETWRAPMODE, - SCI_GETWRAPMODE, - SCI_SETLAYOUTCACHE, - SCI_GETLAYOUTCACHE, - SCI_SETSCROLLWIDTH, - SCI_GETSCROLLWIDTH, - SCI_TEXTWIDTH, - SCI_SETENDATLASTLINE, - SCI_GETENDATLASTLINE, - SCI_TEXTHEIGHT, - SCI_SETVSCROLLBAR, - SCI_GETVSCROLLBAR, - SCI_APPENDTEXT, - SCI_GETTWOPHASEDRAW, - SCI_SETTWOPHASEDRAW, - SCI_AUTOCGETTYPESEPARATOR, - SCI_AUTOCSETTYPESEPARATOR, - SCI_TARGETFROMSELECTION, - SCI_LINESJOIN, - SCI_LINESSPLIT, - SCI_SETFOLDMARGINCOLOUR, - SCI_SETFOLDMARGINHICOLOUR, - SCI_LINEDOWN, - SCI_LINEDOWNEXTEND, - SCI_LINEUP, - SCI_LINEUPEXTEND, - SCI_CHARLEFT, - SCI_CHARLEFTEXTEND, - SCI_CHARRIGHT, - SCI_CHARRIGHTEXTEND, - SCI_WORDLEFT, - SCI_WORDLEFTEXTEND, - SCI_WORDRIGHT, - SCI_WORDRIGHTEXTEND, - SCI_HOME, - SCI_HOMEEXTEND, - SCI_LINEEND, - SCI_LINEENDEXTEND, - SCI_DOCUMENTSTART, - SCI_DOCUMENTSTARTEXTEND, - SCI_DOCUMENTEND, - SCI_DOCUMENTENDEXTEND, - SCI_PAGEUP, - SCI_PAGEUPEXTEND, - SCI_PAGEDOWN, - SCI_PAGEDOWNEXTEND, - SCI_EDITTOGGLEOVERTYPE, - SCI_CANCEL, - SCI_DELETEBACK, - SCI_TAB, - SCI_BACKTAB, - SCI_NEWLINE, - SCI_FORMFEED, - SCI_VCHOME, - SCI_VCHOMEEXTEND, - SCI_ZOOMIN, - SCI_ZOOMOUT, - SCI_DELWORDLEFT, - SCI_DELWORDRIGHT, - SCI_LINECUT, - SCI_LINEDELETE, - SCI_LINETRANSPOSE, - SCI_LOWERCASE, - SCI_UPPERCASE, - SCI_LINESCROLLDOWN, - SCI_LINESCROLLUP, - SCI_DELETEBACKNOTLINE, - SCI_HOMEDISPLAY, - SCI_HOMEDISPLAYEXTEND, - SCI_LINEENDDISPLAY, - SCI_LINEENDDISPLAYEXTEND, - SCI_MOVECARETINSIDEVIEW, - SCI_LINELENGTH, - SCI_BRACEHIGHLIGHT, - SCI_BRACEBADLIGHT, - SCI_BRACEMATCH, - SCI_GETVIEWEOL, - SCI_SETVIEWEOL, - SCI_GETDOCPOINTER, - SCI_SETDOCPOINTER, - SCI_SETMODEVENTMASK, - SCI_GETEDGECOLUMN, - SCI_SETEDGECOLUMN, - SCI_GETEDGEMODE, - SCI_SETEDGEMODE, - SCI_GETEDGECOLOUR, - SCI_SETEDGECOLOUR, - SCI_SEARCHANCHOR, - SCI_SEARCHNEXT, - SCI_SEARCHPREV, - SCI_LINESONSCREEN, - SCI_USEPOPUP, - SCI_SELECTIONISRECTANGLE, - SCI_SETZOOM, - SCI_GETZOOM, - SCI_CREATEDOCUMENT, - SCI_ADDREFDOCUMENT, - SCI_RELEASEDOCUMENT, - SCI_GETMODEVENTMASK, - SCI_SETFOCUS, - SCI_GETFOCUS, - SCI_SETSTATUS, - SCI_GETSTATUS, - SCI_SETMOUSEDOWNCAPTURES, - SCI_GETMOUSEDOWNCAPTURES, - SCI_SETCURSOR, - SCI_GETCURSOR, - SCI_SETCONTROLCHARSYMBOL, - SCI_GETCONTROLCHARSYMBOL, - SCI_WORDPARTLEFT, - SCI_WORDPARTLEFTEXTEND, - SCI_WORDPARTRIGHT, - SCI_WORDPARTRIGHTEXTEND, - SCI_SETVISIBLEPOLICY, - SCI_DELLINELEFT, - SCI_DELLINERIGHT, - SCI_SETXOFFSET, - SCI_GETXOFFSET, - SCI_CHOOSECARETX, - SCI_GRABFOCUS, - SCI_SETXCARETPOLICY, - SCI_SETYCARETPOLICY, - SCI_LINEDUPLICATE, - SCI_REGISTERIMAGE, - SCI_SETPRINTWRAPMODE, - SCI_GETPRINTWRAPMODE, - SCI_CLEARREGISTEREDIMAGES, - SCI_STYLESETHOTSPOT, - SCI_SETHOTSPOTACTIVEFORE, - SCI_SETHOTSPOTACTIVEBACK, - SCI_SETHOTSPOTACTIVEUNDERLINE, - SCI_PARADOWN, - SCI_PARADOWNEXTEND, - SCI_PARAUP, - SCI_PARAUPEXTEND, -%If (TQScintilla_1_1 -) - SCI_POSITIONBEFORE, - SCI_POSITIONAFTER, - SCI_COPYRANGE, - SCI_COPYTEXT, -%End -%If (TQScintilla_1_3 -) - SCI_SETSELECTIONMODE, - SCI_GETSELECTIONMODE, - SCI_GETLINESELSTARTPOSITION, - SCI_GETLINESELENDPOSITION, - SCI_LINEDOWNRECTEXTEND, - SCI_LINEUPRECTEXTEND, - SCI_CHARLEFTRECTEXTEND, - SCI_CHARRIGHTRECTEXTEND, - SCI_HOMERECTEXTEND, - SCI_VCHOMERECTEXTEND, - SCI_LINEENDRECTEXTEND, - SCI_PAGEUPRECTEXTEND, - SCI_PAGEDOWNRECTEXTEND, - SCI_STUTTEREDPAGEUP, - SCI_STUTTEREDPAGEUPEXTEND, - SCI_STUTTEREDPAGEDOWN, - SCI_STUTTEREDPAGEDOWNEXTEND, - SCI_WORDLEFTEND, - SCI_WORDLEFTENDEXTEND, - SCI_WORDRIGHTEND, - SCI_WORDRIGHTENDEXTEND, - SCI_SETWHITESPACECHARS, - SCI_SETCHARSDEFAULT, - SCI_AUTOCGETCURRENT, - SCI_ALLOCATE, -%End - SCI_HOMEWRAP, - SCI_HOMEWRAPEXTEND, - SCI_LINEENDWRAP, - SCI_LINEENDWRAPEXTEND, - SCI_VCHOMEWRAP, - SCI_VCHOMEWRAPEXTEND, -%If (TQScintilla_1_1 -) - SCI_LINECOPY, -%End -%If (TQScintilla_1_6 -) - SCI_FINDCOLUMN, - SCI_GETCARETSTICKY, - SCI_SETCARETSTICKY, - SCI_TOGGLECARETSTICKY, -%End -%If (TQScintilla_1_3 -) - SCI_SETWRAPVISUALFLAGS, - SCI_GETWRAPVISUALFLAGS, - SCI_SETWRAPVISUALFLAGSLOCATION, - SCI_GETWRAPVISUALFLAGSLOCATION, - SCI_SETWRAPSTARTINDENT, - SCI_GETWRAPSTARTINDENT, -%End -%If (TQScintilla_1_7 -) - SCI_MARKERADDSET, - SCI_SETPASTECONVERTENDINGS - SCI_GETPASTECONVERTENDINGS - SCI_SELECTIONDUPLICATE - SCI_SETCARETLINEBACKALPHA - SCI_GETCARETLINEBACKALPHA - SCI_MARKERSETALPHA, - SCI_GETSELALPHA, - SCI_SETSELALPHA, -%End - SCI_STARTRECORD, - SCI_STOPRECORD, - SCI_SETLEXER, - SCI_GETLEXER, - SCI_COLOURISE, - SCI_SETPROPERTY, - SCI_SETKEYWORDS, - SCI_SETLEXERLANGUAGE, -%If (TQScintilla_1_6 -) - SCI_LOADLEXERLIBRARY, - SCI_GETPROPERTY, - SCI_GETPROPERTYEXPANDED, - SCI_GETPROPERTYINT, -%End -%If (TQScintilla_1_7 -) - SCI_GETSTYLEBITSNEEDED, -%End - }; - -%If (TQScintilla_1_7 -) - enum - { - SC_ALPHA_TRANSPARENT, - SC_ALPHA_OPAQUE, - SC_ALPHA_NOALPHA, - }; -%End - -%If (TQScintilla_1_3 -) - enum - { - SC_WRAPVISUALFLAG_NONE, - SC_WRAPVISUALFLAG_END, - SC_WRAPVISUALFLAG_START - }; - - enum - { - SC_WRAPVISUALFLAGLOC_DEFAULT, - SC_WRAPVISUALFLAGLOC_END_BY_TEXT, - SC_WRAPVISUALFLAGLOC_START_BY_TEXT - }; - - enum { - SC_SEL_STREAM, - SC_SEL_RECTANGLE, - SC_SEL_LINES - }; -%End - - enum { - SCWS_INVISIBLE, - SCWS_VISIBLEALWAYS, - SCWS_VISIBLEAFTERINDENT - }; - - enum { - SC_EOL_CRLF, - SC_EOL_CR, - SC_EOL_LF - }; - - enum { - SC_CP_DBCS, - SC_CP_UTF8 - }; - - enum { - SC_MARK_CIRCLE, - SC_MARK_ROUNDRECT, - SC_MARK_ARROW, - SC_MARK_SMALLRECT, - SC_MARK_SHORTARROW, - SC_MARK_EMPTY, - SC_MARK_ARROWDOWN, - SC_MARK_MINUS, - SC_MARK_PLUS, - SC_MARK_VLINE, - SC_MARK_LCORNER, - SC_MARK_TCORNER, - SC_MARK_BOXPLUS, - SC_MARK_BOXPLUSCONNECTED, - SC_MARK_BOXMINUS, - SC_MARK_BOXMINUSCONNECTED, - SC_MARK_LCORNERCURVE, - SC_MARK_TCORNERCURVE, - SC_MARK_CIRCLEPLUS, - SC_MARK_CIRCLEPLUSCONNECTED, - SC_MARK_CIRCLEMINUS, - SC_MARK_CIRCLEMINUSCONNECTED, - SC_MARK_BACKGROUND, - SC_MARK_DOTDOTDOT, - SC_MARK_ARROWS, - SC_MARK_PIXMAP, -%If (TQScintilla_1_6 -) - SC_MARK_FULLRECT, -%End - SC_MARK_CHARACTER - }; - - enum { - SC_MARKNUM_FOLDEREND, - SC_MARKNUM_FOLDEROPENMID, - SC_MARKNUM_FOLDERMIDTAIL, - SC_MARKNUM_FOLDERTAIL, - SC_MARKNUM_FOLDERSUB, - SC_MARKNUM_FOLDER, - SC_MARKNUM_FOLDEROPEN, - SC_MASK_FOLDERS - }; - - enum { - SC_MARGIN_SYMBOL, - SC_MARGIN_NUMBER, -%If (TQScintilla_1_7 -) - SC_MARGIN_BACK, - SC_MARGIN_FORE, -%End - }; - - enum { - STYLE_DEFAULT, - STYLE_LINENUMBER, - STYLE_BRACELIGHT, - STYLE_BRACEBAD, - STYLE_CONTROLCHAR, - STYLE_INDENTGUIDE, -%If (TQScintilla_1_7 -) - STYLE_CALLTIP, -%End - STYLE_LASTPREDEFINED, -%If (TQScintilla_1_3 -) - STYLE_MAX -%End - }; - - enum { - SC_CHARSET_ANSI, - SC_CHARSET_DEFAULT, - SC_CHARSET_BALTIC, - SC_CHARSET_CHINESEBIG5, - SC_CHARSET_EASTEUROPE, - SC_CHARSET_GB2312, - SC_CHARSET_GREEK, - SC_CHARSET_HANGUL, - SC_CHARSET_MAC, - SC_CHARSET_OEM, - SC_CHARSET_RUSSIAN, - SC_CHARSET_SHIFTJIS, - SC_CHARSET_SYMBOL, - SC_CHARSET_TURKISH, - SC_CHARSET_JOHAB, - SC_CHARSET_HEBREW, - SC_CHARSET_ARABIC, - SC_CHARSET_VIETNAMESE, - SC_CHARSET_THAI, -%If (TQScintilla_1_6 -) - SC_CHARSET_8859_15, -%End - }; - - enum { - SC_CASE_MIXED, - SC_CASE_UPPER, - SC_CASE_LOWER - }; - - enum { - INDIC_MAX, - INDIC_PLAIN, - INDIC_SQUIGGLE, - INDIC_TT, - INDIC_DIAGONAL, - INDIC_STRIKE, -%If (TQScintilla_1_2 -) - INDIC_HIDDEN, -%End -%If (TQScintilla_1_3 -) - INDIC_BOX, -%End -%If (TQScintilla_1_7 -) - INDIC_ROUNDBOX, -%End - INDIC0_MASK, - INDIC1_MASK, - INDIC2_MASK, - INDICS_MASK - }; - - enum { - SC_PRINT_NORMAL, - SC_PRINT_INVERTLIGHT, - SC_PRINT_BLACKONWHITE, - SC_PRINT_COLOURONWHITE, - SC_PRINT_COLOURONWHITEDEFAULTBG - }; - - enum { - SCFIND_WHOLEWORD, - SCFIND_MATCHCASE, - SCFIND_WORDSTART, - SCFIND_REGEXP, - SCFIND_POSIX - }; - - enum { - SC_FOLDLEVELBASE, - SC_FOLDLEVELWHITEFLAG, - SC_FOLDLEVELHEADERFLAG, - SC_FOLDLEVELBOXHEADERFLAG, - SC_FOLDLEVELBOXFOOTERFLAG, - SC_FOLDLEVELCONTRACTED, - SC_FOLDLEVELUNINDENT, - SC_FOLDLEVELNUMBERMASK - }; - - enum - { - SC_FOLDFLAG_BOX, - SC_FOLDFLAG_LINEBEFORE_EXPANDED, - SC_FOLDFLAG_LINEBEFORE_CONTRACTED, - SC_FOLDFLAG_LINEAFTER_EXPANDED, - SC_FOLDFLAG_LINEAFTER_CONTRACTED, - SC_FOLDFLAG_LEVELNUMBERS - }; - - enum { - SC_TIME_FOREVER - }; - - enum { - SC_WRAP_NONE, - SC_WRAP_WORD, -%If (TQScintilla_1_6 -) - SC_WRAP_CHAR, -%End - }; - - enum { - SC_CACHE_NONE, - SC_CACHE_CARET, - SC_CACHE_PAGE, - SC_CACHE_DOCUMENT - }; - - enum { - EDGE_NONE, - EDGE_LINE, - EDGE_BACKGROUND - }; - - enum { - SC_CURSORNORMAL, - SC_CURSORWAIT - }; - - enum { - VISIBLE_SLOP, - VISIBLE_STRICT - }; - - enum { - CARET_SLOP, - CARET_STRICT, - CARET_JUMPS, - CARET_EVEN - }; - - enum { - SC_MOD_INSERTTEXT, - SC_MOD_DELETETEXT, - SC_MOD_CHANGESTYLE, - SC_MOD_CHANGEFOLD, - SC_PERFORMED_USER, - SC_PERFORMED_UNDO, - SC_PERFORMED_REDO, -%If (TQScintilla_1_6 -) - SC_MULTISTEPUNDOREDO, -%End - SC_LASTSTEPINUNDOREDO, - SC_MOD_CHANGEMARKER, - SC_MOD_BEFOREINSERT, - SC_MOD_BEFOREDELETE, -%If (TQScintilla_1_6 -) - SC_MULTILINEUNDOREDO, -%End - SC_MODEVENTMASKALL - }; - - enum { - SCK_DOWN, - SCK_UP, - SCK_LEFT, - SCK_RIGHT, - SCK_HOME, - SCK_END, - SCK_PRIOR, - SCK_NEXT, - SCK_DELETE, - SCK_INSERT, - SCK_ESCAPE, - SCK_BACK, - SCK_TAB, - SCK_RETURN, - SCK_ADD, - SCK_SUBTRACT, - SCK_DIVIDE - }; - - enum { -%If (TQScintilla_1_7 -) - SCMOD_NORM, -%End - SCMOD_SHIFT, - SCMOD_CTRL, - SCMOD_ALT - }; - - enum { - SCLEX_CONTAINER, - SCLEX_NULL, - SCLEX_PYTHON, - SCLEX_CPP, - SCLEX_HTML, - SCLEX_XML, - SCLEX_PERL, - SCLEX_SQL, - SCLEX_VB, - SCLEX_PROPERTIES, - SCLEX_ERRORLIST, - SCLEX_MAKEFILE, - SCLEX_BATCH, - SCLEX_LATEX, - SCLEX_LUA, - SCLEX_DIFF, - SCLEX_CONF, - SCLEX_PASCAL, - SCLEX_AVE, - SCLEX_ADA, - SCLEX_LISP, - SCLEX_RUBY, - SCLEX_EIFFEL, - SCLEX_EIFFELKW, - SCLEX_TCL, - SCLEX_NNCRONTAB, - SCLEX_BULLANT, - SCLEX_VBSCRIPT, - SCLEX_ASP, - SCLEX_PHP, - SCLEX_BAAN, - SCLEX_MATLAB, -%If (TQScintilla_1_2 -) - SCLEX_SCRIPTOL, -%End - SCLEX_ASM, - SCLEX_CPPNOCASE, - SCLEX_FORTRAN, - SCLEX_F77, - SCLEX_CSS, - SCLEX_POV, -%If (TQScintilla_1_1 -) - SCLEX_LOUT, - SCLEX_ESCRIPT, -%End -%If (TQScintilla_1_2 -) - SCLEX_PS, - SCLEX_NSIS, - SCLEX_MMIXAL, -%End -%If (TQScintilla_1_3 -) - SCLEX_CLW, - SCLEX_CLWNOCASE, - SCLEX_LOT, - SCLEX_YAML, - SCLEX_TEX, - SCLEX_METAPOST, - SCLEX_POWERBASIC, - SCLEX_FORTH, - SCLEX_ERLANG, - SCLEX_OCTAVE, - SCLEX_MSSQL, - SCLEX_VERILOG, - SCLEX_KIX, - SCLEX_GUI4CLI, - SCLEX_SPECMAN, - SCLEX_AU3, - SCLEX_APDL, - SCLEX_BASH, -%End -%If (TQScintilla_1_5 -) - SCLEX_ASN1, - SCLEX_VHDL, -%End -%If (TQScintilla_1_6 -) - SCLEX_CAML, - SCLEX_BLITZBASIC, - SCLEX_PUREBASIC, - SCLEX_HASKELL, - SCLEX_PHPSCRIPT, - SCLEX_TADS3, - SCLEX_REBOL, - SCLEX_SMALLTALK, - SCLEX_FLAGSHIP, - SCLEX_CSOUND, -%End -%If (TQScintilla_1_7 -) - SCLEX_FREEBASIC, - SCLEX_INNOSETUP, - SCLEX_OPAL, - SCLEX_SPICE, -%End - }; - - TQextScintillaBase(TQWidget * /TransferThis/,const char *, - WFlags = 0); - -%ConvertToSubClassCode - static struct class_graph { - const char *name; - sipWrapperType **type; - int yes, no; - } graph[] = { - {sipName_TQextScintillaLexer, &sipClass_TQextScintillaLexer, 3, 1}, - {sipName_TQextScintillaBase, &sipClass_TQextScintillaBase, 15, 2}, - {sipName_TQextScintillaMacro, &sipClass_TQextScintillaMacro, -1, -1}, -#if TQSCINTILLA_VERSION >= 0x010300 - {sipName_TQextScintillaLexerPerl, &sipClass_TQextScintillaLexerPerl, -1, 4}, -#else - {NULL, NULL, -1, 4}, -#endif -#if TQSCINTILLA_VERSION >= 0x010100 - {sipName_TQextScintillaLexerHTML, &sipClass_TQextScintillaLexerHTML, -1, 5}, -#else - {NULL, NULL, -1, 5}, -#endif -#if TQSCINTILLA_VERSION >= 0x010500 - {sipName_TQextScintillaLexerRuby, &sipClass_TQextScintillaLexerRuby, -1, 6}, -#else - {NULL, NULL, -1, 6}, -#endif - {sipName_TQextScintillaLexerCPP, &sipClass_TQextScintillaLexerCPP, 11, 7}, - {sipName_TQextScintillaLexerPython, &sipClass_TQextScintillaLexerPython, -1, 8}, -#if TQSCINTILLA_VERSION >= 0x010100 - {sipName_TQextScintillaLexerSQL, &sipClass_TQextScintillaLexerSQL, -1, 9}, -#else - {NULL, NULL, -1, 9}, -#endif -#if TQSCINTILLA_VERSION >= 0x010400 - {sipName_TQextScintillaLexerBash, &sipClass_TQextScintillaLexerBash, -1, 10}, -#else - {NULL, NULL, -1, 10}, -#endif -#if TQSCINTILLA_VERSION >= 0x010500 - {sipName_TQextScintillaLexerLua, &sipClass_TQextScintillaLexerLua, -1, -1}, -#else - {NULL, NULL, -1, -1}, -#endif - {sipName_TQextScintillaLexerIDL, &sipClass_TQextScintillaLexerIDL, -1, 12}, - {sipName_TQextScintillaLexerJavaScript, &sipClass_TQextScintillaLexerJavaScript, -1, 13}, - {sipName_TQextScintillaLexerCSharp, &sipClass_TQextScintillaLexerCSharp, -1, 14}, - {sipName_TQextScintillaLexerJava, &sipClass_TQextScintillaLexerJava, -1, -1}, - {sipName_TQextScintilla, &sipClass_TQextScintilla, -1, -1}, - }; - - 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 - -%If (TQScintilla_1_3 -) - TQextScintillaBase *pool(); -%End - - long SendScintilla(unsigned int,unsigned long = 0,long = 0); - long SendScintilla(unsigned int,unsigned long,const char *); - long SendScintilla(unsigned int,const char *); - long SendScintilla(unsigned int,const char *,const char *); - long SendScintilla(unsigned int,long); - //long SendScintilla(unsigned int,int); - long SendScintilla(unsigned int,long,long,char *); - long SendScintilla(unsigned int,unsigned long,const TQColor &); - long SendScintilla(unsigned int,const TQColor &); - long SendScintilla(unsigned int,unsigned long,TQPainter *,const TQRect &, - long,long); - long SendScintilla(unsigned int,unsigned long,const TQPixmap *); - - virtual TQSize sizeHint() const; -%If (TQScintilla_1_5 -) - TQWidget *viewport() const; -%End - -signals: - void TQSCN_SELCHANGED(bool); - - void SCEN_CHANGE(); - -%If (TQScintilla_1_6 -) - void SCN_AUTOCSELECTION(const char *,int); -%End - void SCN_CHARADDED(int); - void SCN_CALLTIPCLICK(int); - void SCN_DOUBLECLICK(); - void SCN_DWELLEND(int,int,int); - void SCN_DWELLSTART(int,int,int); - void SCN_HOTSPOTCLICK(int,int); - void SCN_HOTSPOTDOUBLECLICK(int,int); - void SCN_MACRORECORD(unsigned int,unsigned long,long); - void SCN_MARGINCLICK(int,int,int); - void SCN_MODIFIED(int,int,const char *,int,int,int,int,int); - void SCN_MODIFYATTEMPTRO(); - void SCN_NEEDSHOWN(int,int); - void SCN_PAINTED(); - void SCN_SAVEPOINTLEFT(); - void SCN_SAVEPOINTREACHED(); - void SCN_STYLENEEDED(int); - void SCN_UPDATEUI(); - void SCN_USERLISTSELECTION(const char *,int); - void SCN_ZOOM(); - -protected: - bool eventFilter(TQObject *,TQEvent *); - virtual void keyPressEvent(TQKeyEvent *); - virtual void focusInEvent(TQFocusEvent *); - virtual void focusOutEvent(TQFocusEvent *); - virtual bool focusNextPrevChild(bool); -%If (TQScintilla_1_5 -) - virtual void startDrag(); -%End - -private: - TQextScintillaBase(const TQextScintillaBase &); -}; diff --git a/sip/qtext/qextscintillacommand.sip b/sip/qtext/qextscintillacommand.sip deleted file mode 100644 index 77dfb56..0000000 --- a/sip/qtext/qextscintillacommand.sip +++ /dev/null @@ -1,44 +0,0 @@ -// This is the SIP interface definition for TQextScintillaCommand. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -class TQextScintillaCommand -{ -%TypeHeaderCode -#include -%End - -public: - void setKey(int); - void setAlternateKey(int); - int key() const; - int alternateKey() const; - static bool validKey(int); - TQString description() const; - -private: - TQextScintillaCommand(TQextScintilla *,int,int,const char *); - TQextScintillaCommand(const TQextScintillaCommand &); -}; diff --git a/sip/qtext/qextscintillacommandset.sip b/sip/qtext/qextscintillacommandset.sip deleted file mode 100644 index b472345..0000000 --- a/sip/qtext/qextscintillacommandset.sip +++ /dev/null @@ -1,52 +0,0 @@ -// This is the SIP interface definition for the TQextScintillaCommandSet. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -class TQextScintillaCommandSet -{ -%TypeHeaderCode -#include -%End - -public: - bool readSettings(TQSettings &,const char * = "/Scintilla"); - bool writeSettings(TQSettings &,const char * = "/Scintilla"); - -%If (TQScintilla_1_4 -) - TQPtrList &commands(); -%End -%If (- TQScintilla_1_4) - const TQPtrList &commands() const; -%End - -%If (TQScintilla_1_4 -) - void clearKeys(); - void clearAlternateKeys(); -%End - -private: - TQextScintillaCommandSet(TQextScintilla *); - TQextScintillaCommandSet(const TQextScintillaCommandSet &); -}; diff --git a/sip/qtext/qextscintilladocument.sip b/sip/qtext/qextscintilladocument.sip deleted file mode 100644 index 9c656b8..0000000 --- a/sip/qtext/qextscintilladocument.sip +++ /dev/null @@ -1,42 +0,0 @@ -// This is the SIP interface definition for TQextScintillaDocument. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (TQScintilla_1_3 -) - -class TQextScintillaDocument -{ -%TypeHeaderCode -#include -%End - -public: - TQextScintillaDocument(); - virtual ~TQextScintillaDocument(); - - TQextScintillaDocument(const TQextScintillaDocument &); -}; - -%End diff --git a/sip/qtext/qextscintillalexer.sip b/sip/qtext/qextscintillalexer.sip deleted file mode 100644 index b13b14d..0000000 --- a/sip/qtext/qextscintillalexer.sip +++ /dev/null @@ -1,80 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexer. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -class TQextScintillaLexer : TQObject -{ -%TypeHeaderCode -#include -%End - -public: - TQextScintillaLexer(TQObject * /TransferThis/ = 0,const char * = 0); - - virtual const char *language() const = 0; - virtual const char *lexer() const = 0; - int autoIndentStyle(); - virtual TQColor color(int) const; - virtual bool eolFill(int) const; - virtual TQFont font(int) const; - virtual const char *keywords(int) const; - virtual TQString description(int) const = 0; - virtual TQColor paper(int) const; - virtual TQFont defaultFont() const; -%If (TQScintilla_1_7 -) - virtual TQColor defaultColor() const; - virtual TQColor defaultPaper() const; -%End - virtual void refreshProperties(); - bool readSettings(TQSettings &,const char * = "/Scintilla"); - bool writeSettings(TQSettings &,const char * = "/Scintilla") const; - -public slots: - virtual void setAutoIndentStyle(int); - virtual void setColor(const TQColor &,int = -1); - virtual void setDefaultFont(const TQFont &); -%If (TQScintilla_1_7 -) - virtual void setDefaultColor(const TQColor &); - virtual void setDefaultPaper(const TQColor &); -%End - virtual void setEolFill(bool,int = -1); - virtual void setFont(const TQFont &,int = -1); - virtual void setPaper(const TQColor &,int = -1); - -signals: - void colorChanged(const TQColor &,int); - void eolFillChanged(bool,int); - void fontChanged(const TQFont &,int); - void paperChanged(const TQColor &,int); - void propertyChanged(const char *,const char *); - -protected: - virtual bool readProperties(TQSettings &,const TQString &); - virtual bool writeProperties(TQSettings &,const TQString &) const; - -private: - TQextScintillaLexer(const TQextScintillaLexer &); - -}; diff --git a/sip/qtext/qextscintillalexerbash.sip b/sip/qtext/qextscintillalexerbash.sip deleted file mode 100644 index 0a3b95c..0000000 --- a/sip/qtext/qextscintillalexerbash.sip +++ /dev/null @@ -1,80 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerBash. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (TQScintilla_1_4 -) - -class TQextScintillaLexerBash : TQextScintillaLexer -{ -%TypeHeaderCode -#include -%End - -public: - enum { - Default, - Error, - Comment, - Number, - Keyword, - DoubleQuotedString, - SingleQuotedString, - Operator, - Identifier, - Scalar, - ParameterExpansion, - Backticks, - HereDocumentDelimiter, - SingleQuotedHereDocument - }; - - TQextScintillaLexerBash(TQObject * /TransferThis/ = 0,const char * = 0); - - const char *language() const; - const char *lexer() const; - TQColor color(int) const; - bool eolFill(int) const; - TQFont font(int) const; - const char *keywords(int) const; - TQString description(int) const; - TQColor paper(int) const; - - void refreshProperties(); - bool foldComments() const; - bool foldCompact() const; - -public slots: - virtual void setFoldComments(bool); - virtual void setFoldCompact(bool); - -protected: - bool readProperties(TQSettings &,const TQString &); - bool writeProperties(TQSettings &,const TQString &) const; - -private: - TQextScintillaLexerBash(const TQextScintillaLexerBash &); -}; - -%End diff --git a/sip/qtext/qextscintillalexerbatch.sip b/sip/qtext/qextscintillalexerbatch.sip deleted file mode 100644 index fa660f0..0000000 --- a/sip/qtext/qextscintillalexerbatch.sip +++ /dev/null @@ -1,62 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerBatch. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (TQScintilla_1_6 -) - -class TQextScintillaLexerBatch : TQextScintillaLexer -{ -%TypeHeaderCode -#include -%End - -public: - enum { - Default, - Comment, - Keyword, - Label, - HideCommandChar, - ExternalCommand, - Variable, - Operator - }; - - TQextScintillaLexerBatch(TQObject * /TransferThis/ = 0,const char * = 0); - - const char *language() const; - const char *lexer() const; - TQColor color(int) const; - bool eolFill(int) const; - TQFont font(int) const; - const char *keywords(int) const; - TQString description(int) const; - TQColor paper(int) const; - -private: - TQextScintillaLexerBatch(const TQextScintillaLexerBatch &); -}; - -%End diff --git a/sip/qtext/qextscintillalexercpp.sip b/sip/qtext/qextscintillalexercpp.sip deleted file mode 100644 index 786893d..0000000 --- a/sip/qtext/qextscintillalexercpp.sip +++ /dev/null @@ -1,98 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerCPP. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -class TQextScintillaLexerCPP : TQextScintillaLexer -{ -%TypeHeaderCode -#include -%End - -public: - enum { -%If (TQScintilla_1_1 -) - Default, -%End - WhiteSpace, - Comment, - CommentLine, - CommentDoc, - Number, - Keyword, - DoubleQuotedString, - SingleQuotedString, - UUID, - PreProcessor, - Operator, - Identifier, - UnclosedString, - VerbatimString, - Regex, - CommentLineDoc, - KeywordSet2, - CommentDocKeyword, - CommentDocKeywordError, -%If (TQScintilla_1_1 -) - GlobalClass, -%End - }; - - TQextScintillaLexerCPP(TQObject * /TransferThis/ = 0,const char * = 0, - bool = 0); - - const char *language() const; - const char *lexer() const; - TQColor color(int) const; - bool eolFill(int) const; - TQFont font(int) const; - const char *keywords(int) const; - TQString description(int) const; - TQColor paper(int) const; - - void refreshProperties(); -%If (TQScintilla_1_1 -) - bool foldAtElse() const; -%End - bool foldComments() const; - bool foldCompact() const; - bool foldPreprocessor() const; - bool stylePreprocessor() const; - -public slots: -%If (TQScintilla_1_1 -) - virtual void setFoldAtElse(bool); -%End - virtual void setFoldComments(bool); - virtual void setFoldCompact(bool); - virtual void setFoldPreprocessor(bool); - virtual void setStylePreprocessor(bool); - -protected: - bool readProperties(TQSettings &,const TQString &); - bool writeProperties(TQSettings &,const TQString &) const; - -private: - TQextScintillaLexerCPP(const TQextScintillaLexerCPP &); -}; diff --git a/sip/qtext/qextscintillalexercsharp.sip b/sip/qtext/qextscintillalexercsharp.sip deleted file mode 100644 index cf5aafb..0000000 --- a/sip/qtext/qextscintillalexercsharp.sip +++ /dev/null @@ -1,47 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerCSharp. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -class TQextScintillaLexerCSharp : TQextScintillaLexerCPP -{ -%TypeHeaderCode -#include -%End - -public: - TQextScintillaLexerCSharp(TQObject * /TransferThis/ = 0, - const char * = 0); - - const char *language() const; - TQColor color(int) const; - bool eolFill(int) const; - TQFont font(int) const; - const char *keywords(int) const; - TQString description(int) const; - TQColor paper(int) const; - -private: - TQextScintillaLexerCSharp(const TQextScintillaLexerCSharp &); -}; diff --git a/sip/qtext/qextscintillalexercss.sip b/sip/qtext/qextscintillalexercss.sip deleted file mode 100644 index adc5672..0000000 --- a/sip/qtext/qextscintillalexercss.sip +++ /dev/null @@ -1,81 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerCSS. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (TQScintilla_1_6 -) - -class TQextScintillaLexerCSS : TQextScintillaLexer -{ -%TypeHeaderCode -#include -%End - -public: - enum { - Default, - Tag, - ClassSelector, - PseudoClass, - UnknownPseudoClass, - Operator, - CSS1Property, - UnknownProperty, - Value, - Comment, - IDSelector, - Important, - AtRule, - DoubleQuotedString, - SingleQuotedString, - CSS2Property, - Attribute - }; - - TQextScintillaLexerCSS(TQObject * /TransferThis/ = 0,const char * = 0); - - const char *language() const; - const char *lexer() const; - TQColor color(int) const; - TQFont font(int) const; - const char *keywords(int) const; - TQString description(int) const; - - void refreshProperties(); - bool foldComments() const; - bool foldCompact() const; - -public slots: - virtual void setFoldComments(bool); - virtual void setFoldCompact(bool); - -protected: - bool readProperties(TQSettings &,const TQString &); - bool writeProperties(TQSettings &,const TQString &) const; - -private: - TQextScintillaLexerCSS(const TQextScintillaLexerCSS &); -}; - -%End diff --git a/sip/qtext/qextscintillalexerdiff.sip b/sip/qtext/qextscintillalexerdiff.sip deleted file mode 100644 index 576c826..0000000 --- a/sip/qtext/qextscintillalexerdiff.sip +++ /dev/null @@ -1,57 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerDiff. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (TQScintilla_1_6 -) - -class TQextScintillaLexerDiff : TQextScintillaLexer -{ -%TypeHeaderCode -#include -%End - -public: - enum { - Default, - Comment, - Command, - Header, - Position, - LineRemoved, - LineAdded - }; - - TQextScintillaLexerDiff(TQObject * /TransferThis/ = 0,const char * = 0); - - const char *language() const; - const char *lexer() const; - TQColor color(int) const; - TQString description(int) const; - -private: - TQextScintillaLexerDiff(const TQextScintillaLexerDiff &); -}; - -%End diff --git a/sip/qtext/qextscintillalexerhtml.sip b/sip/qtext/qextscintillalexerhtml.sip deleted file mode 100644 index 6133b98..0000000 --- a/sip/qtext/qextscintillalexerhtml.sip +++ /dev/null @@ -1,178 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerHTML. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (TQScintilla_1_1 -) - -class TQextScintillaLexerHTML : TQextScintillaLexer -{ -%TypeHeaderCode -#include -%End - -public: - enum { - Default, - Tag, - UnknownTag, - Attribute, - UnknownAttribute, - HTMLNumber, - HTMLDoubleQuotedString, - HTMLSingleQuotedString, - OtherInTag, - HTMLComment, - Entity, - XMLTagEnd, - XMLStart, - XMLEnd, - Script, - ASPAtStart, - ASPStart, - CDATA, - PHPStart, - HTMLValue, - ASPXCComment, - SGMLDefault, - SGMLCommand, - SGMLParameter, - SGMLDoubleQuotedString, - SGMLSingleQuotedString, - SGMLError, - SGMLSpecial, - SGMLEntity, - SGMLComment, - SGMLParameterComment, - SGMLBlockDefault, - JavaScriptStart, - JavaScriptDefault, - JavaScriptComment, - JavaScriptCommentLine, - JavaScriptCommentDoc, - JavaScriptNumber, - JavaScriptWord, - JavaScriptKeyword, - JavaScriptDoubleQuotedString, - JavaScriptSingleQuotedString, - JavaScriptSymbol, - JavaScriptUnclosedString, - JavaScriptRegex, - ASPJavaScriptStart, - ASPJavaScriptDefault, - ASPJavaScriptComment, - ASPJavaScriptCommentLine, - ASPJavaScriptCommentDoc, - ASPJavaScriptNumber, - ASPJavaScriptWord, - ASPJavaScriptKeyword, - ASPJavaScriptDoubleQuotedString, - ASPJavaScriptSingleQuotedString, - ASPJavaScriptSymbol, - ASPJavaScriptUnclosedString, - ASPJavaScriptRegex, - VBScriptStart, - VBScriptDefault, - VBScriptComment, - VBScriptNumber, - VBScriptKeyword, - VBScriptString, - VBScriptIdentifier, - VBScriptUnclosedString, - ASPVBScriptStart, - ASPVBScriptDefault, - ASPVBScriptComment, - ASPVBScriptNumber, - ASPVBScriptKeyword, - ASPVBScriptString, - ASPVBScriptIdentifier, - ASPVBScriptUnclosedString, - PythonStart, - PythonDefault, - PythonComment, - PythonNumber, - PythonDoubleQuotedString, - PythonSingleQuotedString, - PythonKeyword, - PythonTripleSingleQuotedString, - PythonTripleDoubleQuotedString, - PythonClassName, - PythonFunctionMethodName, - PythonOperator, - PythonIdentifier, - ASPPythonStart, - ASPPythonDefault, - ASPPythonComment, - ASPPythonNumber, - ASPPythonDoubleQuotedString, - ASPPythonSingleQuotedString, - ASPPythonKeyword, - ASPPythonTripleSingleQuotedString, - ASPPythonTripleDoubleQuotedString, - ASPPythonClassName, - ASPPythonFunctionMethodName, - ASPPythonOperator, - ASPPythonIdentifier, - PHPDefault, - PHPDoubleQuotedString, - PHPSingleQuotedString, - PHPKeyword, - PHPNumber, - PHPVariable, - PHPComment, - PHPCommentLine, - PHPDoubleQuotedVariable, - PHPOperator - }; - - TQextScintillaLexerHTML(TQObject * /TransferThis/ = 0,const char * = 0); - - const char *language() const; - const char *lexer() const; - TQColor color(int) const; - bool eolFill(int) const; - TQFont font(int) const; - const char *keywords(int) const; - TQString description(int) const; - TQColor paper(int) const; - - void refreshProperties(); - bool foldCompact() const; - bool foldPreprocessor() const; - bool caseSensitiveTags() const; - -public slots: - virtual void setFoldCompact(bool); - virtual void setFoldPreprocessor(bool); - virtual void setCaseSensitiveTags(bool); - -protected: - bool readProperties(TQSettings &,const TQString &); - bool writeProperties(TQSettings &,const TQString &) const; - -private: - TQextScintillaLexerHTML(const TQextScintillaLexerHTML &); -}; - -%End diff --git a/sip/qtext/qextscintillalexeridl.sip b/sip/qtext/qextscintillalexeridl.sip deleted file mode 100644 index 8ae2a83..0000000 --- a/sip/qtext/qextscintillalexeridl.sip +++ /dev/null @@ -1,43 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerIDL. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -class TQextScintillaLexerIDL : TQextScintillaLexerCPP -{ -%TypeHeaderCode -#include -%End - -public: - TQextScintillaLexerIDL(TQObject * /TransferThis/ = 0,const char * = 0); - - const char *language() const; - TQColor color(int) const; - const char *keywords(int) const; - TQString description(int) const; - -private: - TQextScintillaLexerIDL(const TQextScintillaLexerIDL &); -}; diff --git a/sip/qtext/qextscintillalexerjava.sip b/sip/qtext/qextscintillalexerjava.sip deleted file mode 100644 index 7ffb790..0000000 --- a/sip/qtext/qextscintillalexerjava.sip +++ /dev/null @@ -1,41 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerJava. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -class TQextScintillaLexerJava : TQextScintillaLexerCPP -{ -%TypeHeaderCode -#include -%End - -public: - TQextScintillaLexerJava(TQObject * /TransferThis/ = 0,const char * = 0); - - const char *language() const; - const char *keywords(int) const; - -private: - TQextScintillaLexerJava(const TQextScintillaLexerJava &); -}; diff --git a/sip/qtext/qextscintillalexerjavascript.sip b/sip/qtext/qextscintillalexerjavascript.sip deleted file mode 100644 index 0624788..0000000 --- a/sip/qtext/qextscintillalexerjavascript.sip +++ /dev/null @@ -1,47 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerJavaScript. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -class TQextScintillaLexerJavaScript : TQextScintillaLexerCPP -{ -%TypeHeaderCode -#include -%End - -public: - TQextScintillaLexerJavaScript(TQObject * /TransferThis/ = 0, - const char * = 0); - - const char *language() const; - TQColor color(int) const; - bool eolFill(int) const; - TQFont font(int) const; - const char *keywords(int) const; - TQString description(int) const; - TQColor paper(int) const; - -private: - TQextScintillaLexerJavaScript(const TQextScintillaLexerJavaScript &); -}; diff --git a/sip/qtext/qextscintillalexerlua.sip b/sip/qtext/qextscintillalexerlua.sip deleted file mode 100644 index 3a70a01..0000000 --- a/sip/qtext/qextscintillalexerlua.sip +++ /dev/null @@ -1,79 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerLua. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (TQScintilla_1_5 -) - -class TQextScintillaLexerLua : TQextScintillaLexer -{ -%TypeHeaderCode -#include -%End - -public: - enum { - Default, - Comment, - LineComment, - Number, - Keyword, - String, - Character, - LiteralString, - Preprocessor, - Operator, - Identifier, - UnclosedString, - BasicFunctions, - StringTableMathsFunctions, - CoroutinesIOSystemFacilities - }; - - TQextScintillaLexerLua(TQObject * /TransferThis/ = 0,const char * = 0); - - const char *language() const; - const char *lexer() const; - TQColor color(int) const; - bool eolFill(int) const; - TQFont font(int) const; - const char *keywords(int) const; - TQString description(int) const; - TQColor paper(int) const; - - void refreshProperties(); - bool foldCompact() const; - -public slots: - virtual void setFoldCompact(bool); - -protected: - bool readProperties(TQSettings &,const TQString &); - bool writeProperties(TQSettings &,const TQString &) const; - -private: - TQextScintillaLexerLua(const TQextScintillaLexerLua &); -}; - -%End diff --git a/sip/qtext/qextscintillalexermakefile.sip b/sip/qtext/qextscintillalexermakefile.sip deleted file mode 100644 index d15259e..0000000 --- a/sip/qtext/qextscintillalexermakefile.sip +++ /dev/null @@ -1,60 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerMakefile. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (TQScintilla_1_6 -) - -class TQextScintillaLexerMakefile : TQextScintillaLexer -{ -%TypeHeaderCode -#include -%End - -public: - enum { - Default, - Comment, - Preprocessor, - Variable, - Operator, - Target, - Error - }; - - TQextScintillaLexerMakefile(TQObject * /TransferThis/ = 0,const char * = 0); - - const char *language() const; - const char *lexer() const; - TQColor color(int) const; - bool eolFill(int) const; - TQFont font(int) const; - TQString description(int) const; - TQColor paper(int) const; - -private: - TQextScintillaLexerMakefile(const TQextScintillaLexerMakefile &); -}; - -%End diff --git a/sip/qtext/qextscintillalexerperl.sip b/sip/qtext/qextscintillalexerperl.sip deleted file mode 100644 index e63e71b..0000000 --- a/sip/qtext/qextscintillalexerperl.sip +++ /dev/null @@ -1,96 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerPerl. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (TQScintilla_1_3 -) - -class TQextScintillaLexerPerl : TQextScintillaLexer -{ -%TypeHeaderCode -#include -%End - -public: - enum { - Default, - Error, - Comment, - POD, - Number, - Keyword, - DoubleQuotedString, - SingleQuotedString, - Operator, - Identifier, - Scalar, - Array, - Hash, - SymbolTable, - Regex, - Substitution, - Backticks, - DataSection, - HereDocumentDelimiter, - SingleQuotedHereDocument, - DoubleQuotedHereDocument, - BacktickHereDocument, - QuotedStringQ, - QuotedStringQQ, - QuotedStringQX, - QuotedStringQR, - QuotedStringQW, -%If (TQScintilla_1_6 -) - PODVerbatim, -%End - }; - - TQextScintillaLexerPerl(TQObject * /TransferThis/ = 0,const char * = 0); - - const char *language() const; - const char *lexer() const; - TQColor color(int) const; - bool eolFill(int) const; - TQFont font(int) const; - const char *keywords(int) const; - TQString description(int) const; - TQColor paper(int) const; - - void refreshProperties(); - bool foldComments() const; - bool foldCompact() const; - -public slots: - virtual void setFoldComments(bool); - virtual void setFoldCompact(bool); - -protected: - bool readProperties(TQSettings &,const TQString &); - bool writeProperties(TQSettings &,const TQString &) const; - -private: - TQextScintillaLexerPerl(const TQextScintillaLexerPerl &); -}; - -%End diff --git a/sip/qtext/qextscintillalexerpov.sip b/sip/qtext/qextscintillalexerpov.sip deleted file mode 100644 index f4f87ad..0000000 --- a/sip/qtext/qextscintillalexerpov.sip +++ /dev/null @@ -1,85 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerPOV. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (TQScintilla_1_6 -) - -class TQextScintillaLexerPOV : TQextScintillaLexer -{ -%TypeHeaderCode -#include -%End - -public: - enum { - Default, - Comment, - CommentLine, - Number, - Operator, - Identifier, - String, - UnclosedString, - Directive, - BadDirective, - ObjectsCSGAppearance, - TypesModifiersItems, - PredefinedIdentifiers, - PredefinedFunctions, - KeywordSet6, - KeywordSet7, - KeywordSet8 - }; - - TQextScintillaLexerPOV(TQObject * /TransferThis/ = 0,const char * = 0); - - const char *language() const; - const char *lexer() const; - TQColor color(int) const; - bool eolFill(int) const; - TQFont font(int) const; - const char *keywords(int) const; - TQString description(int) const; - TQColor paper(int) const; - - void refreshProperties(); - bool foldComments() const; - bool foldCompact() const; - bool foldDirectives() const; - -public slots: - virtual void setFoldComments(bool); - virtual void setFoldCompact(bool); - virtual void setFoldDirectives(bool); - -protected: - bool readProperties(TQSettings &,const TQString &); - bool writeProperties(TQSettings &,const TQString &) const; - -private: - TQextScintillaLexerPOV(const TQextScintillaLexerPOV &); -}; - -%End diff --git a/sip/qtext/qextscintillalexerproperties.sip b/sip/qtext/qextscintillalexerproperties.sip deleted file mode 100644 index b3be195..0000000 --- a/sip/qtext/qextscintillalexerproperties.sip +++ /dev/null @@ -1,68 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerProperties. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (TQScintilla_1_6 -) - -class TQextScintillaLexerProperties : TQextScintillaLexer -{ -%TypeHeaderCode -#include -%End - -public: - enum { - Default, - Comment, - Section, - Assignment, - DefaultValue - }; - - TQextScintillaLexerProperties(TQObject * /TransferThis/ = 0,const char * = 0); - - const char *language() const; - const char *lexer() const; - TQColor color(int) const; - bool eolFill(int) const; - TQFont font(int) const; - TQString description(int) const; - TQColor paper(int) const; - - void refreshProperties(); - bool foldCompact() const; - -public slots: - virtual void setFoldCompact(bool); - -protected: - bool readProperties(TQSettings &,const TQString &); - bool writeProperties(TQSettings &,const TQString &) const; - -private: - TQextScintillaLexerProperties(const TQextScintillaLexerProperties &); -}; - -%End diff --git a/sip/qtext/qextscintillalexerpython.sip b/sip/qtext/qextscintillalexerpython.sip deleted file mode 100644 index d14a51d..0000000 --- a/sip/qtext/qextscintillalexerpython.sip +++ /dev/null @@ -1,94 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerPython. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -class TQextScintillaLexerPython : TQextScintillaLexer -{ -%TypeHeaderCode -#include -%End - -public: - enum { -%If (TQScintilla_1_1 -) - Default, -%End - WhiteSpace, - Comment, - Number, - DoubleQuotedString, - SingleQuotedString, - Keyword, - TripleSingleQuotedString, - TripleDoubleQuotedString, - ClassName, - FunctionMethodName, - Operator, - Identifier, - CommentBlock, - UnclosedString, -%If (TQScintilla_1_7 -) - HighlightedIdentifier, - Decorator, -%End - }; - - enum IndentationWarning { - NoWarning, - Inconsistent, - TabsAfterSpaces, - Spaces, - Tabs - }; - - TQextScintillaLexerPython(TQObject * /TransferThis/ = 0, - const char * = 0); - - const char *language() const; - const char *lexer() const; - TQColor color(int) const; - bool eolFill(int) const; - TQFont font(int) const; - const char *keywords(int) const; - TQString description(int) const; - TQColor paper(int) const; - void refreshProperties(); - - bool foldComments() const; - bool foldQuotes() const; - IndentationWarning indentationWarning() const; - -public slots: - virtual void setFoldComments(bool); - virtual void setFoldQuotes(bool); - virtual void setIndentationWarning(IndentationWarning); - -protected: - bool readProperties(TQSettings &,const TQString &); - bool writeProperties(TQSettings &,const TQString &) const; - -private: - TQextScintillaLexerPython(const TQextScintillaLexerPython &); -}; diff --git a/sip/qtext/qextscintillalexerruby.sip b/sip/qtext/qextscintillalexerruby.sip deleted file mode 100644 index 257aad2..0000000 --- a/sip/qtext/qextscintillalexerruby.sip +++ /dev/null @@ -1,128 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerRuby. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (TQScintilla_1_5 -) - -class TQextScintillaLexerRuby : TQextScintillaLexer -{ -%TypeHeaderCode -#include -%End - -public: -%If (TQScintilla_1_7 -) - enum { - Default, - Comment, - POD, - Number, - Keyword, - DoubleQuotedString, - SingleQuotedString, - ClassName, - FunctionMethodName, - Operator, - Identifier, - Regex, - Global, - Symbol, - ModuleName, - InstanceVariable, - ClassVariable, - Backticks, - DataSection, - HereDocumentDelimiter, - HereDocument, - PercentStringq, - PercentStringQ, - PercentStringx, - PercentStringr, - PercentStringw, - DemotedKeyword, - Stdin, - Stdout, - Stderr - }; -%End -%If (- TQScintilla_1_7) - enum { - Default, - WhiteSpace, - Comment, - Number, - DoubleQuotedString, - SingleQuotedString, - Keyword, - TripleDoubleQuotedString, - ClassName, - FunctionMethodName, - Operator, - Identifier, - CommentBlock, - UnclosedString - }; - - enum IndentationWarning { - NoWarning, - Inconsistent, - TabsAfterSpaces, - Spaces, - Tabs - }; -%End - - TQextScintillaLexerRuby(TQObject * /TransferThis/ = 0,const char * = 0); - - const char *language() const; - const char *lexer() const; - TQColor color(int) const; - bool eolFill(int) const; - TQFont font(int) const; - const char *keywords(int) const; - TQString description(int) const; - TQColor paper(int) const; -%If (- TQScintilla_1_7) - void refreshProperties(); - - IndentationWarning indentationWarning() const; -%End - -public slots: -%If (- TQScintilla_1_7) - virtual void setIndentationWarning(IndentationWarning); -%End - -protected: -%If (- TQScintilla_1_7) - bool readProperties(TQSettings &,const TQString &); - bool writeProperties(TQSettings &,const TQString &) const; -%End - -private: - TQextScintillaLexerRuby(const TQextScintillaLexerRuby &); -}; - -%End diff --git a/sip/qtext/qextscintillalexersql.sip b/sip/qtext/qextscintillalexersql.sip deleted file mode 100644 index 418351f..0000000 --- a/sip/qtext/qextscintillalexersql.sip +++ /dev/null @@ -1,105 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerSQL. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (TQScintilla_1_1 -) - -class TQextScintillaLexerSQL : TQextScintillaLexer -{ -%TypeHeaderCode -#include -%End - -public: - enum { - Default, - Comment, -%If (TQScintilla_1_6 -) - CommentLine, - CommentDoc, -%End - LineComment, // Obsolete. - Number, - Keyword, -%If (TQScintilla_1_6 -) - DoubleQuotedString, -%End - SingleQuotedString, -%If (TQScintilla_1_6 -) - PlusKeyword, - PlusPrompt, -%End - Operator, - Identifier, -%If (TQScintilla_1_6 -) - PlusComment, - CommentLineHash, - CommentDocKeyword, - CommentDocKeywordError, - KeywordSet5, - KeywordSet6, - KeywordSet7, - KeywordSet8, -%End - }; - - TQextScintillaLexerSQL(TQObject * /TransferThis/ = 0,const char * = 0); - - const char *language() const; - const char *lexer() const; - TQColor color(int) const; -%If (TQScintilla_1_6 -) - bool eolFill(int) const; -%End - TQFont font(int) const; - const char *keywords(int) const; - TQString description(int) const; -%If (TQScintilla_1_6 -) - TQColor paper(int) const; - - void refreshProperties(); - bool foldComments() const; - bool foldCompact() const; - bool backslashEscapes() const; -%End - -public slots: -%If (TQScintilla_1_6 -) - virtual void setFoldComments(bool); - virtual void setFoldCompact(bool); - virtual void setBackslashEscapes(bool); -%End - -protected: -%If (TQScintilla_1_6 -) - bool readProperties(TQSettings &,const TQString &); - bool writeProperties(TQSettings &,const TQString &) const; -%End - -private: - TQextScintillaLexerSQL(const TQextScintillaLexerSQL &); -}; - -%End diff --git a/sip/qtext/qextscintillalexertex.sip b/sip/qtext/qextscintillalexertex.sip deleted file mode 100644 index 24f42fe..0000000 --- a/sip/qtext/qextscintillalexertex.sip +++ /dev/null @@ -1,57 +0,0 @@ -// This is the SIP interface definition for TQextScintillaLexerTeX. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (TQScintilla_1_6 -) - -class TQextScintillaLexerTeX : TQextScintillaLexer -{ -%TypeHeaderCode -#include -%End - -public: - enum { - Default, - Special, - Group, - Symbol, - Command, - Text - }; - - TQextScintillaLexerTeX(TQObject * /TransferThis/ = 0,const char * = 0); - - const char *language() const; - const char *lexer() const; - TQColor color(int) const; - const char *keywords(int) const; - TQString description(int) const; - -private: - TQextScintillaLexerTeX(const TQextScintillaLexerTeX &); -}; - -%End diff --git a/sip/qtext/qextscintillamacro.sip b/sip/qtext/qextscintillamacro.sip deleted file mode 100644 index e29ab1f..0000000 --- a/sip/qtext/qextscintillamacro.sip +++ /dev/null @@ -1,49 +0,0 @@ -// This is the SIP interface definition for TQextScintillaMacro. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -class TQextScintillaMacro : TQObject -{ -%TypeHeaderCode -#include -%End - -public: - TQextScintillaMacro(TQextScintilla * /TransferThis/,const char * = 0); - TQextScintillaMacro(const TQCString &,TQextScintilla * /TransferThis/, - const char * = 0); - - void clear(); - bool load(const TQCString &); - TQCString save() const; - -public slots: - virtual void play(); - virtual void startRecording(); - virtual void endRecording(); - -private: - TQextScintillaMacro(const TQextScintillaMacro &); -}; diff --git a/sip/qtext/qextscintillaprinter.sip b/sip/qtext/qextscintillaprinter.sip deleted file mode 100644 index b5ee0d6..0000000 --- a/sip/qtext/qextscintillaprinter.sip +++ /dev/null @@ -1,45 +0,0 @@ -// This is the SIP interface definition for TQextScintillaPrinter. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -class TQextScintillaPrinter : TQPrinter -{ -%TypeHeaderCode -#include -%End - -public: - TQextScintillaPrinter(TQPrinter::PrinterMode = TQPrinter::ScreenResolution); - - virtual void formatPage(TQPainter &,bool,TQRect &,int); - virtual int printRange(TQextScintillaBase *,int = -1,int = -1); - int magnification() const; - virtual void setMagnification(int); - TQextScintilla::WrapMode wrapMode() const; - virtual void setWrapMode(TQextScintilla::WrapMode); - -private: - TQextScintillaPrinter(const TQextScintillaPrinter &); -}; diff --git a/sip/qtext/qtextmod.sip b/sip/qtext/qtextmod.sip deleted file mode 100644 index 5b01495..0000000 --- a/sip/qtext/qtextmod.sip +++ /dev/null @@ -1,107 +0,0 @@ -// This is the SIP interface definition for the qtext module of PyTQt. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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.qtext 4 - -%Import qt/qtmod.sip - -%Include copying.sip - - -// The TQScintilla versions. -%Timeline {TQScintilla_1_1 TQScintilla_1_2 TQScintilla_1_3 TQScintilla_1_4 - TQScintilla_1_5 TQScintilla_1_6 TQScintilla_1_7} - - -const unsigned TQSCINTILLA_VERSION; -const char *TQSCINTILLA_VERSION_STR; -const char *TQSCINTILLA_BUILD; - - -%Include qextscintillaapis.sip -%Include qextscintillabase.sip -%Include qextscintilla.sip -%Include qextscintillacommand.sip -%Include qextscintillacommandset.sip -%Include qextscintilladocument.sip -%Include qextscintillalexer.sip -%Include qextscintillalexerbash.sip -%Include qextscintillalexerbatch.sip -%Include qextscintillalexercpp.sip -%Include qextscintillalexercsharp.sip -%Include qextscintillalexercss.sip -%Include qextscintillalexerdiff.sip -%Include qextscintillalexerhtml.sip -%Include qextscintillalexeridl.sip -%Include qextscintillalexerjava.sip -%Include qextscintillalexerjavascript.sip -%Include qextscintillalexerlua.sip -%Include qextscintillalexermakefile.sip -%Include qextscintillalexerperl.sip -%Include qextscintillalexerpov.sip -%Include qextscintillalexerproperties.sip -%Include qextscintillalexerpython.sip -%Include qextscintillalexerruby.sip -%Include qextscintillalexersql.sip -%Include qextscintillalexertex.sip -%Include qextscintillamacro.sip -%Include qextscintillaprinter.sip - - -// The build file template. - -%Makefile qtext.pro.in -# The project file for the qtext module. -# -# Copyright (c) 2007 -# Riverbank Computing Limited -# -# 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 = @PYQT_MODDIR@ -CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ -INCLUDEPATH = @BLX_INCLUDEPATH@ @PYQT_QSCINTILLA_INC@ -DEFINES = @BLX_DEFINES@ TQEXTSCINTILLA_DLL -LIBS += @PYQT_QT_MODULE@ @PYQT_QSCINTILLA_LIB@ @BLX_LIBS@ -macx:QMAKE_LFLAGS += -framework Python - -SOURCES = $B - -HEADERS = $H -%End diff --git a/sip/qtgl/copying.sip b/sip/qtgl/copying.sip deleted file mode 100644 index 6da646e..0000000 --- a/sip/qtgl/copying.sip +++ /dev/null @@ -1,51 +0,0 @@ -// This is the SIP file defining the PyTQt license. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 - -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 pyqt-internal.sip -%OptionalInclude pyqt-gpl.sip -%OptionalInclude pyqt-commercial.sip -%OptionalInclude pyqt-edu.sip -%OptionalInclude pyqt-eval.sip -%OptionalInclude pyqt-nc.sip -%OptionalInclude pyqt-tkc.sip diff --git a/sip/qtgl/qgl.sip b/sip/qtgl/qgl.sip deleted file mode 100644 index 1d1b080..0000000 --- a/sip/qtgl/qgl.sip +++ /dev/null @@ -1,276 +0,0 @@ -// This is the SIP interface definition for TQGL, TQGLContext, TQGLFormat and -// TQGLWidget. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQGL - -TQGL is fully implemented. - - - -TQGLContext - -TQGLContext is fully implemented. - - - -TQGLFormat - -TQGLFormat is fully implemented. - - - -TQGLWidget - -TQGLWidget is fully implemented. - - -%End - - -const int TQGL_VERSION; -const char *TQGL_VERSION_STR; - -const char *qGLVersion(); - - -class TQGL -{ -%TypeHeaderCode -#include -%End - -public: - enum FormatOption { - DoubleBuffer, - DepthBuffer, - Rgba, - AlphaChannel, - AccumBuffer, - StencilBuffer, - StereoBuffers, - DirectRendering, - HasOverlay, - SingleBuffer, - NoDepthBuffer, - ColorIndex, - NoAlphaChannel, - NoAccumBuffer, - NoStencilBuffer, - NoStereoBuffers, - IndirectRendering, - NoOverlay - }; -}; - - -class TQGLFormat : TQGL -{ -%TypeHeaderCode -#include -%End - -public: - TQGLFormat(); - TQGLFormat(int,int = 0); - - bool doubleBuffer() const; - void setDoubleBuffer(bool); - bool depth() const; - void setDepth(bool); - bool rgba() const; - void setRgba(bool); - bool alpha() const; - void setAlpha(bool); - bool accum() const; - void setAccum(bool); - bool stencil() const; - void setStencil(bool); - bool stereo() const; - void setStereo(bool); - bool directRendering() const; - void setDirectRendering(bool); - bool hasOverlay() const; - void setOverlay(bool); - - int plane() const; - void setPlane(int); - - void setOption(FormatOption); - bool testOption(FormatOption) const; - - static TQGLFormat defaultFormat(); - static void setDefaultFormat(const TQGLFormat &); - - static TQGLFormat defaultOverlayFormat(); - static void setDefaultOverlayFormat(const TQGLFormat &); - - static bool hasOpenGL(); - static bool hasOpenGLOverlays(); -}; - - -class TQGLContext : TQGL -{ -%TypeHeaderCode -#include -%End - -public: - TQGLContext(const TQGLFormat &,TQPaintDevice *); - TQGLContext(const TQGLFormat &); - - virtual bool create(const TQGLContext * = 0); - bool isValid() const; - bool isSharing() const; - virtual void reset(); - - TQGLFormat format() const; - TQGLFormat requestedFormat() const; - virtual void setFormat(const TQGLFormat &); - - virtual void makeCurrent(); - virtual void swapBuffers() const; - - TQPaintDevice *device() const; - - TQColor overlayTransparentColor() const; - - static const TQGLContext *currentContext(); - -protected: - virtual bool chooseContext(const TQGLContext * = 0); - virtual void doneCurrent(); - -%If (WS_X11) - virtual void *tryVisual(const TQGLFormat &,int = 1); - virtual void *chooseVisual(); -%End - - bool deviceIsPixmap() const; - bool windowCreated() const; - void setWindowCreated(bool); - bool initialized() const; - void setInitialized(bool); - void generateFontDisplayLists(const TQFont &,int); - - uint colorIndex(const TQColor &) const; - void setValid(bool); - void setDevice(TQPaintDevice *); - -private: - TQGLContext(); - TQGLContext(const TQGLContext &); -}; - - -class TQGLWidget : TQWidget, TQGL -{ -%TypeHeaderCode -#include -%End - -public: - TQGLWidget(TQWidget * /TransferThis/ = 0,const char * = 0, - const TQGLWidget * = 0,WFlags = 0); - TQGLWidget(TQGLContext * /Transfer/,TQWidget * /TransferThis/ = 0,const char * = 0, - const TQGLWidget * = 0,WFlags = 0); - TQGLWidget(const TQGLFormat &,TQWidget * /TransferThis/ = 0, - const char * = 0,const TQGLWidget * = 0,WFlags = 0); - -%ConvertToSubClassCode - sipClass = (sipCpp->inherits(sipName_TQGLWidget) ? sipClass_TQGLWidget : NULL); -%End - - void qglColor(const TQColor &) const; - void qglClearColor(const TQColor &) const; - - bool isValid() const; - bool isSharing() const; - virtual void makeCurrent(); - void doneCurrent(); - - bool doubleBuffer() const; - virtual void swapBuffers(); - - TQGLFormat format() const; - - const TQGLContext *context() const; - - virtual TQPixmap renderPixmap(int = 0,int = 0,bool = 0); - virtual TQImage grabFrameBuffer(bool = 0); - - virtual void makeOverlayCurrent(); - const TQGLContext *overlayContext() const; - - static TQImage convertToGLFormat(const TQImage &); - - void setMouseTracking(bool); - - 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->TQGLWidget::reparent(a0, a1, *a2, a3) : sipCpp->reparent(a0, a1, *a2, a3); - Py_END_ALLOW_THREADS -%End - - const TQGLColormap &colormap() const; - void setColormap(const TQGLColormap &); - - void renderText(int,int,const TQString &,const TQFont & = TQFont(), - int = 2000); - void renderText(double,double,double,const TQString &, - const TQFont & = TQFont(),int = 2000); - -public slots: - virtual void updateGL(); - virtual void updateOverlayGL(); - -protected: - virtual void initializeGL(); - virtual void resizeGL(int,int); - virtual void paintGL(); - - virtual void initializeOverlayGL(); - virtual void resizeOverlayGL(int,int); - virtual void paintOverlayGL(); - - void setAutoBufferSwap(bool); - bool autoBufferSwap() const; - - void paintEvent(TQPaintEvent *); - void resizeEvent(TQResizeEvent *); - - virtual void glInit(); - virtual void glDraw(); - -private: - TQGLWidget(const TQGLWidget &); -}; diff --git a/sip/qtgl/qglcolormap.sip b/sip/qtgl/qglcolormap.sip deleted file mode 100644 index 4d621ae..0000000 --- a/sip/qtgl/qglcolormap.sip +++ /dev/null @@ -1,59 +0,0 @@ -// This is the SIP interface definition for TQGLColormap. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQGLColormap (TQt v3.0+) - - void setEntries - int count - const TQRgb *colors - int base = 0 - - -Not yet implemented. - - -%End - - -class TQGLColormap -{ -%TypeHeaderCode -#include -%End - -public: - TQGLColormap(); - TQGLColormap(const TQGLColormap &); - - bool isEmpty() const; - int size() const; - void detach(); - -// void setEntries(int,const TQRgb *,int = 0); - void setEntry(int,TQRgb); - void setEntry(int,const TQColor &); - TQRgb entryRgb(int) const; - TQColor entryColor(int) const; - int find(TQRgb) const; - int findNearest(TQRgb) const; -}; diff --git a/sip/qtgl/qtglmod.sip b/sip/qtgl/qtglmod.sip deleted file mode 100644 index abf4054..0000000 --- a/sip/qtgl/qtglmod.sip +++ /dev/null @@ -1,71 +0,0 @@ -// This is the SIP interface definition for the qtgl module of PyTQt. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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.qtgl 1 - -%Import qt/qtmod.sip - -%Include copying.sip - - -%Include qgl.sip -%Include qglcolormap.sip - - -// The build file template. - -%Makefile qtgl.pro.in -# The project file for the qtgl module. -# -# Copyright (c) 2007 -# Riverbank Computing Limited -# -# 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 = @PYQT_MODDIR@ -CONFIG += @BLX_CONFIG_LIB@ opengl @PYQT_WARN@ -INCLUDEPATH = @BLX_INCLUDEPATH@ -DEFINES = @BLX_DEFINES@ -LIBS += @PYQT_QT_MODULE@ @BLX_LIBS@ -macx:QMAKE_LFLAGS += -framework Python - -SOURCES = $B - -HEADERS = $H -%End diff --git a/sip/qtnetwork/copying.sip b/sip/qtnetwork/copying.sip deleted file mode 100644 index 6da646e..0000000 --- a/sip/qtnetwork/copying.sip +++ /dev/null @@ -1,51 +0,0 @@ -// This is the SIP file defining the PyTQt license. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 - -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 pyqt-internal.sip -%OptionalInclude pyqt-gpl.sip -%OptionalInclude pyqt-commercial.sip -%OptionalInclude pyqt-edu.sip -%OptionalInclude pyqt-eval.sip -%OptionalInclude pyqt-nc.sip -%OptionalInclude pyqt-tkc.sip diff --git a/sip/qtnetwork/qdns.sip b/sip/qtnetwork/qdns.sip deleted file mode 100644 index 7d9c436..0000000 --- a/sip/qtnetwork/qdns.sip +++ /dev/null @@ -1,272 +0,0 @@ -// This is the SIP interface definition for TQDns. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQDns (TQt v2.2+) - -TQDns is fully implemented. - - -%End - - -%If (TQt_DNS) - -class TQDns : TQObject -{ -%TypeHeaderCode -#include -%End - -public: - enum RecordType { - None, - A, - Aaaa, - Mx, - Srv, - Cname, - Ptr, - Txt - }; - - TQDns(); - TQDns(const TQString &,RecordType = A); - TQDns(const TQHostAddress &,RecordType = A); - - virtual void setLabel(const TQString &); - virtual void setLabel(const TQHostAddress &); - TQString label() const; - - virtual void setRecordType(RecordType = A); - RecordType recordType() const; - - bool isWorking() const; - - TQValueList addresses() const; - - class MailServer - { - public: - MailServer(const TQString & = TQString::null,TQ_UINT16 = 0); - - TQString name; - TQ_UINT16 priority; - }; - - TQValueList mailServers() const; - - class Server - { - public: - Server(const TQString & = TQString::null,TQ_UINT16 = 0, - TQ_UINT16 = 0,TQ_UINT16 = 0); - - TQString name; - TQ_UINT16 priority; - TQ_UINT16 weight; - TQ_UINT16 port; - }; - - TQValueList servers() const; - - TQStringList hostNames() const; - - TQStringList texts() const; - - TQString canonicalName() const; - - TQStringList qualifiedNames() const; - -signals: - void resultsReady(); -}; - - -%MappedType TQValueList -{ -%TypeHeaderCode -#include -%End - -%ConvertFromTypeCode - // Convert to a Python list of TQHostAddress instances. - - int i; - PyObject *l; - - // Create the list. - - if ((l = PyList_New(sipCpp -> count())) == NULL) - return NULL; - - // Get it. - - i = 0; - TQValueListConstIterator it; - - for (it = sipCpp -> begin(); it != sipCpp -> end(); ++it) - { - PyObject *tmobj; - - if ((tmobj = sipConvertFromNewInstance(new TQHostAddress(*it),sipClass_TQHostAddress,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0) - { - Py_XDECREF(tmobj); - Py_DECREF(l); - - return NULL; - } - - ++i; - } - - return l; -%End - -%ConvertToTypeCode - // At the moment this will never be called, so provide a null - // implementation. - - if (sipIsErr == NULL) - return PyList_Check(sipPy); - - PyErr_Format(PyExc_TypeError,"Converting to TQValueList not yet implemented"); - - *sipIsErr = 1; - - return 0; -%End -}; - - -%MappedType TQValueList -{ -%TypeHeaderCode -#include -%End - -%ConvertFromTypeCode - // Convert to a Python list of TQDns::MailServer instances. - - int i; - PyObject *l; - - // Create the list. - - if ((l = PyList_New(sipCpp -> count())) == NULL) - return NULL; - - // Get it. - - i = 0; - TQValueListConstIterator it; - - for (it = sipCpp -> begin(); it != sipCpp -> end(); ++it) - { - PyObject *tmobj; - - if ((tmobj = sipConvertFromNewInstance(new TQDns::MailServer(*it),sipClass_TQDns_MailServer,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0) - { - Py_XDECREF(tmobj); - Py_DECREF(l); - - return NULL; - } - - ++i; - } - - return l; -%End - -%ConvertToTypeCode - // At the moment this will never be called, so provide a null - // implementation. - - if (sipIsErr == NULL) - return PyList_Check(sipPy); - - PyErr_Format(PyExc_TypeError,"Converting to TQValueList not yet implemented"); - - *sipIsErr = 1; - - return 0; -%End -}; - - -%MappedType TQValueList -{ -%TypeHeaderCode -#include -%End - -%ConvertFromTypeCode - // Convert to a Python list of TQDns::Server instances. - - int i; - PyObject *l; - - // Create the list. - - if ((l = PyList_New(sipCpp -> count())) == NULL) - return NULL; - - // Get it. - - i = 0; - TQValueListConstIterator it; - - for (it = sipCpp -> begin(); it != sipCpp -> end(); ++it) - { - PyObject *tmobj; - - if ((tmobj = sipConvertFromNewInstance(new TQDns::Server(*it),sipClass_TQDns_Server,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0) - { - Py_XDECREF(tmobj); - Py_DECREF(l); - - return NULL; - } - - ++i; - } - - return l; -%End - -%ConvertToTypeCode - // At the moment this will never be called, so provide a null - // implementation. - - if (sipIsErr == NULL) - return PyList_Check(sipPy); - - PyErr_Format(PyExc_TypeError,"Converting to TQValueList not yet implemented"); - - *sipIsErr = 1; - - return 0; -%End -}; - -%End diff --git a/sip/qtnetwork/qftp.sip b/sip/qtnetwork/qftp.sip deleted file mode 100644 index ee945db..0000000 --- a/sip/qtnetwork/qftp.sip +++ /dev/null @@ -1,171 +0,0 @@ -// This is the SIP interface definition for TQFtp. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQFtp (TQt v2.2+) - - TQ_LONG readBlock - char *data - TQ_ULONG maxlen - - -This takes a single maxlen parameter. The -data is returned if there was no error, otherwise -None is returned. - - -%End - - -%If (TQt_NETWORKPROTOCOL_FTP) - -class TQFtp : TQNetworkProtocol -{ -%TypeHeaderCode -#include -%End - -public: - TQFtp(); - TQFtp(TQObject * /TransferThis/,const char * = 0); - virtual ~TQFtp(); - - int supportedOperations() const; - - enum State { - Unconnected, - HostLookup, - Connecting, - Connected, - LoggedIn, - Closing - }; - - enum Error { - NoError, - UnknownError, - HostNotFound, - ConnectionRefused, - NotConnected - }; - - enum Command { - None, - ConnectToHost, - Login, - Close, - List, - Cd, - Get, - Put, - Remove, - Mkdir, - Rmdir, - Rename, - RawCommand - }; - - int connectToHost(const TQString &,TQ_UINT16 = 21) /ReleaseGIL/; - int login(const TQString & = TQString::null, - const TQString & = TQString::null) /ReleaseGIL/; - int close() /ReleaseGIL/; - int list(const TQString & = TQString::null) /ReleaseGIL/; - int cd(const TQString &) /ReleaseGIL/; - int get(const TQString &,TQIODevice * = 0) /ReleaseGIL/; - int put(const TQByteArray &,const TQString &) /ReleaseGIL/; - int put(TQIODevice *,const TQString &) /ReleaseGIL/; - int remove(const TQString &) /ReleaseGIL/; - int mkdir(const TQString &) /ReleaseGIL/; - int rmdir(const TQString &) /ReleaseGIL/; - int rename(const TQString &,const TQString &) /ReleaseGIL/; - - int rawCommand(const TQString &) /ReleaseGIL/; - - unsigned long bytesAvailable() 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 = sipCpp -> TQFtp::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 - - TQByteArray readAll() /ReleaseGIL/; - - int currentId() const; - TQIODevice* currentDevice() const; - Command currentCommand() const; - bool hasPendingCommands() const; - void clearPendingCommands(); - - State state() const; - - Error error() const; - TQString errorString() const; - -public slots: - void abort(); - -signals: - void stateChanged(int); - void listInfo(const TQUrlInfo &); - void readyRead(); - void dataTransferProgress(int,int); - void rawCommandReply(int,const TQString &); - - void commandStarted(int); - void commandFinished(int,bool); - void done(bool); - -protected: - void parseDir(const TQString &,TQUrlInfo &); - virtual void operationListChildren(TQNetworkOperation *); - virtual void operationMkDir(TQNetworkOperation *); - virtual void operationRemove(TQNetworkOperation *); - virtual void operationRename(TQNetworkOperation *); - virtual void operationGet(TQNetworkOperation *); - virtual void operationPut(TQNetworkOperation *); - -private: - virtual bool checkConnection(TQNetworkOperation *); -}; - -%End diff --git a/sip/qtnetwork/qhostaddress.sip b/sip/qtnetwork/qhostaddress.sip deleted file mode 100644 index 6e1cc91..0000000 --- a/sip/qtnetwork/qhostaddress.sip +++ /dev/null @@ -1,89 +0,0 @@ -// This is the SIP interface definition for TQHostAddress. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQHostAddress (TQt v2.2+) - - TQHostAddress - TQ_UINT8 *ip6Addr - - -Not yet implemented. - - - - TQHostAddress - const Q_IPV6ADDR &ip6Addr - - -Not yet implemented. - - - - void setAddress - TQ_UINT8 *ip6Addr - - -Not yet implemented. - - - - Q_IPV6ADDR toIPv6Address const - - - -Not yet implemented. - - -%End - - -class TQHostAddress -{ -%TypeHeaderCode -#include -%End - -public: - TQHostAddress(); - TQHostAddress(TQ_UINT32); -// TQHostAddress(TQ_UINT8 *); - //TQHostAddress(const Q_IPV6ADDR &); - // This isn't mentioned in the documentation. - //TQHostAddress(const TQString &); - TQHostAddress(const TQHostAddress &); - - void setAddress(TQ_UINT32); -// void setAddress(TQ_UINT8 *); - bool setAddress(const TQString &); - bool isIp4Addr() const; - TQ_UINT32 ip4Addr() const; - - bool isIPv4Address() const; - TQ_UINT32 toIPv4Address() const; - bool isIPv6Address() const; - //Q_IPV6ADDR toIPv6Address() const; - - TQString toString() const; - - bool isNull() const; -}; diff --git a/sip/qtnetwork/qhttp.sip b/sip/qtnetwork/qhttp.sip deleted file mode 100644 index 2f80e22..0000000 --- a/sip/qtnetwork/qhttp.sip +++ /dev/null @@ -1,263 +0,0 @@ -// This is the SIP interface definition for TQHttp, TQHttpHeader, -// TQHttpRequestHeader and TQHttpResponseHeader. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQHttp (TQt v3+) - - TQ_LONG readBlock - char *data - TQ_ULONG maxlen - - -This takes a single maxlen parameter. The -data is returned if there was no error, otherwise -None is returned. - - - -TQHttpHeader (TQt v3.1+) - -TQHttpHeader is fully implemented. - - - -TQHttpRequestHeader (TQt v3.1+) - -TQHttpRequestHeader is fully implemented. - - - -TQHttpResponseHeader (TQt v3.1+) - -TQHttpResponseHeader is fully implemented. - - -%End - - -%If (TQt_NETWORKPROTOCOL_HTTP) - -class TQHttpHeader -{ -%TypeHeaderCode -#include -%End - -public: - TQHttpHeader(); - TQHttpHeader(const TQHttpHeader &); - TQHttpHeader(const TQString &); - virtual ~TQHttpHeader(); - - TQString value(const TQString &) const; - void setValue(const TQString &,const TQString &); - void removeValue(const TQString &); - - TQStringList keys() const; - bool hasKey(const TQString &) const; - - bool hasContentLength() const; - uint contentLength() const; - void setContentLength(int); - - bool hasContentType() const; - TQString contentType() const; - void setContentType(const TQString &); - - virtual TQString toString() const; - bool isValid() const; - - virtual int majorVersion() const = 0; - virtual int minorVersion() const = 0; - -protected: - virtual bool parseLine(const TQString &,int); - bool parse(const TQString &); - void setValid(bool); -}; - - -class TQHttpResponseHeader : TQHttpHeader -{ -%TypeHeaderCode -#include -%End - -public: - TQHttpResponseHeader(); - TQHttpResponseHeader(const TQHttpResponseHeader &); - - int statusCode() const; - TQString reasonPhrase() const; - - int majorVersion() const; - int minorVersion() const; - - TQString toString() const; - -protected: - bool parseLine(const TQString &,int); -}; - - -class TQHttpRequestHeader : TQHttpHeader -{ -%TypeHeaderCode -#include -%End - -public: - TQHttpRequestHeader(); - TQHttpRequestHeader(const TQString &,const TQString &,int = 1,int = 1); - TQHttpRequestHeader(const TQHttpRequestHeader &); - TQHttpRequestHeader(const TQString &); - - void setRequest(const TQString &,const TQString &,int = 1,int = 1); - - TQString method() const; - TQString path() const; - - int majorVersion() const; - int minorVersion() const; - - TQString toString() const; - -protected: - bool parseLine(const TQString &,int); -}; - - -class TQHttp : TQNetworkProtocol -{ -%TypeHeaderCode -#include -%End - -public: - TQHttp(); - TQHttp(TQObject * /TransferThis/,const char * = 0); - TQHttp(const TQString &,TQ_UINT16 = 80,TQObject * /TransferThis/ = 0, - const char * = 0); - virtual ~TQHttp(); - - int supportedOperations() const; - - enum State { - Unconnected, - HostLookup, - Connecting, - Sending, - Reading, - Connected, - Closing - }; - - enum Error { - NoError, - UnknownError, - HostNotFound, - ConnectionRefused, - UnexpectedClose, - InvalidResponseHeader, - WrongContentLength, - Aborted - }; - - int setHost(const TQString &,TQ_UINT16 = 80); - - int get(const TQString &,TQIODevice * = 0) /ReleaseGIL/; - int post(const TQString &,TQIODevice *,TQIODevice * = 0) /ReleaseGIL/; - int post(const TQString &,const TQByteArray &, - TQIODevice * = 0) /ReleaseGIL/; - int head(const TQString &) /ReleaseGIL/; - int request(const TQHttpRequestHeader &,TQIODevice * = 0, - TQIODevice * = 0) /ReleaseGIL/; - int request(const TQHttpRequestHeader &,const TQByteArray &, - TQIODevice * = 0) /ReleaseGIL/; - - int closeConnection(); - - unsigned long bytesAvailable() 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 = sipCpp -> TQHttp::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 - - TQByteArray readAll() /ReleaseGIL/; - - int currentId() const; - TQIODevice *currentSourceDevice() const; - TQIODevice *currentDestinationDevice() const; - TQHttpRequestHeader currentRequest() const; - bool hasPendingRequests() const; - void clearPendingRequests(); - - State state() const; - - Error error() const; - TQString errorString() const; - -public slots: - void abort(); - -signals: - void stateChanged(int); - void responseHeaderReceived(const TQHttpResponseHeader &); - void readyRead(const TQHttpResponseHeader &); - void dataSendProgress(int,int); - void dataReadProgress(int,int); - - void requestStarted(int); - void requestFinished(int,bool); - void done(bool); - -protected: - void operationGet(TQNetworkOperation *); - void operationPut(TQNetworkOperation *); - - void timerEvent(TQTimerEvent *); -}; - -%End diff --git a/sip/qtnetwork/qlocalfs.sip b/sip/qtnetwork/qlocalfs.sip deleted file mode 100644 index f33d6e0..0000000 --- a/sip/qtnetwork/qlocalfs.sip +++ /dev/null @@ -1,54 +0,0 @@ -// This is the SIP interface definition for TQLocalFs. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQLocalFs (TQt v2.1+) - -TQLocalFs is fully implemented. - - -%End - - -%If (TQt_NETWORKPROTOCOL) - -class TQLocalFs : TQNetworkProtocol -{ -%TypeHeaderCode -#include -%End - -public: - TQLocalFs(); - - virtual int supportedOperations() const; - -protected: - virtual void operationListChildren(TQNetworkOperation *); - virtual void operationMkDir(TQNetworkOperation *); - virtual void operationRemove(TQNetworkOperation *); - virtual void operationRename(TQNetworkOperation *); - virtual void operationGet(TQNetworkOperation *); - virtual void operationPut(TQNetworkOperation *); -}; - -%End diff --git a/sip/qtnetwork/qnetwork.sip b/sip/qtnetwork/qnetwork.sip deleted file mode 100644 index b0a6af3..0000000 --- a/sip/qtnetwork/qnetwork.sip +++ /dev/null @@ -1,32 +0,0 @@ -// This is the SIP interface definition for tqInitNetworkProtocols. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 (TQt_NETWORKPROTOCOL) - -%ModuleHeaderCode -#include -#include -%End - -void tqInitNetworkProtocols(); - -%End diff --git a/sip/qtnetwork/qserversocket.sip b/sip/qtnetwork/qserversocket.sip deleted file mode 100644 index 4cbcdce..0000000 --- a/sip/qtnetwork/qserversocket.sip +++ /dev/null @@ -1,58 +0,0 @@ -// This is the SIP interface definition for TQServerSocket. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQServerSocket (TQt v2.2+) - -TQServerSocket is fully implemented. - - -%End - - -class TQServerSocket : TQObject -{ -%TypeHeaderCode -#include -%End - -public: - TQServerSocket(TQ_UINT16,int = 1,TQObject * /TransferThis/ = 0, - const char * = 0); - TQServerSocket(const TQHostAddress &,TQ_UINT16,int = 1, - TQObject * /TransferThis/ = 0,const char * = 0); - TQServerSocket(TQObject * /TransferThis/ = 0,const char * = 0); - - bool ok() const; - - TQ_UINT16 port() const; - - int socket() const; - virtual void setSocket(int); - - TQHostAddress address() const ; - - virtual void newConnection(int) = 0; - -protected: - TQSocketDevice *socketDevice(); -}; diff --git a/sip/qtnetwork/qsocket.sip b/sip/qtnetwork/qsocket.sip deleted file mode 100644 index ed52819..0000000 --- a/sip/qtnetwork/qsocket.sip +++ /dev/null @@ -1,241 +0,0 @@ -// This is the SIP interface definition for TQSocket. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSocket (TQt v2.2+) - - TQ_LONG readBlock - char *data - TQ_ULONG len - - -This takes a single len parameter. The -data is returned if there was no error, otherwise -Py_None is returned. - - - - TQ_LONG readLine - char *data - TQ_ULONG maxlen - - -This takes a single maxlen parameter. The -data is returned if there was no error, otherwise -Py_None is returned. - - - - TQ_LONG writeBlock - const char *data - TQ_ULONG len - - -len is derived from data and not passed -as a parameter. - - -%End - - -class TQSocket : TQObject, TQIODevice -{ -%TypeHeaderCode -#include -%End - -public: - enum Error { - ErrConnectionRefused, - ErrHostNotFound, - ErrSocketRead - }; - - TQSocket(TQObject * /TransferThis/ = 0,const char * = 0); - - enum State { - Idle, - HostLookup, - Connecting, - Connected, - Closing, - Connection - }; - -%ConvertToSubClassCode - static struct class_graph { - const char *name; - sipWrapperType **type; - int yes, no; - } graph[] = { - {sipName_TQServerSocket, &sipClass_TQServerSocket, -1, 1}, - {sipName_TQSocket, &sipClass_TQSocket, -1, 2}, - {sipName_TQFtp, &sipClass_TQFtp, -1, 3}, - {sipName_TQLocalFs, &sipClass_TQLocalFs, -1, 4}, - {sipName_TQHttp, &sipClass_TQHttp, -1, 5}, - {sipName_TQDns, &sipClass_TQDns, -1, -1}, - }; - - 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 - - State state() const; - - int socket() const; - virtual void setSocket(int); - - TQSocketDevice *socketDevice(); - virtual void setSocketDevice(TQSocketDevice *); - -%If (TQt_DNS) - virtual void connectToHost(const TQString &,TQ_UINT16) /ReleaseGIL/; -%End - TQString peerName() const; - - bool open(int) /ReleaseGIL/; - void close() /ReleaseGIL/; - void flush() /ReleaseGIL/; - Offset size() const; - Offset at() const; - bool at(Offset); - bool atEnd() const; - - TQ_ULONG bytesAvailable() const; - TQ_ULONG waitForMore(int) const /ReleaseGIL/; - //TQ_ULONG waitForMore(int,bool *) const /ReleaseGIL/; - TQ_ULONG bytesToWrite() const; - void clearPendingData(); - - 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->TQSocket::readBlock(buf, a0) : 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 - - TQ_LONG writeBlock(const char * /Array/, - TQ_ULONG /ArraySize/) /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 = 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 - - int getch() /ReleaseGIL/; - int putch(int) /ReleaseGIL/; - int ungetch(int); - - bool canReadLine() const; - virtual TQString readLine() /ReleaseGIL/; - - TQ_UINT16 port() const; - TQ_UINT16 peerPort() const; - TQHostAddress address() const; - TQHostAddress peerAddress() const; - - void setReadBufferSize(TQ_ULONG); - TQ_ULONG readBufferSize() const; - -signals: - void hostFound(); - void connected(); - void connectionClosed(); - void delayedCloseFinished(); - void readyRead(); - void bytesWritten(int); - void error(int); - -protected: - -private: - TQSocket(const TQSocket &); -}; diff --git a/sip/qtnetwork/qsocketdevice.sip b/sip/qtnetwork/qsocketdevice.sip deleted file mode 100644 index 32ee5e5..0000000 --- a/sip/qtnetwork/qsocketdevice.sip +++ /dev/null @@ -1,168 +0,0 @@ -// This is the SIP interface definition for TQSocketDevice. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSocketDevice (TQt v2.2+) - - TQ_LONG readBlock - char *data - TQ_ULONG len - - -This takes a single len parameter. The -data is returned if there was no error, otherwise -None is returned. - - - - TQ_LONG writeBlock - const char *data - TQ_ULONG len - - -len is derived from data and not passed -as a parameter. - - -%End - - -class TQSocketDevice : TQIODevice -{ -%TypeHeaderCode -#include -%End - -public: - enum Type { - Stream, - Datagram - }; - - enum Protocol { - IPv4, - IPv6, - Unknown - }; - - TQSocketDevice(Type = Stream); - TQSocketDevice(Type,Protocol,int); - TQSocketDevice(int,Type); - - bool isValid() const; - Type type() const; - Protocol protocol() const; - - int socket() const; - virtual void setSocket(int,Type); - - bool open(int) /ReleaseGIL/; - void close(); - void flush() /ReleaseGIL/; - - Offset size() const; - Offset at() const; - bool at(Offset); - bool atEnd() const; - - bool blocking() const; - virtual void setBlocking(bool); - - bool addressReusable() const; - virtual void setAddressReusable(bool); - - int receiveBufferSize() const; - virtual void setReceiveBufferSize(uint); - int sendBufferSize() const; - virtual void setSendBufferSize(uint); - - virtual bool connect(const TQHostAddress &,TQ_UINT16); - - virtual bool bind(const TQHostAddress &,TQ_UINT16); - virtual bool listen(int); - virtual int accept(); - - TQ_LONG bytesAvailable() const; - TQ_LONG waitForMore(int) const /ReleaseGIL/; - - 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->TQSocketDevice::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/; - virtual TQ_LONG writeBlock(const char * /Array/,TQ_ULONG /ArraySize/, - const TQHostAddress &,TQ_UINT16) /ReleaseGIL/; - - int getch(); - int putch(int); - int ungetch(int); - - TQ_UINT16 port() const; - TQ_UINT16 peerPort() const; - TQHostAddress address() const; - TQHostAddress peerAddress() const; - - enum Error { - NoError, - AlreadyBound, - Inaccessible, - NoResources, - Bug, - Impossible, - NoFiles, - ConnectionRefused, - NetworkFailure, - UnknownError - }; - - Error error() const; - -protected: - void setError(Error); - -private: - TQSocketDevice(const TQSocketDevice &); -}; diff --git a/sip/qtnetwork/qtnetworkmod.sip b/sip/qtnetwork/qtnetworkmod.sip deleted file mode 100644 index 88b1b45..0000000 --- a/sip/qtnetwork/qtnetworkmod.sip +++ /dev/null @@ -1,78 +0,0 @@ -// This is the SIP interface definition for the qtnetwork module of PyTQt. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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.qtnetwork 1 - -%Import qt/qtmod.sip - -%Include copying.sip - - -%Include qdns.sip -%Include qhostaddress.sip -%Include qftp.sip -%Include qhttp.sip -%Include qlocalfs.sip -%Include qnetwork.sip -%Include qserversocket.sip -%Include qsocket.sip -%Include qsocketdevice.sip - - -// The build file template. - -%Makefile qtnetwork.pro.in -# The project file for the qtnetwork module. -# -# Copyright (c) 2007 -# Riverbank Computing Limited -# -# 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 = @PYQT_MODDIR@ -CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ -INCLUDEPATH = @BLX_INCLUDEPATH@ -DEFINES = @BLX_DEFINES@ -LIBS += @PYQT_QT_MODULE@ @BLX_LIBS@ -macx:QMAKE_LFLAGS += -framework Python - -SOURCES = $B - -HEADERS = $H -%End diff --git a/sip/qtpe/copying.sip b/sip/qtpe/copying.sip deleted file mode 100644 index 6da646e..0000000 --- a/sip/qtpe/copying.sip +++ /dev/null @@ -1,51 +0,0 @@ -// This is the SIP file defining the PyTQt license. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 - -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 pyqt-internal.sip -%OptionalInclude pyqt-gpl.sip -%OptionalInclude pyqt-commercial.sip -%OptionalInclude pyqt-edu.sip -%OptionalInclude pyqt-eval.sip -%OptionalInclude pyqt-nc.sip -%OptionalInclude pyqt-tkc.sip diff --git a/sip/qtpe/qpeapplication.sip b/sip/qtpe/qpeapplication.sip deleted file mode 100644 index 9e6b99b..0000000 --- a/sip/qtpe/qpeapplication.sip +++ /dev/null @@ -1,223 +0,0 @@ -// This is the SIP interface definition for TQPEApplication. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (WS_QWS) - -class TQPEApplication : TQApplication -{ -%TypeHeaderCode -#include -#include -%End - -public: - TQPEApplication(SIP_PYLIST,Type=GuiClient) [(int &,char **,Type=GuiClient)]; -%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. - int nargc = argc; - - Py_BEGIN_ALLOW_THREADS - sipCpp = new sipTQPEApplication(nargc,argv,(TQApplication::Type)a1); - Py_END_ALLOW_THREADS - - // Now modify the original list. - updatePyArgv(a0,argc,argv); - } -%End - - ~TQPEApplication(); -%MethodCode - // See the comments in ~TQApplication() to understand what's - // being done here. - - 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 - -%ConvertToSubClassCode - // The table of Python class objects indexed by their names. The table - // must be sorted by name. - - static sipStringTypeClassMap map[] = { - {sipName_FileSelector, &sipClass_FileSelector}, - {sipName_MenuButton, &sipClass_MenuButton}, - {sipName_TQPEApplication, &sipClass_TQPEApplication}, - {sipName_TQPEMenuBar, &sipClass_TQPEMenuBar}, - {sipName_TQPEToolBar, &sipClass_TQPEToolBar}, - }; - - sipClass = sipMapStringToClass(sipCpp -> className(),map, - sizeof (map)/sizeof (map[0])); -%End - - static TQString qpeDir(); - static TQString documentDir(); - void applyStyle(); - static int defaultRotation(); - static void setDefaultRotation(int); - static void grabKeyboard(); - static void ungrabKeyboard(); - - enum StylusMode { - LeftOnly, - RightOnHold - }; - - static void setStylusOperation(TQWidget *,StylusMode); - static StylusMode stylusOperation(TQWidget *); - - enum InputMethodHint { - Normal, - AlwaysOff, - AlwaysOn - }; - - enum screenSaverHint { - Disable, - DisableLightOff, - DisableSuspend, - Enable - }; - - static void setInputMethodHint(TQWidget *,InputMethodHint); - static InputMethodHint inputMethodHint(TQWidget *); - - void showMainWidget(TQWidget *,bool = 0); - void showMainDocumentWidget(TQWidget *,bool = 0); - - static void setKeepRunning(); - bool keepRunning() const; - - int exec() /PyName=exec_loop, ReleaseGIL, - PreHook=__pyTQtPreEventLoopHook__, - PostHook=__pyTQtPostEventLoopHook__/; - -signals: - void clientMoused(); - void timeChanged(); - void clockChanged(bool); - void volumeChanged(bool); - void appMessage(const TQCString &,const TQByteArray &); - void weekChanged(bool); - void dateFormatChanged(DateFormat); - void flush(); - void reload(); - -protected: -// bool qwsEventFilter(TQWSEvent *); -// void internalSetStyle(const TQString &); - void prepareForTermination(bool); - virtual void restart(); - virtual void shutdown(); - bool eventFilter(TQObject *,TQEvent *); - void timerEvent(TQTimerEvent *); - bool keyboardGrabbed() const; - bool raiseAppropriateWindow(); - virtual void tryQuit(); - - -%TypeCode -#include - - -// Convert a Python argv list to a conventional C argc count and argv array. -static char **pyArgvToC(PyObject *argvlist,int *argcp) -{ - 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) - { - char *arg; - - // Get the argument and allocate memory for it. - if ((arg = (char *)sipBytes_AsString(PyList_GetItem(argvlist,a))) == NULL || - (argv[a] = (char *)sipMalloc(strlen(arg) + 1)) == NULL) - return NULL; - - // Copy the argument and save a pointer to it. - strcpy(argv[a],arg); - argv[a + argc + 1] = argv[a]; - } - - argv[argc + argc + 1] = argv[argc] = NULL; - - *argcp = argc; - - 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 - -}; - -%End diff --git a/sip/qtpe/qpeapplnk.sip b/sip/qtpe/qpeapplnk.sip deleted file mode 100644 index 0216bdd..0000000 --- a/sip/qtpe/qpeapplnk.sip +++ /dev/null @@ -1,157 +0,0 @@ -// This is the SIP interface definition for AppLnk, AppLnkSet, DocLnk and -// DocLnkSet. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (WS_QWS) - -class AppLnk -{ -%TypeHeaderCode -#include -%End - -public: - AppLnk(); - AppLnk(const TQString &); - AppLnk(const AppLnk &); - - bool isValid() const; - - static void setSmallIconSize(int); - static void setBigIconSize(int); - static int smallIconSize(); - static int bigIconSize(); - - TQString name() const; - const TQPixmap& pixmap() const; - const TQPixmap& bigPixmap() const; - virtual TQString exec() const /PyName=exec_property/; - TQString type() const; - TQString rotation() const; - TQString comment() const; - TQString file() const; - TQString linkFile() const; - TQStringList mimeTypes() const; - TQStringList mimeTypeIcons() const; - const TQArray &categories() const; - int id() const; - - bool fileKnown() const; - bool linkFileKnown() const; - - void execute() const /ReleaseGIL/; - void execute(const TQStringList &) const /ReleaseGIL/; - void removeFiles(); - void removeLinkFile(); - - void setName(const TQString &); - void setExec(const TQString &); - void setFile(const TQString &); - void setLinkFile(const TQString &); - void setComment(const TQString &); - void setType(const TQString &); - void setIcon(const TQString &); - void setCategories(const TQArray &); - bool writeLink() const; - - void setProperty(const TQString &,const TQString &); - TQString property(const TQString &) const; - -protected: - virtual void invoke(const TQStringList &) const; - bool ensureLinkExists() const; -// Undocumented and missing on the Zaurus. -// void storeLink() const; -}; - - -class DocLnk : AppLnk -{ -%TypeHeaderCode -#include -%End - -public: - DocLnk(); - DocLnk(const DocLnk &); - DocLnk(const TQString &); - DocLnk(const TQString &,bool); - - TQString exec() const /PyName=exec_property/; - -protected: - void invoke(const TQStringList &) const; -}; - - -class AppLnkSet -{ -%TypeHeaderCode -#include -%End - -public: - AppLnkSet(); - AppLnkSet(const TQString &); - - const AppLnk *find(int) const; - const AppLnk *findExec(const TQString &) const; - - TQStringList types() const; - TQString typeName(const TQString &) const; - TQPixmap typePixmap(const TQString &) const; - TQPixmap typeBigPixmap(const TQString &) const; - - void add(AppLnk *); - bool remove(AppLnk *); - - const TQPtrList &children() const; - void detachChildren(); - -private: - AppLnkSet(const AppLnkSet &); -}; - - -class DocLnkSet : AppLnkSet -{ -%TypeHeaderCode -#include -%End - -public: - DocLnkSet(); - DocLnkSet(const TQString &,const TQString & = TQString::null); - - const TQPtrList &children() const; - - void appendFrom(DocLnkSet &); - -private: - DocLnkSet(const DocLnkSet &); -}; - -%End diff --git a/sip/qtpe/qpeconfig.sip b/sip/qtpe/qpeconfig.sip deleted file mode 100644 index 39c788f..0000000 --- a/sip/qtpe/qpeconfig.sip +++ /dev/null @@ -1,78 +0,0 @@ -// This is the SIP interface definition for Config. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (WS_QWS) - -class Config -{ -%TypeHeaderCode -#include -%End - -public: - typedef TQMap ConfigGroup; - - enum Domain { - File, - User - }; - - Config(const TQString &,Domain = User); - - bool isValid() const; - bool hasKey(const TQString &) const; - - void setGroup(const TQString &); -// void writeEntry(const TQString &,const char *); - void writeEntry(const TQString &,const TQString &); - void writeEntryCrypt(const TQString &,const TQString &); - void writeEntry(const TQString &,int); -// void writeEntry(const TQString &,bool); - void writeEntry(const TQString &,const TQStringList &,const TQChar &); - void removeEntry(const TQString &); - - TQString readEntry(const TQString &, - const TQString & = TQString::null) const; - TQString readEntryCrypt(const TQString &, - const TQString & = TQString::null) const; - TQString readEntryDirect(const TQString &, - const TQString & = TQString::null) const; - int readNumEntry(const TQString &,int = -1) const; - bool readBoolEntry(const TQString &,bool = 0) const; - TQStringList readListEntry(const TQString &,const TQChar &) const; - - void clearGroup(); - - void write(const TQString & = TQString::null); - -protected: -// void read(); -// bool parse(const TQString &); - -// static TQString configFilename(const TQString &,Domain); -}; - -%End diff --git a/sip/qtpe/qpefilemanager.sip b/sip/qtpe/qpefilemanager.sip deleted file mode 100644 index bc7d76e..0000000 --- a/sip/qtpe/qpefilemanager.sip +++ /dev/null @@ -1,53 +0,0 @@ -// This is the SIP interface definition for FileManager. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (WS_QWS) - -class FileManager -{ -%TypeHeaderCode -#include -%End - -public: - FileManager(); - - bool saveFile(const DocLnk &,const TQByteArray &); - bool saveFile(const DocLnk &,const TQString &); - bool loadFile(const DocLnk &,TQByteArray &); - bool loadFile(const DocLnk &,TQString &); - bool copyFile(const AppLnk &,const AppLnk &); - - TQIODevice *openFile(const DocLnk &) /ReleaseGIL/; - TQIODevice *saveFile(const DocLnk &) /ReleaseGIL/; - - bool exists(const DocLnk &); - -protected: - bool ensurePathExists(const TQString &); -}; - -%End diff --git a/sip/qtpe/qpefileselector.sip b/sip/qtpe/qpefileselector.sip deleted file mode 100644 index a7d3d01..0000000 --- a/sip/qtpe/qpefileselector.sip +++ /dev/null @@ -1,69 +0,0 @@ -// This is the SIP interface definition for FileSelector and FileSelectorItem. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (WS_QWS) - -class FileSelectorItem : TQListViewItem -{ -%TypeHeaderCode -#include -%End - -public: - FileSelectorItem(TQListView * /TransferThis/,const DocLnk &); - - DocLnk file() const; -}; - - -class FileSelector : TQVBox -{ -%TypeHeaderCode -#include -%End - -public: - FileSelector(const TQString &,TQWidget * /TransferThis/,const char *, - bool = 1,bool = 1); - - void setNewVisible(bool); - void setCloseVisible(bool); - void reread(); - int fileCount(); -%If (- TQtPE_1_6_0) - const DocLnk *selected(); -%End -%If (TQtPE_1_6_0 -) - DocLnk selectedDocument(); -%End - -signals: - void fileSelected(const DocLnk &); - void newSelected(const DocLnk &); - void closeMe(); -}; - -%End diff --git a/sip/qtpe/qpefontdatabase.sip b/sip/qtpe/qpefontdatabase.sip deleted file mode 100644 index 1b250ed..0000000 --- a/sip/qtpe/qpefontdatabase.sip +++ /dev/null @@ -1,67 +0,0 @@ -// This is the SIP interface definition for FontDatabase. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (WS_QWS) - -%If (TQt_FONTDATABASE) - -class FontDatabase : TQFontDatabase -{ -%TypeHeaderCode -#include -%End - -public: - FontDatabase(); - - TQStringList families() const; - - static void loadRenderers(); -}; - -%End - - -%If (!TQt_FONTDATABASE) - -class FontDatabase -{ -%TypeHeaderCode -#include -%End - -public: - FontDatabase(); - - TQStringList families() const; - static TQValueList standardSizes(); - - static void loadRenderers(); -}; - -%End - -%End diff --git a/sip/qtpe/qpeglobal.sip b/sip/qtpe/qpeglobal.sip deleted file mode 100644 index 0810f65..0000000 --- a/sip/qtpe/qpeglobal.sip +++ /dev/null @@ -1,83 +0,0 @@ -// This is the SIP interface definition for Global. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (WS_QWS) - -class Global -{ -%TypeHeaderCode -#include -%End - -public: - Global(); - - static const TQDawg &fixedDawg(); - static const TQDawg &addedDawg(); - static const TQDawg &dawg(const TQString &); - - static void addWords(const TQStringList &); - static void addWords(const TQString &,const TQStringList &); - - static void createDocDir(); - - static void findDocuments(DocLnkSet *,const TQString & = TQString::null); - - static TQString applicationFileName(const TQString &,const TQString &); - -// struct Command { -// const char *file; -// TQWidget *(*func)(bool); -// bool maximized; -// bool documentary; -// }; - -// static void setBuiltinCommands(Command *); - -%If (- TQtPE_1_6_0) - static void invoke(const TQString &); -%End - static void execute(const TQString &,const TQString & = TQString::null) /ReleaseGIL/; - static void setDocument(TQWidget *,const TQString &); - static bool terminateBuiltin(const TQString &); - static void terminate(const AppLnk *); - - static bool isBuiltinCommand(const TQString &); - - static void applyStyle(); - static void statusMessage(const TQString &); - static TQWidget *shutdown(bool = 0); - static TQWidget *restart(bool = 0); - static void hideInputMethod(); - static void showInputMethod(); - - static void writeHWClock(); - - static TQString shellQuote(const TQString &); - static TQString stringQuote(const TQString &); -}; - -%End diff --git a/sip/qtpe/qpemenubar.sip b/sip/qtpe/qpemenubar.sip deleted file mode 100644 index d572cef..0000000 --- a/sip/qtpe/qpemenubar.sip +++ /dev/null @@ -1,42 +0,0 @@ -// This is the SIP interface definition for TQPEMenuBar. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (WS_QWS) - -class TQPEMenuBar : TQMenuBar -{ -%TypeHeaderCode -#include -%End - -public: - TQPEMenuBar(TQWidget * /TransferThis/ = 0,const char * = 0); - -protected: - virtual void keyPressEvent(TQKeyEvent *); -}; - -%End diff --git a/sip/qtpe/qpemenubutton.sip b/sip/qtpe/qpemenubutton.sip deleted file mode 100644 index 7d5da05..0000000 --- a/sip/qtpe/qpemenubutton.sip +++ /dev/null @@ -1,61 +0,0 @@ -// This is the SIP interface definition for MenuButton. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (WS_QWS) - -class MenuButton : TQPushButton -{ -%TypeHeaderCode -#include -%End - -public: - MenuButton(TQWidget * /TransferThis/,const char * = 0); - MenuButton(const TQStringList &,TQWidget * /TransferThis/, - const char * = 0); - - void clear(); - - int currentItem() const; - TQString currentText() const; - - void insertItems(const TQStringList &); - void insertItem(const TQIconSet &,const TQString & = TQString::null); - void insertItem(const TQString &); - void insertSeparator(); - - void setLabel(const TQString &); - -signals: - void selected(int); - void selected(const TQString &); - -public slots: - void select(int); - void select(const TQString &); -}; - -%End diff --git a/sip/qtpe/qpeqcopenvelope.sip b/sip/qtpe/qpeqcopenvelope.sip deleted file mode 100644 index cabb169..0000000 --- a/sip/qtpe/qpeqcopenvelope.sip +++ /dev/null @@ -1,39 +0,0 @@ -// This is the SIP interface definition for TQCopEnvelope. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (WS_QWS) - -class TQCopEnvelope : TQDataStream -{ -%TypeHeaderCode -#include -%End - -public: - TQCopEnvelope(const TQCString &,const TQCString &); -}; - -%End diff --git a/sip/qtpe/qpeqdawg.sip b/sip/qtpe/qpeqdawg.sip deleted file mode 100644 index fa24f47..0000000 --- a/sip/qtpe/qpeqdawg.sip +++ /dev/null @@ -1,65 +0,0 @@ -// This is the SIP interface definition for TQDawg. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (WS_QWS) - -class TQDawg -{ -%TypeHeaderCode -#include -%End - -public: - TQDawg(); - - bool readFile(const TQString &) /ReleaseGIL/; - bool read(TQIODevice *) /ReleaseGIL/; - bool write(TQIODevice *) const /ReleaseGIL/; - bool createFromWords(TQIODevice *); - void createFromWords(const TQStringList &); - TQStringList allWords() const; - - bool contains(const TQString &) const; - int countWords() const; - - class Node { - public: - TQChar letter() const; - bool isWord() const; - bool isLast() const; - const TQDawg::Node *next() const; - const TQDawg::Node *jump() const; - - private: - Node(); - }; - - const TQDawg::Node *root() const; - - void dump() const; -}; - -%End diff --git a/sip/qtpe/qperesource.sip b/sip/qtpe/qperesource.sip deleted file mode 100644 index 5a25680..0000000 --- a/sip/qtpe/qperesource.sip +++ /dev/null @@ -1,50 +0,0 @@ -// This is the SIP interface definition for Resource. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (WS_QWS) - -class Resource -{ -%TypeHeaderCode -#include -%End - -public: - Resource(); - - static TQImage loadImage(const TQString &); - - static TQPixmap loadPixmap(const TQString &); - static TQBitmap loadBitmap(const TQString &); - static TQString findPixmap(const TQString &); - - static TQIconSet loadIconSet(const TQString &); - - static TQString findSound(const TQString &); - static TQStringList allSounds(); -}; - -%End diff --git a/sip/qtpe/qpetimestring.sip b/sip/qtpe/qpetimestring.sip deleted file mode 100644 index 47dda55..0000000 --- a/sip/qtpe/qpetimestring.sip +++ /dev/null @@ -1,71 +0,0 @@ -// This is the SIP interface definition for DateFormat. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (WS_QWS) - -class DateFormat -{ -%TypeHeaderCode -#include -%End - -public: - enum Order { - DayMonthYear, - MonthDayYear, - YearMonthDay - }; - - DateFormat(TQChar = '/',Order = MonthDayYear); - DateFormat(TQChar,Order,Order); - DateFormat(const DateFormat &); - - enum Verbosity { - shortNumber, - longNumber, - padNumber, - shortWord, - longWord, - showWeekDay - }; - - TQString toNumberString() const; - TQString toWordString() const; - - TQString numberDate(const TQDate &,int = 0) const; - TQString wordDate(const TQDate &,int = 0) const; - -%If (TQt_DATASTREAM) - void load(TQDataStream &); - void save(TQDataStream &) const; -%End - - TQChar separator() const; - Order shortOrder() const; - Order longOrder() const; -}; - -%End diff --git a/sip/qtpe/qpetoolbar.sip b/sip/qtpe/qpetoolbar.sip deleted file mode 100644 index 10fd387..0000000 --- a/sip/qtpe/qpetoolbar.sip +++ /dev/null @@ -1,42 +0,0 @@ -// This is the SIP interface definition for TQPEToolBar. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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. - - -// The documentation is in the main documentation file because SIP isn't clever -// enough to handle the resulting %Timeline complexity. - - -%If (WS_QWS) - -class TQPEToolBar : TQToolBar -{ -%TypeHeaderCode -#include -%End - -public: - TQPEToolBar(TQMainWindow * /TransferThis/ = 0,const char * = 0); - -protected: - virtual void childEvent(TQChildEvent *); -}; - -%End diff --git a/sip/qtpe/qtpemod.sip b/sip/qtpe/qtpemod.sip deleted file mode 100644 index 9e9c62a..0000000 --- a/sip/qtpe/qtpemod.sip +++ /dev/null @@ -1,94 +0,0 @@ -// This is the SIP interface definition for the qtpe module of PyTQt. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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.qtpe 1 - -%Import qt/qtmod.sip - -%Include copying.sip - - -// TQPE has it's own version numbering. -%Timeline {TQtPE_1_5_0 TQtPE_1_6_0} - - -%ModuleHeaderCode -#include -%End - -const char *TQPE_VERSION; - - -%Include qpeapplication.sip -%Include qpeapplnk.sip -%Include qpeconfig.sip -%Include qpefilemanager.sip -%Include qpefileselector.sip -%Include qpefontdatabase.sip -%Include qpeglobal.sip -%Include qpemenubar.sip -%Include qpemenubutton.sip -%Include qpeqcopenvelope.sip -%Include qpeqdawg.sip -%Include qperesource.sip -%Include qpetimestring.sip -%Include qpetoolbar.sip - - -// The build file template. - -%Makefile qtpe.pro.in -# The project file for the qtpe module. -# -# Copyright (c) 2007 -# Riverbank Computing Limited -# -# 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 = @PYQT_MODDIR@ -CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ -INCLUDEPATH = @BLX_INCLUDEPATH@ -DEFINES = @BLX_DEFINES@ -LIBS += @PYQT_QT_MODULE@ @BLX_LIBS@ -lqpe -macx:QMAKE_LFLAGS += -framework Python - -SOURCES = $B - -HEADERS = $H -%End diff --git a/sip/qtsql/copying.sip b/sip/qtsql/copying.sip deleted file mode 100644 index 6da646e..0000000 --- a/sip/qtsql/copying.sip +++ /dev/null @@ -1,51 +0,0 @@ -// This is the SIP file defining the PyTQt license. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 - -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 pyqt-internal.sip -%OptionalInclude pyqt-gpl.sip -%OptionalInclude pyqt-commercial.sip -%OptionalInclude pyqt-edu.sip -%OptionalInclude pyqt-eval.sip -%OptionalInclude pyqt-nc.sip -%OptionalInclude pyqt-tkc.sip diff --git a/sip/qtsql/qdatabrowser.sip b/sip/qtsql/qdatabrowser.sip deleted file mode 100644 index 4aa7281..0000000 --- a/sip/qtsql/qdatabrowser.sip +++ /dev/null @@ -1,144 +0,0 @@ -// This is the SIP interface definition for TQDataBrowser. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQDataBrowser (TQt v3+) - - virtual void del - - - -This has been renamed delOnCursor in Python. - - -%End - - -class TQDataBrowser : TQWidget -{ -%TypeHeaderCode -#include -%End - -public: - TQDataBrowser(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); - - enum Boundary { - Unknown, - None, - BeforeBeginning, - Beginning, - End, - AfterEnd - }; - - Boundary boundary(); - void setBoundaryChecking(bool); - bool boundaryChecking() const; - - void setSort(const TQSqlIndex &); - void setSort(const TQStringList &); - TQStringList sort() const; - void setFilter(const TQString &); - TQString filter() const; - - virtual void setSqlCursor(TQSqlCursor * /GetWrapper/,bool = 0); -%MethodCode - Py_BEGIN_ALLOW_THREADS - sipSelfWasArg ? sipCpp->TQDataBrowser::setSqlCursor(a0, a1) : sipCpp->setSqlCursor(a0, a1); - Py_END_ALLOW_THREADS - - // Transfer ownership of the cursor if the autoDelete flag is - // set. - if (a0 && a1) - sipTransferTo(a0Wrapper,sipSelf); -%End - - TQSqlCursor* sqlCursor() const; - virtual void setForm(TQSqlForm *); - TQSqlForm* form(); - - virtual void setConfirmEdits(bool); - virtual void setConfirmInsert(bool); - virtual void setConfirmUpdate(bool); - virtual void setConfirmDelete(bool); - virtual void setConfirmCancels(bool); - bool confirmEdits() const; - bool confirmInsert() const; - bool confirmUpdate() const; - bool confirmDelete() const; - bool confirmCancels() const; - - virtual void setReadOnly(bool); - bool isReadOnly() const; - virtual void setAutoEdit(bool); - bool autoEdit() const; - - virtual bool seek(int,bool = 0) /ReleaseGIL/; - -signals: - void firstRecordAvailable(bool); - void lastRecordAvailable(bool); - void nextRecordAvailable(bool); - void prevRecordAvailable(bool); - - void currentChanged(const TQSqlRecord *); - void primeInsert(TQSqlRecord *); - void primeUpdate(TQSqlRecord *); - void primeDelete(TQSqlRecord *); - void beforeInsert(TQSqlRecord *); - void beforeUpdate(TQSqlRecord *); - void beforeDelete(TQSqlRecord *); - void cursorChanged(TQSqlCursor::Mode); - -public slots: - virtual void refresh(); - - virtual void insert() /ReleaseGIL/; - virtual void update() /ReleaseGIL/; - virtual void del() /PyName=delOnCursor, ReleaseGIL/; - - virtual void first() /ReleaseGIL/; - virtual void last() /ReleaseGIL/; - virtual void next() /ReleaseGIL/; - virtual void prev() /ReleaseGIL/; - - virtual void readFields(); - virtual void writeFields(); - virtual void clearValues(); - - void updateBoundary(); - -protected: - virtual bool insertCurrent() /ReleaseGIL/; - virtual bool updateCurrent() /ReleaseGIL/; - virtual bool deleteCurrent() /ReleaseGIL/; - virtual bool currentEdited(); - - virtual TQSql::Confirm confirmEdit(TQSql::Op) /ReleaseGIL/; - virtual TQSql::Confirm confirmCancel(TQSql::Op) /ReleaseGIL/; - - virtual void handleError(const TQSqlError &) /ReleaseGIL/; - -private: - TQDataBrowser(const TQDataBrowser &); -}; diff --git a/sip/qtsql/qdatatable.sip b/sip/qtsql/qdatatable.sip deleted file mode 100644 index 5840f3e..0000000 --- a/sip/qtsql/qdatatable.sip +++ /dev/null @@ -1,185 +0,0 @@ -// This is the SIP interface definition for TQDataTable. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQDataTable (TQt v3+) - -TQDataTable is fully implemented. - - -%End - - -class TQDataTable : TQTable -{ -%TypeHeaderCode -#include -%End - -public: - TQDataTable(TQWidget* /TransferThis/ = 0,const char * = 0); - TQDataTable(TQSqlCursor *,bool = 0,TQWidget * /TransferThis/ = 0, - const char * = 0); - - virtual void addColumn(const TQString &,const TQString & = TQString::null, - int = -1,const TQIconSet & = TQIconSet()); - virtual void removeColumn(uint); - virtual void setColumn(uint,const TQString &, - const TQString & = TQString::null,int = -1, - const TQIconSet & = TQIconSet()); - - TQString nullText() const; - TQString trueText() const; - TQString falseText() const; - DateFormat dateFormat() const; - bool confirmEdits() const; - bool confirmInsert() const; - bool confirmUpdate() const; - bool confirmDelete() const; - bool confirmCancels() const; - bool autoDelete() const; - bool autoEdit() const; - TQString filter() const; - TQStringList sort() const; - - virtual void setSqlCursor(TQSqlCursor * /GetWrapper/ = 0,bool = 0,bool = 0); -%MethodCode - Py_BEGIN_ALLOW_THREADS - sipSelfWasArg ? sipCpp->TQDataTable::setSqlCursor(a0, a1, a2) : sipCpp->setSqlCursor(a0, a1, a2); - Py_END_ALLOW_THREADS - - // Transfer ownership of the cursor if the autoDelete flag is - // set. - if (a0 && a2) - sipTransferTo(a0Wrapper,sipSelf); -%End - - TQSqlCursor *sqlCursor() const; - - virtual void setNullText(const TQString &); - virtual void setTrueText(const TQString &); - virtual void setFalseText(const TQString &); - virtual void setDateFormat(const DateFormat); - virtual void setConfirmEdits(bool); - virtual void setConfirmInsert(bool); - virtual void setConfirmUpdate(bool); - virtual void setConfirmDelete(bool); - virtual void setConfirmCancels(bool); - virtual void setAutoDelete(bool); - virtual void setAutoEdit(bool); - virtual void setFilter(const TQString &); - virtual void setSort(const TQStringList &); - virtual void setSort(const TQSqlIndex &); - - enum Refresh { - RefreshData, - RefreshColumns, - RefreshAll - }; - - void refresh(Refresh); - void sortColumn(int,bool = 1,bool = 0); - TQString text(int,int) const; - TQVariant value(int,int) const; - TQSqlRecord *currentRecord() const; - - void installEditorFactory(TQSqlEditorFactory * /Transfer/); - void installPropertyMap(TQSqlPropertyMap * /Transfer/); - - int numCols() const; - int numRows() const; - void setNumCols(int); - void setNumRows(int); - bool findBuffer(const TQSqlIndex &,int = 0); - - void hideColumn(int); - void showColumn(int); - -signals: - void currentChanged(TQSqlRecord *); - void primeInsert(TQSqlRecord *); - void primeUpdate(TQSqlRecord *); - void primeDelete(TQSqlRecord *); - void beforeInsert(TQSqlRecord *); - void beforeUpdate(TQSqlRecord *); - void beforeDelete(TQSqlRecord *); - void cursorChanged(TQSql::Op); - -public slots: - virtual void find(const TQString &,bool,bool); - virtual void sortAscending(int); - virtual void sortDescending(int); - virtual void refresh(); - void setColumnWidth(int,int); - void adjustColumn(int); - void setColumnStretchable(int,bool); - void swapColumns(int,int,bool = 0); - -protected: - virtual bool insertCurrent(); - virtual bool updateCurrent(); - virtual bool deleteCurrent(); - - virtual TQSql::Confirm confirmEdit(TQSql::Op); - virtual TQSql::Confirm confirmCancel(TQSql::Op); - - virtual void handleError(const TQSqlError &); - - virtual bool beginInsert(); - virtual TQWidget *beginUpdate(int,int,bool); - - bool eventFilter(TQObject *,TQEvent *); - void keyPressEvent(TQKeyEvent *); - void resizeEvent(TQResizeEvent *); - void contentsMousePressEvent(TQMouseEvent *); - void contentsContextMenuEvent(TQContextMenuEvent *); - void endEdit(int,int,bool,bool); - - // We don't specify /Factory/ for this because the returned TQWidget - // will always have a parent which will own it. - TQWidget *createEditor(int,int,bool) const; - - void activateNextCell(); - int indexOf(uint) const; - void reset(); - void setSize(TQSqlCursor *); - void repaintCell(int,int); - void paintCell(TQPainter *,int,int,const TQRect &,bool, - const TQColorGroup &); - virtual void paintField(TQPainter *,const TQSqlField *,const TQRect &, - bool); - void drawContents(TQPainter *,int,int,int,int); - virtual int fieldAlignment(const TQSqlField *); - void columnClicked(int); - void resizeData(int); - - TQTableItem *item(int,int) const; - void setItem(int,int,TQTableItem *); - void clearCell(int,int); - void setPixmap(int,int,const TQPixmap &); - void takeItem(TQTableItem *); - -private: - TQWidget *beginEdit(int,int,bool); - - TQDataTable(const TQDataTable &); -}; diff --git a/sip/qtsql/qdataview.sip b/sip/qtsql/qdataview.sip deleted file mode 100644 index cfa3c98..0000000 --- a/sip/qtsql/qdataview.sip +++ /dev/null @@ -1,54 +0,0 @@ -// This is the SIP interface definition for TQDataView. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQDataView (TQt v3+) - -TQDataView is fully implemented. - - -%End - - -class TQDataView : TQWidget -{ -%TypeHeaderCode -#include -%End - -public: - TQDataView(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); - - virtual void setForm(TQSqlForm *); - TQSqlForm *form(); - virtual void setRecord(TQSqlRecord *); - TQSqlRecord *record(); - -public slots: - virtual void refresh(TQSqlRecord *); - virtual void readFields(); - virtual void writeFields(); - virtual void clearValues(); - -private: - TQDataView(const TQDataView &); -}; diff --git a/sip/qtsql/qeditorfactory.sip b/sip/qtsql/qeditorfactory.sip deleted file mode 100644 index 4208d90..0000000 --- a/sip/qtsql/qeditorfactory.sip +++ /dev/null @@ -1,49 +0,0 @@ -// This is the SIP interface definition for TQEditorFactory. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQEditorFactory (TQt v3+) - -TQEditorFactory is fully implemented. - - -%End - - -class TQEditorFactory : TQObject -{ -%TypeHeaderCode -#include -%End - -public: - TQEditorFactory(TQObject * /TransferThis/ = 0,const char * = 0); - - virtual TQWidget *createEditor(TQWidget * /TransferThis/, - const TQVariant &) /Factory/; - - static TQEditorFactory *defaultFactory(); - static void installDefaultFactory(TQEditorFactory * /Transfer/); - -private: - TQEditorFactory(const TQEditorFactory &); -}; diff --git a/sip/qtsql/qsql.sip b/sip/qtsql/qsql.sip deleted file mode 100644 index 727134e..0000000 --- a/sip/qtsql/qsql.sip +++ /dev/null @@ -1,74 +0,0 @@ -// This is the SIP interface definition for TQSql. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSql (TQt v3+) - -TQSql is fully implemented. - - -%End - - -class TQSql -{ -%TypeHeaderCode -#include -%End - -public: - TQSql(); - - enum Op { - None, - Insert, - Update, - Delete - }; - - enum Location { - BeforeFirst, - AfterLast - }; - - enum Confirm { - Cancel, - No, - Yes - }; - - enum ParameterType { - In, - Out, - InOut - }; - - enum TableType { - Tables, - SystemTables, - Views, - AllTables - }; - -private: - TQSql(const TQSql &); -}; diff --git a/sip/qtsql/qsqlcursor.sip b/sip/qtsql/qsqlcursor.sip deleted file mode 100644 index 76f258e..0000000 --- a/sip/qtsql/qsqlcursor.sip +++ /dev/null @@ -1,140 +0,0 @@ -// This is the SIP interface definition for TQSqlCursor. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSqlCursor (TQt v3+) - - virtual int del - bool invalidate = TRUE - - -This has been renamed delRecords in Python. - - - - virtual int del - const TQString &filter - bool invalidate = TRUE - - -This has been renamed delRecords in Python. - - - - bool exec - const TQString &query - - -This has been renamed execQuery in Python. - - -%End - - -class TQSqlCursor : TQSqlRecord, TQSqlQuery -{ -%TypeHeaderCode -#include -%End - -public: - TQSqlCursor(const TQString & = TQString::null,bool = 1,TQSqlDatabase * = 0); - TQSqlCursor(const TQSqlCursor &); - - enum Mode { - ReadOnly, - Insert, - Update, - Delete, - Writable - }; - - TQVariant value(int) const; - TQVariant value(const TQString &) const; - void setValue(int,const TQVariant &); - void setValue(const TQString &,const TQVariant &); - virtual TQSqlIndex primaryIndex(bool = 1) const; - virtual TQSqlIndex index(const TQStringList &) const; - TQSqlIndex index(const TQString &) const; -// TQSqlIndex index(const char *) const; - virtual void setPrimaryIndex(const TQSqlIndex &); - - virtual void append(const TQSqlFieldInfo &); - virtual void insert(int,const TQSqlFieldInfo &); - void remove(int); - void clear(); - void setGenerated(const TQString &,bool); - void setGenerated(int,bool); - - virtual TQSqlRecord *editBuffer(bool = 0); - virtual TQSqlRecord *primeInsert(); - virtual TQSqlRecord *primeUpdate(); - virtual TQSqlRecord *primeDelete(); - virtual int insert(bool = 1) /ReleaseGIL/; - virtual int update(bool = 1) /ReleaseGIL/; - virtual int del(bool = 1) /PyName=delRecords, ReleaseGIL/; - - virtual void setMode(int); - int mode() const; - virtual void setCalculated(const TQString &,bool); - bool isCalculated(const TQString &) const; - virtual void setTrimmed(const TQString &,bool); - bool isTrimmed(const TQString &) const; - - bool isReadOnly() const; - bool canInsert() const; - bool canUpdate() const; - bool canDelete() const; - - bool select() /ReleaseGIL/; - bool select(const TQSqlIndex &) /ReleaseGIL/; - bool select(const TQSqlIndex &,const TQSqlIndex &) /ReleaseGIL/; - virtual bool select(const TQString &,const TQSqlIndex & = TQSqlIndex()) /ReleaseGIL/; - - virtual void setSort(const TQSqlIndex &); - TQSqlIndex sort() const; - virtual void setFilter(const TQString &); - TQString filter() const; - virtual void setName(const TQString &,bool = 1); - TQString name() const; - TQString toString(const TQString & = TQString::null, - const TQString & = ",") const; - - bool isNull(int) const; - bool isNull(const TQString &) const; - -protected: - void afterSeek(); - bool exec(const TQString &) /PyName=execQuery, ReleaseGIL/; - - virtual TQVariant calculateField(const TQString &); - virtual int update(const TQString &,bool = 1); - virtual int del(const TQString &,bool = 1) /PyName=delRecords, ReleaseGIL/; - - virtual TQString toString(const TQString &,TQSqlField *, - const TQString &) const; - virtual TQString toString(TQSqlRecord *,const TQString &,const TQString &, - const TQString &) const; - virtual TQString toString(const TQSqlIndex &,TQSqlRecord *, - const TQString &,const TQString &, - const TQString &) const; -}; diff --git a/sip/qtsql/qsqldatabase.sip b/sip/qtsql/qsqldatabase.sip deleted file mode 100644 index cab38d2..0000000 --- a/sip/qtsql/qsqldatabase.sip +++ /dev/null @@ -1,135 +0,0 @@ -// This is the SIP interface definition for TQSqlDatabase. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSqlDatabase (TQt v3+) - - TQSqlQuery exec - const TQString &query = TQString::null - - -This has been renamed execStatement in Python. - - -%End - - -class TQSqlDatabase : TQObject -{ -%TypeHeaderCode -#include -%End - -public: -%ConvertToSubClassCode - static struct class_graph { - const char *name; - sipWrapperType **type; - int yes, no; - } graph[] = { - {sipName_TQSqlDriver, &sipClass_TQSqlDriver, -1, 1}, - {sipName_TQEditorFactory, &sipClass_TQEditorFactory, 7, 2}, - {sipName_TQSqlDatabase, &sipClass_TQSqlDatabase, -1, 3}, - {sipName_TQSqlForm, &sipClass_TQSqlForm, -1, 4}, - {sipName_TQDataView, &sipClass_TQDataView, -1, 5}, - {sipName_TQDataTable, &sipClass_TQDataTable, -1, 6}, - {sipName_TQDataBrowser, &sipClass_TQDataBrowser, -1, -1}, - {sipName_TQSqlEditorFactory, &sipClass_TQSqlEditorFactory, -1, -1}, - }; - - 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 - - bool open() /ReleaseGIL/; - bool open(const TQString &,const TQString &) /ReleaseGIL/; - void close(); - bool ping(); - bool isOpen() const; - bool isOpenError() const; - TQStringList tables() const; - TQStringList tables(TQSql::TableType) const; - TQSqlIndex primaryIndex(const TQString &) const; - TQSqlRecord record(const TQString &) const; - TQSqlRecord record(const TQSqlQuery &) const; - TQSqlRecordInfo recordInfo(const TQString &) const; - TQSqlRecordInfo recordInfo(const TQSqlQuery &) const; - TQSqlQuery exec(const TQString & = TQString::null) const /PyName=execStatement, ReleaseGIL/; - TQSqlError lastError() const; - - bool transaction(); - bool commit(); - bool rollback(); - - virtual void setDatabaseName(const TQString &); - virtual void setUserName(const TQString &); - virtual void setPassword(const TQString &); - virtual void setHostName(const TQString &); - virtual void setPort(int); - void setConnectOptions(const TQString & = TQString::null); - TQString databaseName() const; - TQString userName() const; - TQString password() const; - TQString hostName() const; - TQString driverName() const; - int port() const; - TQString connectOptions() const; - - TQSqlDriver *driver() const; - - static TQSqlDatabase *addDatabase(const TQString &, - const TQString & = TQString(TQSqlDatabase::defaultConnection)); - static TQSqlDatabase *addDatabase(TQSqlDriver *, - const TQString & = TQString(TQSqlDatabase::defaultConnection)); - static TQSqlDatabase *database(const TQString & = TQString(TQSqlDatabase::defaultConnection),bool = 1); - static void removeDatabase(const TQString &); - static void removeDatabase(TQSqlDatabase *); - static bool contains(const TQString & = TQString(TQSqlDatabase::defaultConnection)); - static TQStringList drivers(); -// static void registerSqlDriver(const TQString &, -// const TQSqlDriverCreatorBase *); - static bool isDriverAvailable(const TQString &); - -protected: - TQSqlDatabase(const TQString &,const TQString &, - TQObject * /TransferThis/ = 0,const char * = 0); - TQSqlDatabase(TQSqlDriver *,TQObject * /TransferThis/ = 0, - const char * = 0); - -private: - TQSqlDatabase(const TQSqlDatabase &); -}; diff --git a/sip/qtsql/qsqldriver.sip b/sip/qtsql/qsqldriver.sip deleted file mode 100644 index 74aede8..0000000 --- a/sip/qtsql/qsqldriver.sip +++ /dev/null @@ -1,86 +0,0 @@ -// This is the SIP interface definition for TQSqlDriver. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSqlDriver (TQt v3+) - -TQSqlDriver is fully implemented. - - -%End - - -class TQSqlDriver : TQObject -{ -%TypeHeaderCode -#include -%End - -public: - enum DriverFeature { - Transactions, - QuerySize, - BLOB, - Unicode, - PreparedQueries, - NamedPlaceholders, - PositionalPlaceholders - }; - - TQSqlDriver(TQObject * /TransferThis/ = 0,const char * = 0); - - bool isOpen() const; - bool isOpenError() const; - - virtual bool beginTransaction(); - virtual bool commitTransaction(); - virtual bool rollbackTransaction(); - virtual TQStringList tables(const TQString &) const; - virtual TQSqlIndex primaryIndex(const TQString &) const; - virtual TQSqlRecord record(const TQString &) const; - virtual TQSqlRecord record(const TQSqlQuery &) const; - virtual TQSqlRecordInfo recordInfo(const TQString &) const; - virtual TQSqlRecordInfo recordInfo(const TQSqlQuery &) const; - virtual TQString nullText() const; - virtual TQString formatValue(const TQSqlField *,bool = 0) const; - TQSqlError lastError() const; - - virtual bool hasFeature(DriverFeature) const = 0; - virtual bool open(const TQString &,const TQString & = TQString::null, - const TQString & = TQString::null, - const TQString & = TQString::null, - int = -1) = 0 /ReleaseGIL/; - virtual void close() = 0; - virtual bool ping() = 0; - virtual TQSqlQuery createQuery() const = 0; - - bool open(const TQString &,const TQString &,const TQString &, - const TQString &,int,const TQString &) /ReleaseGIL/; - -protected: - virtual void setOpen(bool); - virtual void setOpenError(bool); - virtual void setLastError(const TQSqlError &); - -private: - TQSqlDriver(const TQSqlDriver &); -}; diff --git a/sip/qtsql/qsqleditorfactory.sip b/sip/qtsql/qsqleditorfactory.sip deleted file mode 100644 index cf0d361..0000000 --- a/sip/qtsql/qsqleditorfactory.sip +++ /dev/null @@ -1,51 +0,0 @@ -// This is the SIP interface definition for TQSqlEditorFactory. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSqlEditorFactory (TQt v3+) - -TQSqlEditorFactory is fully implemented. - - -%End - - -class TQSqlEditorFactory : TQEditorFactory -{ -%TypeHeaderCode -#include -%End - -public: - TQSqlEditorFactory(TQObject * /TransferThis/ = 0,const char * = 0); - - virtual TQWidget *createEditor(TQWidget * /TransferThis/, - const TQVariant &) /Factory/; - virtual TQWidget *createEditor(TQWidget * /TransferThis/, - const TQSqlField *) /Factory/; - - static TQSqlEditorFactory *defaultFactory(); - static void installDefaultFactory(TQSqlEditorFactory * /Transfer/); - -private: - TQSqlEditorFactory(const TQSqlEditorFactory &); -}; diff --git a/sip/qtsql/qsqlerror.sip b/sip/qtsql/qsqlerror.sip deleted file mode 100644 index ae9dd70..0000000 --- a/sip/qtsql/qsqlerror.sip +++ /dev/null @@ -1,62 +0,0 @@ -// This is the SIP interface definition for TQSqlError. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSqlError (TQt v3+) - -TQSqlError is fully implemented. - - -%End - - -class TQSqlError -{ -%TypeHeaderCode -#include -%End - -public: - enum Type { - None, - Connection, - Statement, - Transaction, - Unknown - }; - - TQSqlError(const TQString & = TQString::null, - const TQString & = TQString::null,int = TQSqlError::None, - int = -1); - TQSqlError(const TQSqlError &); - - TQString driverText() const; - virtual void setDriverText(const TQString &); - TQString databaseText() const; - virtual void setDatabaseText(const TQString &); - int type() const; - virtual void setType(int); - int number() const; - virtual void setNumber(int); - TQString text() const; - void showMessage(const TQString & = TQString::null) const; -}; diff --git a/sip/qtsql/qsqlfield.sip b/sip/qtsql/qsqlfield.sip deleted file mode 100644 index c54e0f5..0000000 --- a/sip/qtsql/qsqlfield.sip +++ /dev/null @@ -1,91 +0,0 @@ -// This is the SIP interface definition for TQSqlField and TQSqlFieldInfo. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSqlField (TQt v3+) - -TQSqlField is fully implemented. - - - -TQSqlFieldInfo (TQt v3+) - -TQSqlFieldInfo is fully implemented. - - -%End - - -class TQSqlField -{ -%TypeHeaderCode -#include -%End - -public: - TQSqlField(const TQString & = TQString::null, - TQVariant::Type = TQVariant::Invalid ); - TQSqlField(const TQSqlField &); - - virtual void setValue(const TQVariant &); - virtual TQVariant value() const; - virtual void setName(const TQString &); - TQString name() const; - virtual void setNull(); - bool isNull() const; - virtual void setReadOnly(bool); - bool isReadOnly() const; - void clear(bool = 1); - TQVariant::Type type() const; -}; - - -class TQSqlFieldInfo -{ -%TypeHeaderCode -#include -%End - -public: - TQSqlFieldInfo(const TQString & = TQString::null, - TQVariant::Type = TQVariant::Invalid,int = -1,int = -1, - int = -1,const TQVariant & = TQVariant(),int = 0,bool = 1, - bool = 0,bool = 0); - TQSqlFieldInfo(const TQSqlFieldInfo &); - TQSqlFieldInfo(const TQSqlField &,bool = 1); - - TQSqlField toField() const; - int isRequired() const; - TQVariant::Type type() const; - int length() const; - int precision() const; - TQVariant defaultValue() const; - TQString name() const; - int typeID() const; - bool isGenerated() const; - bool isTrim() const; - bool isCalculated() const; - - virtual void setTrim(bool); - virtual void setGenerated(bool); - virtual void setCalculated(bool); -}; diff --git a/sip/qtsql/qsqlform.sip b/sip/qtsql/qsqlform.sip deleted file mode 100644 index 9a03610..0000000 --- a/sip/qtsql/qsqlform.sip +++ /dev/null @@ -1,68 +0,0 @@ -// This is the SIP interface definition for TQSqlForm. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSqlForm (TQt v3+) - -TQSqlForm is fully implemented. - - -%End - - -class TQSqlForm : TQObject -{ -%TypeHeaderCode -#include -%End - -public: - TQSqlForm(TQObject * /TransferThis/ = 0,const char * = 0); - - virtual void insert(TQWidget *,const TQString &); - virtual void remove(const TQString &); - uint count() const; - - TQWidget *widget(uint) const; - TQSqlField *widgetToField(TQWidget *) const; - TQWidget *fieldToWidget(TQSqlField *) const; - - void installPropertyMap(TQSqlPropertyMap * /Transfer/); - - virtual void setRecord(TQSqlRecord *); - -public slots: - virtual void readField(TQWidget *); - virtual void writeField(TQWidget *); - virtual void readFields(); - virtual void writeFields(); - - virtual void clear(); - virtual void clearValues(bool = 0); - -protected: - virtual void insert(TQWidget *,TQSqlField *); - virtual void remove(TQWidget *); - -private: - TQSqlForm(const TQSqlForm &); -}; diff --git a/sip/qtsql/qsqlindex.sip b/sip/qtsql/qsqlindex.sip deleted file mode 100644 index 5e6db25..0000000 --- a/sip/qtsql/qsqlindex.sip +++ /dev/null @@ -1,60 +0,0 @@ -// This is the SIP interface definition for TQSqlIndex. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSqlIndex (TQt v3+) - -TQSqlIndex is fully implemented. - - -%End - - -class TQSqlIndex : TQSqlRecord -{ -%TypeHeaderCode -#include -%End - -public: - TQSqlIndex(const TQString & = TQString::null, - const TQString & = TQString::null); - TQSqlIndex(const TQSqlIndex &); - - virtual void setCursorName(const TQString &); - TQString cursorName() const; - virtual void setName(const TQString &); - TQString name() const; - - void append(const TQSqlField &); - virtual void append(const TQSqlField &,bool); - - bool isDescending(int) const; - virtual void setDescending(int,bool); - - TQString toString(const TQString & = TQString::null,const TQString & = ",", - bool = 1) const; - TQStringList toStringList(const TQString & = TQString::null, - bool = 1) const; - - static TQSqlIndex fromStringList(const TQStringList &,const TQSqlCursor *); -}; diff --git a/sip/qtsql/qsqlpropertymap.sip b/sip/qtsql/qsqlpropertymap.sip deleted file mode 100644 index 9e7b9ea..0000000 --- a/sip/qtsql/qsqlpropertymap.sip +++ /dev/null @@ -1,59 +0,0 @@ -// This is the SIP interface definition for TQSqlPropertyMap. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSqlPropertyMap (TQt v3+) - -TQSqlPropertyMap is fully implemented. However, because PyTQt -does not allow new properties to be defined, it is not possible to implement -custom editor widgets in Python and add them to a property map. These will -simply be ignored. - - - -This problem may be addressed in a future release of PyTQt. - - -%End - - -class TQSqlPropertyMap -{ -%TypeHeaderCode -#include -%End - -public: - TQSqlPropertyMap(); - - TQVariant property(TQWidget *); - virtual void setProperty(TQWidget *,const TQVariant &); - - void insert(const TQString &,const TQString &); - void remove(const TQString &); - - static TQSqlPropertyMap *defaultMap(); - static void installDefaultMap(TQSqlPropertyMap * /Transfer/); - -private: - TQSqlPropertyMap(const TQSqlPropertyMap &); -}; diff --git a/sip/qtsql/qsqlquery.sip b/sip/qtsql/qsqlquery.sip deleted file mode 100644 index 8212391..0000000 --- a/sip/qtsql/qsqlquery.sip +++ /dev/null @@ -1,103 +0,0 @@ -// This is the SIP interface definition for TQSqlQuery. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSqlQuery (TQt v3+) - - TQMap<TQString,TQVariant> boundValues const - - - -Not yet implemented. (TQt v3.2.0+) - - - - virtual bool exec - const TQString &query - - -This has been renamed execQuery in Python. - - - - bool exec - - - -This has been renamed execQuery in Python. (TQt v3.1+) - - -%End - - -class TQSqlQuery -{ -%TypeHeaderCode -#include -%End - -public: - TQSqlQuery(TQSqlResult *); - TQSqlQuery(const TQString & = TQString::null,TQSqlDatabase * = 0); - TQSqlQuery(TQSqlDatabase *); - TQSqlQuery(const TQSqlQuery &); - - bool isValid() const; - bool isActive() const; - bool isNull(int) const; - int at() const; - TQString lastQuery() const; - int numRowsAffected() const; - TQSqlError lastError() const; - bool isSelect() const; - int size() const; - const TQSqlDriver *driver() const; - const TQSqlResult *result() const; - bool isForwardOnly() const; - void setForwardOnly(bool); - - virtual bool exec(const TQString &) /PyName=execQuery, ReleaseGIL/; - virtual TQVariant value(int) const; - - virtual bool seek(int,bool = 0) /ReleaseGIL/; - virtual bool next() /ReleaseGIL/; - virtual bool prev() /ReleaseGIL/; - virtual bool first() /ReleaseGIL/; - virtual bool last() /ReleaseGIL/; - - bool exec() /PyName=execQuery, ReleaseGIL/; - bool prepare(const TQString &); - void bindValue(const TQString &,const TQVariant &); - void bindValue(int,const TQVariant &); - void addBindValue(const TQVariant &); - void bindValue(const TQString &,const TQVariant &,TQSql::ParameterType); - void bindValue(int,const TQVariant &,TQSql::ParameterType); - void addBindValue(const TQVariant &,TQSql::ParameterType); - TQVariant boundValue(const TQString &) const; - TQVariant boundValue(int) const; -// TQMap boundValues() const; - TQString executedQuery() const; - -protected: - virtual void beforeSeek(); - virtual void afterSeek(); -}; diff --git a/sip/qtsql/qsqlrecord.sip b/sip/qtsql/qsqlrecord.sip deleted file mode 100644 index 4e79fac..0000000 --- a/sip/qtsql/qsqlrecord.sip +++ /dev/null @@ -1,171 +0,0 @@ -// This is the SIP interface definition for TQSqlRecord and TQSqlRecordInfo. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSqlRecord (TQt v3+) - -TQSqlRecord is fully implemented. - - - -TQSqlRecordInfo (TQt v3+) - -TQSqlRecordInfo is implemented as a Python list of -TQSqlFieldInfo instances. - - -%End - - -class TQSqlRecord -{ -%TypeHeaderCode -#include -%End - -public: - TQSqlRecord(); - TQSqlRecord(const TQSqlRecord &); - - virtual TQVariant value(int) const; - virtual TQVariant value(const TQString &) const; - virtual void setValue(int,const TQVariant &); - virtual void setValue(const TQString &,const TQVariant &); - bool isGenerated(int) const; - bool isGenerated(const TQString &) const; - virtual void setGenerated(const TQString &,bool); - virtual void setGenerated(int,bool); - virtual void setNull(int); - virtual void setNull(const TQString &); - bool isNull(int); - bool isNull(const TQString &); -// bool isNull(int) const; -// bool isNull(const TQString &) const; - - int position(const TQString &) const; - TQString fieldName(int) const; - TQSqlField *field(int); - TQSqlField *field(const TQString &); -// const TQSqlField *field(int) const; -// const TQSqlField *field(const TQString &) const; - - virtual void append(const TQSqlField &); - virtual void insert(int,const TQSqlField &); - virtual void remove(int); - - bool isEmpty() const; - bool contains(const TQString &) const; - virtual void clear(); - virtual void clearValues(bool = 0); - uint count() const; - virtual TQString toString(const TQString & = TQString::null, - const TQString & = ",") const; - virtual TQStringList toStringList(const TQString & = TQString::null) const; -}; - - -%MappedType TQSqlRecordInfo -{ -%TypeHeaderCode -#include -%End - -%ConvertFromTypeCode - // Convert to a Python list of TQSqlFieldInfo instances. - - int i; - PyObject *l; - - // Create the list. - - if ((l = PyList_New(sipCpp -> count())) == NULL) - return NULL; - - // Get it. - - i = 0; - TQValueListConstIterator it; - - for (it = sipCpp -> begin(); it != sipCpp -> end(); ++it) - { - PyObject *tmobj; - - if ((tmobj = sipConvertFromNewInstance(new TQSqlFieldInfo(*it),sipClass_TQSqlFieldInfo,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0) - { - Py_XDECREF(tmobj); - Py_DECREF(l); - - return NULL; - } - - ++i; - } - - return l; -%End - - -%ConvertToTypeCode - // Convert a Python list of TQSqlFieldInfo instances to a TQSqlRecordInfo - // 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_TQSqlFieldInfo,SIP_NOT_NONE)) - return 0; - - return 1; - } - - TQSqlRecordInfo *qri = new TQSqlRecordInfo; - - 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. - TQSqlFieldInfo *itm = reinterpret_cast(sipConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_TQSqlFieldInfo,0,SIP_NOT_NONE,&state,&iserr)); - - if (iserr) - { - sipReleaseInstance(itm,sipClass_TQSqlFieldInfo,state); - - *sipIsErr = 1; - delete qri; - - return 0; - } - - qri -> append(*itm); - - sipReleaseInstance(itm,sipClass_TQSqlFieldInfo,state); - } - - *sipCppPtr = qri; - - return sipGetState(sipTransferObj); -%End -}; diff --git a/sip/qtsql/qsqlresult.sip b/sip/qtsql/qsqlresult.sip deleted file mode 100644 index 144f355..0000000 --- a/sip/qtsql/qsqlresult.sip +++ /dev/null @@ -1,69 +0,0 @@ -// This is the SIP interface definition for TQSqlResult. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSqlResult (TQt v3+) - -TQSqlResult is fully implemented. - - -%End - - -class TQSqlResult -{ -%TypeHeaderCode -#include -%End - -protected: - TQSqlResult(const TQSqlDriver *); - - int at() const; - TQString lastQuery() const; - TQSqlError lastError() const; - bool isValid() const; - bool isActive() const; - bool isSelect() const; - bool isForwardOnly() const; - const TQSqlDriver *driver() const; - virtual void setAt(int); - virtual void setActive(bool); - virtual void setLastError(const TQSqlError &); - virtual void setQuery(const TQString &); - virtual void setSelect(bool); - virtual void setForwardOnly(bool); - - virtual TQVariant data(int) = 0; - virtual bool isNull(int) = 0; - virtual bool reset(const TQString &) = 0; - virtual bool fetch(int) = 0; - virtual bool fetchNext(); - virtual bool fetchPrev(); - virtual bool fetchFirst() = 0; - virtual bool fetchLast() = 0; - virtual int size() = 0; - virtual int numRowsAffected() = 0; - -private: - TQSqlResult(const TQSqlResult &); -}; diff --git a/sip/qtsql/qsqlselectcursor.sip b/sip/qtsql/qsqlselectcursor.sip deleted file mode 100644 index a33fee3..0000000 --- a/sip/qtsql/qsqlselectcursor.sip +++ /dev/null @@ -1,88 +0,0 @@ -// This is the SIP interface definition for TQSqlSelectCursor. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQSqlSelectCursor (TQt v3.2.0+) - - int del - bool invalidate = TRUE - - -This has been renamed delRecords in Python. - - - - bool exec - const TQString &query - - -This has been renamed execQuery in Python. - - -%End - - -class TQSqlSelectCursor : TQSqlCursor -{ -%TypeHeaderCode -#include -%End - -public: - TQSqlSelectCursor(const TQString & = TQString::null,TQSqlDatabase * = 0); - TQSqlSelectCursor(const TQSqlSelectCursor &); - ~TQSqlSelectCursor(); - - bool exec(const TQString &) /PyName=execQuery, ReleaseGIL/; - bool select() /ReleaseGIL/; - -protected: - TQSqlIndex primaryIndex(bool = 1) const; - TQSqlIndex index(const TQStringList &) const; - TQSqlIndex index(const TQString &) const; -// TQSqlIndex index(const char *) const; - void setPrimaryIndex(const TQSqlIndex &); - void append(const TQSqlFieldInfo &); - void insert(int,const TQSqlFieldInfo &); - void remove(int); - void clear(); - void setGenerated(const TQString &,bool); - void setGenerated(int,bool); - TQSqlRecord *editBuffer(bool = 0); - TQSqlRecord *primeInsert(); - TQSqlRecord *primeUpdate(); - TQSqlRecord *primeDelete(); - int insert(bool = 1) /ReleaseGIL/; - int update(bool = 1) /ReleaseGIL/; - int del(bool = 1) /PyName=delRecords, ReleaseGIL/; - void setMode(int); - - void setSort(const TQSqlIndex &); - TQSqlIndex sort() const; - void setFilter(const TQString &); - TQString filter() const; - void setName(const TQString &,bool = 1); - TQString name() const; - TQString toString(const TQString & = TQString::null, - const TQString & = ",") const; - bool select(const TQString &,const TQSqlIndex & = TQSqlIndex()) /ReleaseGIL/; -}; diff --git a/sip/qtsql/qtsqlmod.sip b/sip/qtsql/qtsqlmod.sip deleted file mode 100644 index a1847ac..0000000 --- a/sip/qtsql/qtsqlmod.sip +++ /dev/null @@ -1,88 +0,0 @@ -// This is the SIP interface definition for the qtsql module of PyTQt. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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.qtsql 1 - -%Import qt/qtmod.sip -%Import qttable/qttablemod.sip - -%Include copying.sip - - -%Include qdatabrowser.sip -%Include qdatatable.sip -%Include qdataview.sip -%Include qeditorfactory.sip -%Include qsql.sip -%Include qsqlcursor.sip -%Include qsqldatabase.sip -%Include qsqldriver.sip -%Include qsqleditorfactory.sip -%Include qsqlerror.sip -%Include qsqlfield.sip -%Include qsqlform.sip -%Include qsqlindex.sip -%Include qsqlpropertymap.sip -%Include qsqlquery.sip -%Include qsqlrecord.sip -%Include qsqlresult.sip -%Include qsqlselectcursor.sip - - -// The build file template. - -%Makefile qtsql.pro.in -# The project file for the qtsql module. -# -# Copyright (c) 2007 -# Riverbank Computing Limited -# -# 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 = @PYQT_MODDIR@ -CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ -INCLUDEPATH = @BLX_INCLUDEPATH@ -DEFINES = @BLX_DEFINES@ -LIBS += @PYQT_QTTABLE_MODULE@ @BLX_LIBS@ -macx:QMAKE_LFLAGS += -framework Python - -SOURCES = $B - -HEADERS = $H -%End diff --git a/sip/qttable/copying.sip b/sip/qttable/copying.sip deleted file mode 100644 index 6da646e..0000000 --- a/sip/qttable/copying.sip +++ /dev/null @@ -1,51 +0,0 @@ -// This is the SIP file defining the PyTQt license. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 - -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 pyqt-internal.sip -%OptionalInclude pyqt-gpl.sip -%OptionalInclude pyqt-commercial.sip -%OptionalInclude pyqt-edu.sip -%OptionalInclude pyqt-eval.sip -%OptionalInclude pyqt-nc.sip -%OptionalInclude pyqt-tkc.sip diff --git a/sip/qttable/qtable.sip b/sip/qttable/qtable.sip deleted file mode 100644 index 8b19fea..0000000 --- a/sip/qttable/qtable.sip +++ /dev/null @@ -1,441 +0,0 @@ -// This is the SIP interface definition for TQTable, TQTableItem, -// TQCheckTableItem, TQComboTableItem and TQTableSelection. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQTable (TQt v2.2+) - -TQTable is fully implemented. - - - -TQTableItem (TQt v2.2+) - -TQTableItem is fully implemented. - - - -TQCheckTableItem (TQt v3+) - -TQCheckTableItem is fully implemented. - - - -TQComboTableItem (TQt v3+) - -TQComboTableItem is fully implemented. - - - -TQTableSelection (TQt v2.2+) - -TQTableSelection is fully implemented. - - -%End - - -%If (TQt_TABLE) - -class TQTableSelection -{ -%TypeHeaderCode -#include -%End - -public: - TQTableSelection(); - TQTableSelection(int,int,int,int); - - void init(int,int); - void expandTo(int,int); - - int topRow() const; - int bottomRow() const; - int leftCol() const; - int rightCol() const; - int anchorRow() const; - int anchorCol() const; - int numRows() const; - int numCols() const; - - bool isActive() const; - bool isEmpty() const; -}; - - -class TQTableItem : TQt -{ -%TypeHeaderCode -#include -%End - -public: - enum EditType { - Never, - OnTyping, - WhenCurrent, - Always - }; - - // Note that the TQt documentation is wrong. Ownership is only taken by - // TQTable::setItem(). - TQTableItem(TQTable *,EditType); - TQTableItem(TQTable *,EditType,const TQString &); - TQTableItem(TQTable *,EditType,const TQString &,const TQPixmap &); - -%ConvertToSubClassCode - Py_BEGIN_ALLOW_THREADS - - int rtti = sipCpp -> rtti(); - - if (rtti == TQCheckTableItem::RTTI) - sipClass = sipClass_TQCheckTableItem; - else if (rtti == TQComboTableItem::RTTI) - sipClass = sipClass_TQComboTableItem; - else - sipClass = 0; - - Py_END_ALLOW_THREADS -%End - - virtual TQPixmap pixmap() const; - virtual TQString text() const; - virtual void setPixmap(const TQPixmap &); - virtual void setText(const TQString &); - TQTable *table() const; - - virtual int alignment() const; - virtual void setWordWrap(bool); - bool wordWrap() const; - - EditType editType() const; - virtual TQWidget *createEditor() const /Factory/; - virtual void setContentFromEditor(TQWidget *); - virtual void setReplaceable(bool); - bool isReplaceable() const; - - virtual TQString key() const; - virtual TQSize sizeHint() const; - - virtual void setSpan(int,int); - int rowSpan() const; - int colSpan() const; - - virtual void setRow(int); - virtual void setCol(int); - int row() const; - int col() const; - - virtual void paint(TQPainter *,const TQColorGroup &,const TQRect &,bool); - - void updateEditor(int,int); - - virtual void setEnabled(bool); - bool isEnabled() const; - - virtual int rtti() const; -}; - - -class TQComboTableItem : TQTableItem -{ -%TypeHeaderCode -#include -%End - -public: - // Note that the TQt documentation is wrong. Ownership is only taken by - // TQTable::setItem(). - TQComboTableItem(TQTable *,const TQStringList &,bool = 0); - - virtual TQWidget *createEditor() const /Factory/; - virtual void setContentFromEditor(TQWidget *); - virtual void paint(TQPainter *,const TQColorGroup &,const TQRect &,bool); - virtual void setCurrentItem(int); - virtual void setCurrentItem(const TQString &); - int currentItem() const; - TQString currentText() const; - int count() const; - TQString text(int) const; - virtual void setEditable(bool); - bool isEditable() const; - virtual void setStringList(const TQStringList &); - - int rtti() const; - - TQSize sizeHint() const; -}; - - -class TQCheckTableItem : TQTableItem -{ -%TypeHeaderCode -#include -%End - -public: - // Note that the TQt documentation is wrong. Ownership is only taken by - // TQTable::setItem(). - TQCheckTableItem(TQTable *,const TQString &); - - void setText(const TQString &); - virtual TQWidget *createEditor() const /Factory/; - virtual void setContentFromEditor(TQWidget *); - virtual void paint(TQPainter *,const TQColorGroup &,const TQRect &,bool); - virtual void setChecked(bool); - bool isChecked() const; - - int rtti() const; - - TQSize sizeHint() const; -}; - - -class TQTable : TQScrollView -{ -%TypeHeaderCode -#include -%End - -public: - TQTable(TQWidget * /TransferThis/ = 0,const char * = 0); - TQTable(int,int,TQWidget * /TransferThis/ = 0,const char * = 0); - -%ConvertToSubClassCode - sipClass = (sipCpp->inherits(sipName_TQTable) ? sipClass_TQTable : NULL); -%End - - TQHeader *horizontalHeader() const; - TQHeader *verticalHeader() const; - - enum SelectionMode { - Single, - Multi, - SingleRow, - MultiRow, - NoSelection - }; - - virtual void setSelectionMode(SelectionMode); - SelectionMode selectionMode() const; - - virtual void setItem(int,int,TQTableItem * /Transfer/); - virtual void setText(int,int,const TQString &); - virtual void setPixmap(int,int,const TQPixmap &); - virtual TQTableItem *item(int,int) const; - virtual TQString text(int,int) const; - virtual TQPixmap pixmap(int,int) const; - virtual void clearCell(int,int); - - virtual TQRect cellGeometry(int,int) const; - virtual int columnWidth(int) const; - virtual int rowHeight(int) const; - virtual int columnPos(int) const; - virtual int rowPos(int) const; - virtual int columnAt(int) const; - virtual int rowAt(int) const; - - virtual int numRows() const; - virtual int numCols() const; - - void updateCell(int,int); - - bool eventFilter(TQObject *,TQEvent *); - - int currentRow() const; - int currentColumn() const; - void ensureCellVisible(int,int); - - bool isSelected(int,int) const; - bool isRowSelected(int,bool = 0) const; - bool isColumnSelected(int,bool = 0) const; - int numSelections() const; - TQTableSelection selection(int) const; - virtual int addSelection(const TQTableSelection &); - virtual void removeSelection(const TQTableSelection &); - virtual void removeSelection(int); - virtual int currentSelection() const; - - void selectCells(int,int,int,int); - void selectRow(int); - void selectColumn(int); - - bool showGrid() const; - - bool columnMovingEnabled() const; - bool rowMovingEnabled() const; - - virtual void sortColumn(int,bool = 1,bool = 0); - - bool sorting() const; - - virtual void takeItem(TQTableItem * /TransferBack/); - - virtual void setCellWidget(int,int,TQWidget * /Transfer/); - virtual TQWidget *cellWidget(int,int) const; - virtual void clearCellWidget(int,int); - - virtual TQRect cellRect(int,int) const; - - virtual void paintCell(TQPainter *,int,int,const TQRect &,bool); - virtual void paintCell(TQPainter *,int,int,const TQRect &,bool, - const TQColorGroup &); - virtual void paintFocus(TQPainter *,const TQRect &); - TQSize sizeHint() const; - - bool isReadOnly() const; - bool isRowReadOnly(int) const; - bool isColumnReadOnly(int) const; - - void setEnabled(bool); - - void repaintSelections(); - - enum FocusStyle { - FollowStyle, - SpreadSheet - }; - - virtual void setFocusStyle(FocusStyle); - FocusStyle focusStyle() const; - - void updateHeaderStates(); - -public slots: - virtual void setNumRows(int); - virtual void setNumCols(int); - virtual void setShowGrid(bool); - virtual void hideRow(int); - virtual void hideColumn(int); - virtual void showRow(int); - virtual void showColumn(int); - bool isRowHidden(int) const; - bool isColumnHidden(int) const; - - virtual void setColumnWidth(int,int); - virtual void setRowHeight(int,int); - - virtual void adjustColumn(int); - virtual void adjustRow(int); - - virtual void setColumnStretchable(int,bool); - virtual void setRowStretchable(int,bool); - bool isColumnStretchable(int) const; - bool isRowStretchable(int) const; - virtual void setSorting(bool); - virtual void swapRows(int,int,bool = 0); - virtual void swapColumns(int,int,bool = 0); - virtual void swapCells(int,int,int,int); - - virtual void setLeftMargin(int); - virtual void setTopMargin(int); - virtual void setCurrentCell(int,int); - void clearSelection(bool = 1); - virtual void setColumnMovingEnabled(bool); - virtual void setRowMovingEnabled(bool); - - virtual void setReadOnly(bool); - virtual void setRowReadOnly(int,bool); - virtual void setColumnReadOnly(int,bool); - - virtual void setDragEnabled(bool); - bool dragEnabled() const; - - virtual void insertRows(int,int = 1); - virtual void insertColumns(int,int = 1); - virtual void removeRow(int); - virtual void removeRows(const TQMemArray &); - virtual void removeColumn(int); - virtual void removeColumns(const TQMemArray &); - - virtual void editCell(int,int,bool = 0); - - void setRowLabels(const TQStringList &); - void setColumnLabels(const TQStringList &); - -protected: - enum EditMode { - NotEditing, - Editing, - Replacing - }; - - void drawContents(TQPainter *,int,int,int,int); - void contentsMousePressEvent(TQMouseEvent *); - void contentsMouseMoveEvent(TQMouseEvent *); - void contentsMouseDoubleClickEvent(TQMouseEvent *); - void contentsMouseReleaseEvent(TQMouseEvent *); - void contentsContextMenuEvent(TQContextMenuEvent *); - void keyPressEvent(TQKeyEvent *); - void focusInEvent(TQFocusEvent *); - void focusOutEvent(TQFocusEvent *); - void viewportResizeEvent(TQResizeEvent *); - void showEvent(TQShowEvent *); - void paintEvent(TQPaintEvent *); - void setEditMode(EditMode,int,int); - virtual void contentsDragEnterEvent(TQDragEnterEvent *); - virtual void contentsDragMoveEvent(TQDragMoveEvent *); - virtual void contentsDragLeaveEvent(TQDragLeaveEvent *); - virtual void contentsDropEvent(TQDropEvent *); - virtual TQDragObject *dragObject(); - virtual void startDrag(); - - virtual void paintEmptyArea(TQPainter *,int,int,int,int); - virtual void activateNextCell(); - virtual TQWidget *createEditor(int,int,bool) const /Factory/; - virtual void setCellContentFromEditor(int,int); - virtual TQWidget *beginEdit(int,int,bool); - virtual void endEdit(int,int,bool,bool); - - virtual void resizeData(int); - virtual void insertWidget(int,int,TQWidget *); - int indexOf(int,int) const; - - void windowActivationChange(bool); - bool isEditing() const; - EditMode editMode() const; - int currEditRow() const; - int currEditCol() const; - -protected slots: - virtual void columnWidthChanged(int); - virtual void rowHeightChanged(int); - virtual void columnIndexChanged(int,int,int); - virtual void rowIndexChanged(int,int,int); - virtual void columnClicked(int); - -signals: - void currentChanged(int,int); - void clicked(int,int,int,const TQPoint &); - void doubleClicked(int,int,int,const TQPoint &); - void pressed(int,int,int,const TQPoint &); - void selectionChanged(); - void valueChanged(int,int); - void contextMenuRequested(int,int,const TQPoint &); - void dropped(TQDropEvent *); - -private: - TQTable(const TQTable &); -}; - -%End diff --git a/sip/qttable/qttablemod.sip b/sip/qttable/qttablemod.sip deleted file mode 100644 index 66523cc..0000000 --- a/sip/qttable/qttablemod.sip +++ /dev/null @@ -1,70 +0,0 @@ -// This is the SIP interface definition for the qttable module of PyTQt. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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.qttable 1 - -%Import qt/qtmod.sip - -%Include copying.sip - - -%Include qtable.sip - - -// The build file template. - -%Makefile qttable.pro.in -# The project file for the qttable module. -# -# Copyright (c) 2007 -# Riverbank Computing Limited -# -# 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 = @PYQT_MODDIR@ -CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ -INCLUDEPATH = @BLX_INCLUDEPATH@ -DEFINES = @BLX_DEFINES@ -LIBS += @PYQT_QT_MODULE@ @BLX_LIBS@ -macx:QMAKE_LFLAGS += -framework Python - -SOURCES = $B - -HEADERS = $H -%End diff --git a/sip/qtui/copying.sip b/sip/qtui/copying.sip deleted file mode 100644 index 6da646e..0000000 --- a/sip/qtui/copying.sip +++ /dev/null @@ -1,51 +0,0 @@ -// This is the SIP file defining the PyTQt license. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 - -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 pyqt-internal.sip -%OptionalInclude pyqt-gpl.sip -%OptionalInclude pyqt-commercial.sip -%OptionalInclude pyqt-edu.sip -%OptionalInclude pyqt-eval.sip -%OptionalInclude pyqt-nc.sip -%OptionalInclude pyqt-tkc.sip diff --git a/sip/qtui/qtuimod.sip b/sip/qtui/qtuimod.sip deleted file mode 100644 index 9e61e98..0000000 --- a/sip/qtui/qtuimod.sip +++ /dev/null @@ -1,71 +0,0 @@ -// This is the SIP interface definition for the qtui module of PyTQt. Thanks to -// Hans-Peter Jansen for the original work. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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.qtui 1 - -%Import qt/qtmod.sip - -%Include copying.sip - - -%Include qwidgetfactory.sip - - -// The build file template. - -%Makefile qtui.pro.in -# The project file for the qtui module. -# -# Copyright (c) 2007 -# Riverbank Computing Limited -# -# 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 = @PYQT_MODDIR@ -CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ -INCLUDEPATH = @BLX_INCLUDEPATH@ -DEFINES = @BLX_DEFINES@ -LIBS += @PYQT_QT_MODULE@ @PYQT_QUI_LIB@ @BLX_LIBS@ -macx:QMAKE_LFLAGS += -framework Python - -SOURCES = $B - -HEADERS = $H -%End diff --git a/sip/qtui/qwidgetfactory.sip b/sip/qtui/qwidgetfactory.sip deleted file mode 100644 index c58c477..0000000 --- a/sip/qtui/qwidgetfactory.sip +++ /dev/null @@ -1,57 +0,0 @@ -// This is the SIP interface definition for TQWidgetFactory. Thanks to -// Hans-Peter Jansen for the original work. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQWidgetFactory (TQt v3+) - -TQWidgetFactory is fully implemented. - - -%End - - -class TQWidgetFactory -{ -%TypeHeaderCode -#include -%End - -public: - TQWidgetFactory(); - virtual ~TQWidgetFactory(); - - static TQWidget *create(const TQString &,TQObject * = 0, - TQWidget * /TransferThis/ = 0, - const char * = 0) /Factory/; - static TQWidget *create(TQIODevice *,TQObject * = 0, - TQWidget * /TransferThis/ = 0, - const char * = 0) /Factory/; - static void addWidgetFactory(TQWidgetFactory * /Transfer/); - static void loadImages(const TQString &); - - virtual TQWidget *createWidget(const TQString &,TQWidget * /TransferThis/, - const char *) const /Factory/; - - static TQStringList widgets(); - static bool supportsWidget(const TQString &); -}; diff --git a/sip/qtxml/copying.sip b/sip/qtxml/copying.sip deleted file mode 100644 index 6da646e..0000000 --- a/sip/qtxml/copying.sip +++ /dev/null @@ -1,51 +0,0 @@ -// This is the SIP file defining the PyTQt license. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 - -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 pyqt-internal.sip -%OptionalInclude pyqt-gpl.sip -%OptionalInclude pyqt-commercial.sip -%OptionalInclude pyqt-edu.sip -%OptionalInclude pyqt-eval.sip -%OptionalInclude pyqt-nc.sip -%OptionalInclude pyqt-tkc.sip diff --git a/sip/qtxml/qdom.sip b/sip/qtxml/qdom.sip deleted file mode 100644 index 2dc3a9d..0000000 --- a/sip/qtxml/qdom.sip +++ /dev/null @@ -1,826 +0,0 @@ -// This is the SIP interface definition for the TQDom classes. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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 -TQDomImplementation (TQt v2.2+) - -TQDomImplementation is fully implemented. - - - -TQDomNode (TQt v2.2+) - -TQDomNode is fully implemented, including the Python -== and != operators. - - - -TQDomNodeList (TQt v2.2+) - -TQDomNodeList is fully implemented. - - - -TQDomDocument (TQt v2.2+) - - bool setContent - const TQCString &buffer - bool namespaceProcessing - TQString *errorMsg = 0 - int *errorLine = 0 - int *errorColumn = 0 - - -This takes the buffer and -namespaceProcessing parameters and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+) - - - - bool setContent - const TQByteArray &buffer - bool namespaceProcessing - TQString *errorMsg = 0 - int *errorLine = 0 - int *errorColumn = 0 - - -This takes the buffer and -namespaceProcessing parameters and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+) - - - - bool setContent - const TQString &text - bool namespaceProcessing - TQString *errorMsg = 0 - int *errorLine = 0 - int *errorColumn = 0 - - -This takes the text and -namespaceProcessing parameters and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+) - - - - bool setContent - const TQIODevice *dev - bool namespaceProcessing - TQString *errorMsg = 0 - int *errorLine = 0 - int *errorColumn = 0 - - -This takes the dev and -namespaceProcessing parameters and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+) - - - - bool setContent - const TQCString &buffer - TQString *errorMsg = 0 - int *errorLine = 0 - int *errorColumn = 0 - - -This takes the buffer parameter only and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+) - - - - bool setContent - const TQByteArray &buffer - TQString *errorMsg = 0 - int *errorLine = 0 - int *errorColumn = 0 - - -This takes the buffer parameter only and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+) - - - - bool setContent - const TQString &text - TQString *errorMsg = 0 - int *errorLine = 0 - int *errorColumn = 0 - - -This takes the text parameter only and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+) - - - - bool setContent - const TQIODevice *dev - TQString *errorMsg = 0 - int *errorLine = 0 - int *errorColumn = 0 - - -This takes the dev parameter only and returns a tuple -containing the bool result and the -errorMsg, errorLine and -errorColumn values. (TQt v3+) - - - - bool setContent - TQXmlInputSource *source - TQXmlReader *reader - TQString *errorMsg = 0 - int *errorLine = 0 - int *errorColumn = 0 - - -Not yet implemented. (TQt v3.2.0+) - - - -TQDomDocumentFragment (TQt v2.2+) - -TQDomDocumentFragment is fully implemented. - - - -TQDomDocumentType (TQt v2.2+) - -TQDomDocumentType is fully implemented. - - - -TQDomNamedNodeMap (TQt v2.2+) - -TQDomNamedNodeMap is fully implemented. - - - -TQDomCharacterData (TQt v2.2+) - -TQDomCharacterData is fully implemented. - - - -TQDomAttr (TQt v2.2+) - -TQDomAttr is fully implemented. - - - -TQDomElement (TQt v2.2+) - -TQDomElement is fully implemented. - - - -TQDomText (TQt v2.2+) - -TQDomText is fully implemented. - - - -TQDomComment (TQt v2.2+) - -TQDomComment is fully implemented. - - - -TQDomCDATASection (TQt v2.2+) - -TQDomCDATASection is fully implemented. - - - -TQDomNotation (TQt v2.2+) - -TQDomNotation is fully implemented. - - - -TQDomEntity (TQt v2.2+) - -TQDomEntity is fully implemented. - - - -TQDomEntityReference (TQt v2.2+) - -TQDomEntityReference is fully implemented. - - - -TQDomProcessingInstruction (TQt v2.2+) - -TQDomProcessingInstruction is fully implemented. - - -%End - - -%If (TQt_DOM) - -class TQDomImplementation -{ -%TypeHeaderCode -#include -%End - -public: - TQDomImplementation(); - TQDomImplementation(const TQDomImplementation &); - - virtual bool hasFeature(const TQString &,const TQString &); - virtual TQDomDocumentType createDocumentType(const TQString &, - const TQString &, - const TQString &); - virtual TQDomDocument createDocument(const TQString &,const TQString &, - const TQDomDocumentType &); - bool isNull(); -}; - - -class TQDomNode -{ -%TypeHeaderCode -#include -%End - -public: - enum NodeType { - ElementNode, - AttributeNode, - TextNode, - CDATASectionNode, - EntityReferenceNode, - EntityNode, - ProcessingInstructionNode, - CommentNode, - DocumentNode, - DocumentTypeNode, - DocumentFragmentNode, - NotationNode, - BaseNode, - CharacterDataNode - }; - - TQDomNode(); - TQDomNode(const TQDomNode &); - - bool operator==(const TQDomNode &) const; - bool operator!=(const TQDomNode &) const; - - virtual TQDomNode insertBefore(const TQDomNode &,const TQDomNode &); - virtual TQDomNode insertAfter(const TQDomNode &,const TQDomNode &); - virtual TQDomNode replaceChild(const TQDomNode &,const TQDomNode &); - virtual TQDomNode removeChild(const TQDomNode &); - virtual TQDomNode appendChild(const TQDomNode &); - virtual bool hasChildNodes() const; - virtual TQDomNode cloneNode(bool = 1) const; - virtual void normalize(); - virtual bool isSupported(const TQString &,const TQString &) const; - - virtual TQString nodeName() const; - virtual NodeType nodeType() const; - virtual TQDomNode parentNode() const; - virtual TQDomNodeList childNodes() const; - virtual TQDomNode firstChild() const; - virtual TQDomNode lastChild() const; - virtual TQDomNode previousSibling() const; - virtual TQDomNode nextSibling() const; - virtual TQDomNamedNodeMap attributes() const; - virtual TQDomDocument ownerDocument() const; - virtual TQString namespaceURI() const; - virtual TQString localName() const; - virtual bool hasAttributes() const; - - virtual TQString nodeValue() const; - virtual void setNodeValue(const TQString &); - virtual TQString prefix() const; - virtual void setPrefix(const TQString &); - - virtual bool isAttr() const; - virtual bool isCDATASection() const; - virtual bool isDocumentFragment() const; - virtual bool isDocument() const; - virtual bool isDocumentType() const; - virtual bool isElement() const; - virtual bool isEntityReference() const; - virtual bool isText() const; - virtual bool isEntity() const; - virtual bool isNotation() const; - virtual bool isProcessingInstruction() const; - virtual bool isCharacterData() const; - virtual bool isComment() const; - - TQDomNode namedItem(const TQString &) const; - - bool isNull() const; - void clear(); - - TQDomAttr toAttr(); - TQDomCDATASection toCDATASection(); - TQDomDocumentFragment toDocumentFragment(); - TQDomDocument toDocument(); - TQDomDocumentType toDocumentType(); - TQDomElement toElement(); - TQDomEntityReference toEntityReference(); - TQDomText toText(); - TQDomEntity toEntity(); - TQDomNotation toNotation(); - TQDomProcessingInstruction toProcessingInstruction(); - TQDomCharacterData toCharacterData(); - TQDomComment toComment(); - - void save(TQTextStream &,int) const; -}; - - -class TQDomNodeList -{ -%TypeHeaderCode -#include -%End - -public: - TQDomNodeList(); - TQDomNodeList(const TQDomNodeList &); - - virtual TQDomNode item(int) const; - - virtual uint length() const; - uint count() const; -}; - - -class TQDomDocumentType : TQDomNode -{ -%TypeHeaderCode -#include -%End - -public: - TQDomDocumentType(); - TQDomDocumentType(const TQDomDocumentType &); - - virtual TQString name() const; - virtual TQDomNamedNodeMap entities() const; - virtual TQDomNamedNodeMap notations() const; - virtual TQString publicId() const; - virtual TQString systemId() const; - virtual TQString internalSubset() const; - - TQDomNode::NodeType nodeType() const; - bool isDocumentType() const; -}; - - -class TQDomDocument : TQDomNode -{ -%TypeHeaderCode -#include -%End - -public: - TQDomDocument(); - TQDomDocument(const TQString &); - TQDomDocument(const TQDomDocumentType &); - TQDomDocument(const TQDomDocument &); - - TQDomElement createElement(const TQString &); - TQDomDocumentFragment createDocumentFragment(); - TQDomText createTextNode(const TQString &); - TQDomComment createComment(const TQString &); - TQDomCDATASection createCDATASection(const TQString &); - TQDomProcessingInstruction createProcessingInstruction(const TQString &, - const TQString &); - TQDomAttr createAttribute(const TQString &); - TQDomEntityReference createEntityReference(const TQString &); - TQDomNodeList elementsByTagName(const TQString &) const; - TQDomElement elementById(const TQString &); - - TQDomDocumentType doctype() const; - TQDomImplementation implementation() const; - TQDomElement documentElement() const; - - // Note that we need handwritten code for these because of the need to - // allocate storage for the error string. - SIP_PYTUPLE setContent(const TQCString &,bool); -%MethodCode - bool res; - TQString *emsg = new TQString(); - int eline, ecol; - - Py_BEGIN_ALLOW_THREADS - res = sipCpp -> TQDomDocument::setContent(*a0,a1,emsg,&eline,&ecol); - Py_END_ALLOW_THREADS - - sipRes = sipBuildResult(&sipIsErr, "(bNii)", res, emsg, - sipType_TQString, (PyObject *)0, eline, ecol); -%End - - SIP_PYTUPLE setContent(const TQByteArray &,bool); -%MethodCode - bool res; - TQString *emsg = new TQString(); - int eline, ecol; - - Py_BEGIN_ALLOW_THREADS - res = sipCpp -> TQDomDocument::setContent(*a0,a1,emsg,&eline,&ecol); - Py_END_ALLOW_THREADS - - sipRes = sipBuildResult(&sipIsErr, "(bNii)", res, emsg, - sipType_TQString, (PyObject *)0, eline, ecol); -%End - - SIP_PYTUPLE setContent(const TQString &,bool); -%MethodCode - bool res; - TQString *emsg = new TQString(); - int eline, ecol; - - Py_BEGIN_ALLOW_THREADS - res = sipCpp -> TQDomDocument::setContent(*a0,a1,emsg,&eline,&ecol); - Py_END_ALLOW_THREADS - - sipRes = sipBuildResult(&sipIsErr, "(bNii)", res, emsg, - sipType_TQString, (PyObject *)0, eline, ecol); -%End - - SIP_PYTUPLE setContent(TQIODevice *,bool); -%MethodCode - bool res; - TQString *emsg = new TQString(); - int eline, ecol; - - Py_BEGIN_ALLOW_THREADS - res = sipCpp -> TQDomDocument::setContent(a0,a1,emsg,&eline,&ecol); - Py_END_ALLOW_THREADS - - sipRes = sipBuildResult(&sipIsErr, "(bNii)", res, emsg, - sipType_TQString, (PyObject *)0, eline, ecol); -%End - - SIP_PYTUPLE setContent(const TQCString &); -%MethodCode - bool res; - TQString *emsg = new TQString(); - int eline, ecol; - - Py_BEGIN_ALLOW_THREADS - res = sipCpp -> TQDomDocument::setContent(*a0,emsg,&eline,&ecol); - Py_END_ALLOW_THREADS - - sipRes = sipBuildResult(&sipIsErr, "(bNii)", res, emsg, - sipType_TQString, (PyObject *)0, eline, ecol); -%End - - SIP_PYTUPLE setContent(const TQByteArray &); -%MethodCode - bool res; - TQString *emsg = new TQString(); - int eline, ecol; - - Py_BEGIN_ALLOW_THREADS - res = sipCpp -> TQDomDocument::setContent(*a0,emsg,&eline,&ecol); - Py_END_ALLOW_THREADS - - sipRes = sipBuildResult(&sipIsErr, "(bNii)", res, emsg, - sipType_TQString, (PyObject *)0, eline, ecol); -%End - - SIP_PYTUPLE setContent(const TQString &); -%MethodCode - bool res; - TQString *emsg = new TQString(); - int eline, ecol; - - Py_BEGIN_ALLOW_THREADS - res = sipCpp -> TQDomDocument::setContent(*a0,emsg,&eline,&ecol); - Py_END_ALLOW_THREADS - - sipRes = sipBuildResult(&sipIsErr, "(bNii)", res, emsg, - sipType_TQString, (PyObject *)0, eline, ecol); -%End - - SIP_PYTUPLE setContent(TQIODevice *); -%MethodCode - bool res; - TQString *emsg = new TQString(); - int eline, ecol; - - Py_BEGIN_ALLOW_THREADS - res = sipCpp -> TQDomDocument::setContent(a0,emsg,&eline,&ecol); - Py_END_ALLOW_THREADS - - sipRes = sipBuildResult(&sipIsErr, "(bNii)", res, emsg, - sipType_TQString, (PyObject *)0, eline, ecol); -%End - -// bool setContent(TQXmlInputSource *,TQXmlReader *,TQString * = 0,int * = 0, -// int * = 0); - - TQDomNode::NodeType nodeType() const; - bool isDocument() const; - - TQString toString() const; - TQString toString(int) const; - TQCString toCString() const; - TQCString toCString(int) const; -}; - - -class TQDomNamedNodeMap -{ -%TypeHeaderCode -#include -%End - -public: - TQDomNamedNodeMap(); - TQDomNamedNodeMap(const TQDomNamedNodeMap &); - - TQDomNode namedItem(const TQString &) const; - TQDomNode setNamedItem(const TQDomNode &); - TQDomNode removeNamedItem(const TQString &); - TQDomNode item(int) const; - TQDomNode namedItemNS(const TQString &,const TQString &) const; - TQDomNode setNamedItemNS(const TQDomNode &); - TQDomNode removeNamedItemNS(const TQString &,const TQString &); - - uint length() const; - uint count() const; - - bool contains(const TQString &) const; -}; - - -class TQDomDocumentFragment : TQDomNode -{ -%TypeHeaderCode -#include -%End - -public: - TQDomDocumentFragment(); - TQDomDocumentFragment(const TQDomDocumentFragment &); - - TQDomNode::NodeType nodeType() const; - bool isDocumentFragment() const; -}; - - -class TQDomCharacterData : TQDomNode -{ -%TypeHeaderCode -#include -%End - -public: - TQDomCharacterData(); - TQDomCharacterData(const TQDomCharacterData &); - - virtual TQString substringData(unsigned long,unsigned long); - virtual void appendData(const TQString &); - virtual void insertData(unsigned long,const TQString &); - virtual void deleteData(unsigned long,unsigned long); - virtual void replaceData(unsigned long,unsigned long,const TQString &); - - virtual uint length() const; - - virtual TQString data() const; - virtual void setData(const TQString &); - - TQDomNode::NodeType nodeType() const; - bool isCharacterData() const; -}; - - -class TQDomAttr : TQDomNode -{ -%TypeHeaderCode -#include -%End - -public: - TQDomAttr(); - TQDomAttr(const TQDomAttr&); - - virtual TQString name() const; - virtual bool specified() const; - virtual TQDomElement ownerElement() const; - - virtual TQString value() const; - virtual void setValue(const TQString &); - - TQDomNode::NodeType nodeType() const; - bool isAttr() const; -}; - - -class TQDomElement : TQDomNode -{ -%TypeHeaderCode -#include -%End - -public: - TQDomElement(); - TQDomElement(const TQDomElement &); - - TQString attribute(const TQString &, - const TQString & = TQString::null) const; - void setAttribute(const TQString &,const TQString &); - void setAttribute(const TQString &,int /Constrained/); -// void setAttribute(const TQString &,uint); -// void setAttribute(const TQString &,long); -// void setAttribute(const TQString &,ulong); - void setAttribute(const TQString &,double); - void removeAttribute(const TQString &); - TQDomAttr attributeNode(const TQString &); - TQDomAttr setAttributeNode(const TQDomAttr &); - TQDomAttr removeAttributeNode(const TQDomAttr &); - virtual TQDomNodeList elementsByTagName(const TQString &) const; - bool hasAttribute(const TQString &) const; - - TQString attributeNS(const TQString,const TQString &, - const TQString &) const; - void setAttributeNS(const TQString,const TQString &,const TQString &); - void setAttributeNS(const TQString,const TQString &,int /Constrained/); -// void setAttributeNS(const TQString,const TQString &,uint); -// void setAttributeNS(const TQString &,const TQString &,long); -// void setAttributeNS(const TQString &,const TQString &,ulong); - void setAttributeNS(const TQString,const TQString &,double); - void removeAttributeNS(const TQString &,const TQString &); - TQDomAttr attributeNodeNS(const TQString &,const TQString &); - TQDomAttr setAttributeNodeNS(const TQDomAttr &); - virtual TQDomNodeList elementsByTagNameNS(const TQString &, - const TQString &) const; - bool hasAttributeNS(const TQString &,const TQString &) const; - - TQString tagName() const; - void setTagName(const TQString &); - - TQDomNamedNodeMap attributes() const; - TQDomNode::NodeType nodeType() const; - bool isElement() const; - - TQString text() const; -}; - - -class TQDomText : TQDomCharacterData -{ -%TypeHeaderCode -#include -%End - -public: - TQDomText(); - TQDomText(const TQDomText &); - - TQDomText splitText(int); - - TQDomNode::NodeType nodeType() const; - bool isText() const; -}; - - -class TQDomComment : TQDomCharacterData -{ -%TypeHeaderCode -#include -%End - -public: - TQDomComment(); - TQDomComment(const TQDomComment &); - - TQDomNode::NodeType nodeType() const; - bool isComment() const; -}; - - -class TQDomCDATASection : TQDomText -{ -%TypeHeaderCode -#include -%End - -public: - TQDomCDATASection(); - TQDomCDATASection(const TQDomCDATASection&); - - TQDomNode::NodeType nodeType() const; - bool isCDATASection() const; -}; - - -class TQDomNotation : TQDomNode -{ -%TypeHeaderCode -#include -%End - -public: - TQDomNotation(); - TQDomNotation(const TQDomNotation &); - - TQString publicId() const; - TQString systemId() const; - - TQDomNode::NodeType nodeType() const; - bool isNotation() const; -}; - - -class TQDomEntity : TQDomNode -{ -%TypeHeaderCode -#include -%End - -public: - TQDomEntity(); - TQDomEntity(const TQDomEntity &); - - virtual TQString publicId() const; - virtual TQString systemId() const; - virtual TQString notationName() const; - - TQDomNode::NodeType nodeType() const; - bool isEntity() const; -}; - - -class TQDomEntityReference : TQDomNode -{ -%TypeHeaderCode -#include -%End - -public: - TQDomEntityReference(); - TQDomEntityReference(const TQDomEntityReference &); - - TQDomNode::NodeType nodeType() const; - bool isEntityReference() const; -}; - - -class TQDomProcessingInstruction : TQDomNode -{ -%TypeHeaderCode -#include -%End - -public: - TQDomProcessingInstruction(); - TQDomProcessingInstruction(const TQDomProcessingInstruction &); - - virtual TQString target() const; - - virtual TQString data() const; - virtual void setData(const TQString &); - - TQDomNode::NodeType nodeType() const; - bool isProcessingInstruction() const; -}; - -%End diff --git a/sip/qtxml/qtxmlmod.sip b/sip/qtxml/qtxmlmod.sip deleted file mode 100644 index d0c0c25..0000000 --- a/sip/qtxml/qtxmlmod.sip +++ /dev/null @@ -1,80 +0,0 @@ -// This is the SIP interface definition for the qtxml module of PyTQt. -// -// Copyright (c) 2007 -// Riverbank Computing Limited -// -// 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.qtxml 0 - -%Import qt/qtmod.sip - -%Include copying.sip - - -%Include qdom.sip - - -// This is only needed on Windows to make sure that the DLL containing the C++ -// code of the main qt module is loaded before we import our own C++ code which -// has been linked against it. All other modules inherit from a class in the -// qt module which sorts it out, but this module doesn't so we add a dummy. It -// is ignored by SIP v4.x and later. -%PrePythonCode -from PyTQt.qt import TQObject -%End - - -// The build file template. - -%Makefile qtxml.pro.in -# The project file for the qtxml module. -# -# Copyright (c) 2007 -# Riverbank Computing Limited -# -# 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 = @PYQT_MODDIR@ -CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ -INCLUDEPATH = @BLX_INCLUDEPATH@ -DEFINES = @BLX_DEFINES@ -LIBS += @PYQT_QT_MODULE@ @BLX_LIBS@ -macx:QMAKE_LFLAGS += -framework Python - -SOURCES = $B - -HEADERS = $H -%End 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 +// +// 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 + +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 +// +// 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 +TQAccel + +TQAccel is fully implemented. + + +%End + + +class TQAccel : TQObject +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQAction (TQt v2.2+) + +TQAction is fully implemented. + + + +TQActionGroup (TQt v2.2+) + +TQActionGroup is fully implemented. + + +%End + + +%If (TQt_ACTION) + +class TQAction : TQObject +{ +%TypeHeaderCode +#include +%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 +%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 +// +// 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 +TQApplication + + TQApplication + int &argc + char **argv + + +This takes one parameter which is a list of argument strings. Arguments +used by TQt are removed from the list. + + + + TQApplication + int &argc + char **argv + bool GUIenabled + + +This takes two parameters, the first of which is a list of argument strings. +Arguments used by TQt are removed from the list. + + + + TQApplication + int &argc + char **argv + Type type + + +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+) + + + + int exec + + + +This has been renamed to exec_loop in Python. + + +%End + +%ModuleHeaderCode +#include +%End + +TQApplication *tqApp; + + +class TQApplication : TQObject +{ +%TypeHeaderCode +#include +#include +%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 + + +// 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 +// +// 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 +TQAssistantClient (TQt v3.1+) + +TQAssistantClient is fully implemented. + + +%End + + +%If (TQt_ASSISTANTCLIENT) + +class TQAssistantClient : TQObject +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQBitmap + +TQBitmap is fully implemented. + + +%End + + +class TQBitmap : TQPixmap +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQBrush + +TQBrush is fully implemented, including the Python +== and != operators. + + +%End + + +class TQBrush : TQt +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQButton + +TQButton is fully implemented. + + +%End + + +class TQButton : TQWidget +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQButtonGroup + +TQButtonGroup is fully implemented. + + +%End + + +class TQButtonGroup : TQGroupBox +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQByteArray + +A Python string can be used whenever a TQByteArray can be +used. A TQByteArray can be converted to a Python string +using the Python str() function. + + + + TQByteArray &assign + const char *data + uint size + + +Not implemented. + + + + char &at + uint i + + +Not yet implemented. + + + + int contains + const char &d + + +Not yet implemented. + + + + bool fill + const char &d + int size = -1 + + +Not yet implemented. + + + + int find + const char &d + uint i = 0 + + +Not yet implemented. + + + + void resetRawData + const char *data + uintsize + + +Not implemented. + + + + TQByteArray &setRawData + const char *data + uintsize + + +Not implemented. + + +%End + + +class TQByteArray +{ +%TypeHeaderCode +#include +%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(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 +// +// 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 +TQCDEStyle (TQt v2+) + +TQCDEStyle is fully implemented. + + +%End + + +%If (TQt_STYLE_CDE) + +class TQCDEStyle : TQMotifStyle +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQCheckBox + +TQCheckBox is fully implemented. + + +%End + + +class TQCheckBox : TQButton +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQClipboard + + void *data const + const char *format + + +Not yet implemented (TQt v1.x). + + + + void setData + const char *format + void * + + +Not yet implemented (TQt v1.x). + + +%End + + +%If (TQt_CLIPBOARD) + +class TQClipboard : TQObject +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQColor + +The Python == and != operators are +supported. + + + + void getHsv + int *h + int *s + int *v + + +This takes no parameters and returns the h, +s and v values as a tuple. + + + + void getRgb + int *r + int *g + int *b + + +This takes no parameters and returns the r, +g and b values as a tuple. + + + + void hsv + int *h + int *s + int *v + + +This takes no parameters and returns the h, +s and v values as a tuple. + + + + void rgb + int *r + int *g + int *b + + +This takes no parameters and returns the r, +g and b values as a tuple. + + +%End + + +%ModuleHeaderCode +#include +%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 +%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 +// +// 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 +TQColorDialog (TQt v2+) + + static TQRgb getRgba + TQRgb initial + bool *ok + TQWidget *parent = 0 + const char *name = 0 + + +This takes the initial, parent and +name parameters and returns a tuple containing the +TQRgb result and the ok value. + + +%End + + +%If (TQt_COLORDIALOG) + +class TQColorDialog : TQDialog +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQColorGroup + +TQColorGroup is fully implemented. + + +%End + + +class TQColorGroup +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQComboBox + +TQComboBox is fully implemented. + + +%End + + +class TQComboBox : TQWidget +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQCommonStyle (TQt v2+) + + virtual void getButtonShift + int &x + int &y + + +This takes no parameters and returns a tuple of the x and +y values. (TQt v2) + + + + virtual void tabbarMetrics + const TQTabBar *t + int &hframe + int &vframe + int &overlap + + +This takes only the t parameter and returns a tuple of the +hframe, vframe and +overlap values. (TQt v2) + + +%End + + +class TQCommonStyle : TQStyle +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQCString (TQt v2+) + +A Python string can be used whenever a TQCString can be used. +A TQCString can be converted to a Python string using the +Python str() function. + + + + TQCString &sprintf + const char *format + ... + + +Not implemented. + + + + short toShort + bool *ok = 0 + + +This returns a tuple of the short result and the +ok value. + + + + ushort toUShort + bool *ok = 0 + + +This returns a tuple of the ushort result and the +ok value. + + + + int toInt + bool *ok = 0 + + +This returns a tuple of the int result and the +ok value. + + + + uint toUInt + bool *ok = 0 + + +This returns a tuple of the uint result and the +ok value. + + + + long toLong + bool *ok = 0 + + +This returns a tuple of the long result and the +ok value. + + + + ulong toULong + bool *ok = 0 + + +This returns a tuple of the ulong result and the +ok value. + + + + float toFloat + bool *ok = 0 + + +This returns a tuple of the float result and the +ok value. + + + + double toDouble + bool *ok = 0 + + +This returns a tuple of the double result and the +ok value. + + +%End + + +class TQCString : TQByteArray +{ +%TypeHeaderCode +#include +%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(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 +// +// 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 +TQCursor + +TQCursor is fully implemented. + + +%End + + +%ModuleHeaderCode +#include +%End + + +class TQCursor : TQt +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQDataStream + + TQDataStream &readBytes + const char *&s + uint &l + + +This takes no parameters. The TQDataStream result and the +data read are returned as a tuple. + + + + TQDataStream &readRawBytes + const char *s + uint l + + +This takes only the l parameter. The +TQDataStream result and the data read are returned as a +tuple. + + + + TQDataStream &writeBytes + const char *s + uint len + + +len is derived from s and not passed as a +parameter. + + + + TQDataStream &writeRawBytes + const char *s + uint len + + +len is derived from s and not passed as a +parameter. + + +%End + + +class TQDataStream +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQDate + +The Python +==, !=, +<, <=, +>, >= +and __nonzero__ +operators are supported. + + + + int weekNumber + int *yearNum = 0 + + +This takes no parameters and returns the week number and the year number as a +tuple. (TQt v3.1+) + + + +TQDateTime + +TQDateTime is fully implemented, including the Python +==, !=, +<, <=, +>, >= +and __nonzero__ +operators. + + + +TQTime + +TQTime is fully implemented, including the Python +==, !=, +<, <=, +>, >= +and __nonzero__ +operators. + + +%End + + +class TQDate +{ +%TypeHeaderCode +#include +%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 +%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 +%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 +// +// 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 +TQDateEdit (TQt v3+) + +TQDateEdit is fully implemented. + + + +TQTimeEdit (TQt v3+) + +TQTimeEdit is fully implemented. + + + +TQDateTimeEdit (TQt v3+) + +TQDateTimeEdit is fully implemented. + + +%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 +%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 +%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 +%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 +// +// 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 +TQDesktopWidget (TQt v3+) + +TQDesktopWidget is fully implemented. + + +%End + + +class TQDesktopWidget : TQWidget +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQDial (TQt v2.2+) + +TQDial is fully implemented. + + +%End + + +%If (TQt_DIAL) + +class TQDial : TQWidget, TQRangeControl +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQDialog + + int exec + + + +This has been renamed to exec_loop in Python. + + +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 +TQObject.deleteLater() or other techniques. + + +%End + + +class TQDialog : TQWidget +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQDir + +TQDir is fully implemented, including the Python +len, [] (for reading slices and +individual elements), ==, != and +in operators + + + +TQFileInfoList + +This class isn't implemented. Whenever a TQFileInfoList is +the return type of a function or the type of an argument, a Python list of +TQFileInfo instances is used instead. + + +%End + + +%MappedType TQFileInfoList +{ +%TypeHeaderCode +#include +%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(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 +%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 +// +// 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 +TQDockArea (TQt v3+) + + bool hasDockWindow const + TQDockWindow *w + int *index = 0 + + +This takes the w parameter and returns the index of the +TQDockWIndow or -1 if the TQDockArea does not contain the TQDockWindow. + + +%End + + +class TQDockArea : TQWidget +{ +%TypeHeaderCode +#include +%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 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 +// +// 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 +TQDockWindow (TQt v3+) + +TQDockWindow is fully implemented. + + +%End + + +class TQDockWindow : TQFrame +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQColorDrag (TQt v2.1+) + +TQColorDrag is fully implemented. + + + +TQDragObject + +TQDragObject is fully implemented. + + + +TQImageDrag + +TQImageDrag is fully implemented. + + + +TQStoredDrag + +TQStoredDrag is fully implemented. + + + +TQTextDrag + +TQTextDrag is fully implemented. + + + +TQUriDrag (TQt v2+) + +TQUriDrag is fully implemented. + + + +TQUrlDrag (TQt v1.x) + +TQUrlDrag is fully implemented. + + +%End + + +class TQDragObject : TQObject, TQMimeSource +{ +%TypeHeaderCode +#include +%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 +%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 +%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 +%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 +%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 +%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 +// +// 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 +%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 +// +// 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 +TQDropSite + +TQDropSite is fully implemented. + + +%End + + +%If (TQt_DRAGANDDROP) + +class TQDropSite +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQErrorMessage (TQt v3+) + +TQErrorMessage is fully implemented. + + +%End + + +class TQErrorMessage : TQDialog +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQEvent + +TQEvent is fully implemented. + + +Instances of TQEvents are automatically converted to the +correct sub-class. + + + +TQChildEvent + +TQChildEvent is fully implemented. + + + +TQCloseEvent + +TQCloseEvent is fully implemented. + + + +TQIconDragEvent (TQt v3.3+) + +TQIconDragEvent is fully implemented. + + + +TQContextMenuEvent (TQt v3+) + +TQContextMenuEvent is fully implemented. + + + +TQCustomEvent + +TQCustomEvent is fully implemented. Any Python object can be +passed as the event data and its reference count is increased. + + + +TQDragEnterEvent + +TQDragEnterEvent is fully implemented. + + + +TQDragLeaveEvent + +TQDragLeaveEvent is fully implemented. + + + +TQDragMoveEvent + +TQDragMoveEvent is fully implemented. + + + +TQDropEvent + +TQDropEvent is fully implemented. + + + +TQFocusEvent + +TQFocusEvent is fully implemented. + + + +TQHideEvent + +TQHideEvent is fully implemented. + + + +TQIMComposeEvent (TQt v3.1+) + +TQIMComposeEvent is fully implemented. + + + +TQIMEvent (TQt v3+) + +TQIMEvent is fully implemented. + + + +TQKeyEvent + +TQKeyEvent is fully implemented. + + + +TQMouseEvent + +TQMouseEvent is fully implemented. + + + +TQMoveEvent + +TQMoveEvent is fully implemented. + + + +TQPaintEvent + +TQPaintEvent is fully implemented. + + + +TQResizeEvent + +TQResizeEvent is fully implemented. + + + +TQShowEvent + +TQShowEvent is fully implemented. + + + +TQTabletEvent (TQt v3+) + +TQTabletEvent is fully implemented. + + + +TQTimerEvent + +TQTimerEvent is fully implemented. + + + +TQWheelEvent (TQt v2+) + +TQWheelEvent is fully implemented. + + +%End + + +%ModuleHeaderCode +#include +%End + + +class TQEvent : TQt +{ +%TypeHeaderCode +#include +%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 +%End + +public: + TQTimerEvent(int); + + int timerId() const; +}; + + +class TQMouseEvent : TQEvent +{ +%TypeHeaderCode +#include +%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 +%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 +%End + +public: + enum TabletDevice { + NoDevice, + Puck, + Stylus, + Eraser + }; + + TQTabletEvent(Type,const TQPoint &,const TQPoint &,int,int,int,int, + const TQPair &); + TQTabletEvent(const TQPoint &,const TQPoint &,int,int,int,int, + const TQPair &); + + 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 uniqueId(); +}; + + +class TQKeyEvent : TQEvent +{ +%TypeHeaderCode +#include +%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 +%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 +%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 +%End + +public: + TQMoveEvent(const TQPoint &,const TQPoint &); + + const TQPoint &pos() const; + const TQPoint &oldPos() const; +}; + + +class TQResizeEvent : TQEvent +{ +%TypeHeaderCode +#include +%End + +public: + TQResizeEvent(const TQSize &,const TQSize &); + + const TQSize &size() const; + const TQSize &oldSize() const; +}; + + +class TQCloseEvent : TQEvent +{ +%TypeHeaderCode +#include +%End + +public: + TQCloseEvent(); + + bool isAccepted() const; + void accept(); + void ignore(); +}; + + +class TQIconDragEvent : TQEvent +{ +%TypeHeaderCode +#include +%End + +public: + TQIconDragEvent(); + + bool isAccepted() const; + void accept(); + void ignore(); +}; + + +class TQShowEvent : TQEvent +{ +%TypeHeaderCode +#include +%End + +public: + TQShowEvent(); +}; + + +class TQHideEvent : TQEvent +{ +%TypeHeaderCode +#include +%End + +public: + TQHideEvent(); +}; + + +class TQContextMenuEvent : TQEvent +{ +%TypeHeaderCode +#include +%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 +%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 +%End + +public: + TQIMComposeEvent(Type,const TQString &,int,int); +}; + + +%If (TQt_DRAGANDDROP) + +class TQDropEvent : TQEvent, TQMimeSource +{ +%TypeHeaderCode +#include +%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 +%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 +%End + +public: + TQDragEnterEvent(const TQPoint &); +}; + + +class TQDragLeaveEvent : TQEvent +{ +%TypeHeaderCode +#include +%End + +public: + TQDragLeaveEvent(); +}; + +%End + + +class TQChildEvent : TQEvent +{ +%TypeHeaderCode +#include +%End + +public: + TQChildEvent(Type,TQObject *); + + TQObject *child() const; + bool inserted() const; + bool removed() const; +}; + + +class TQCustomEvent : TQEvent +{ +%TypeHeaderCode +#include +%End + +public: + TQCustomEvent(Type,SIP_PYOBJECT /Transfer/); + TQCustomEvent(int); + ~TQCustomEvent(); +%VirtualCatcherCode + // We need to garbage collect any current data. + + PyObject *old = reinterpret_cast(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(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(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(sipCpp -> TQCustomEvent::data()); + + if (obj) + sipRes = sipVisit(obj, sipArg); + else + sipRes = 0; +%End + +%GCClearCode + // Support the Python garbage collector. + + PyObject *obj = reinterpret_cast(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 +// +// 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 +TQEventLoop (TQt v3.1+) + + virtual int exec + + + +This has been renamed to exec_loop in Python. + + +%End + + +class TQEventLoop : TQObject +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQFile + + bool open + int m + FILE *f + + +Not implemented. + + + + TQ_LONG readBlock + char *data + TQ_ULONG len + + +This takes a single len parameter. The +data is returned if there was no error, otherwise +None is returned. + + + + TQ_LONG readLine + char *data + TQ_ULONG maxlen + + +This takes a single maxlen parameter. The +data is returned if there was no error, otherwise +None is returned. + + + + static void setDecodingFunction + EncoderFn f + + +Not yet implemented. (TQt v2+) + + + + static void setEncodingFunction + EncoderFn f + + +Not yet implemented. (TQt v2+) + + + + TQ_LONG writeBlock + const char *data + TQ_ULONG len + + +len is derived from data and not passed +as a parameter. + + +%End + + +class TQFile : TQIODevice +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQFileDialog + +TQFileDialog is fully implemented. + + + +TQFileIconProvider + +TQFileIconProvider is fully implemented. + + + +TQFilePreview + +TQFilePreview 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. + + +class FilePreview(TQFilePreview): + pass + +class Preview(TQLabel): + def __init__(self, parent=None): + TQLabel.__init__(self, parent) + self.preview = FilePreview() + self.preview.previewUrl = self.previewUrl + + +Note that TQFilePreview cannot be instantiated directly because it is abstract. +Thanks to Hans-Peter Jansen for this trick. + + +%End + + +%If (TQt_FILEDIALOG) + +class TQFileIconProvider : TQObject +{ +%TypeHeaderCode +#include +%End + +public: + TQFileIconProvider(TQObject * /TransferThis/ = 0,const char * = 0); + + virtual const TQPixmap *pixmap(const TQFileInfo &); + +private: + TQFileIconProvider(const TQFileIconProvider &); +}; + + +class TQFilePreview +{ +%TypeHeaderCode +#include +%End + +public: + TQFilePreview(); + + virtual void previewUrl(const TQUrl &) = 0; +}; + + +class TQFileDialog : TQDialog +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQFileInfo + +TQFileInfo is fully implemented. + + +%End + + +class TQFileInfo +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQFont + +TQFont is fully implemented, including the Python +== and != operators. + + +%End + + +class TQFont +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQFontDatabase (TQt v2.1+) + +TQFontDatabase is fully implemented. + + +%End + + +%If (TQt_FONTDATABASE) + +class TQFontDatabase +{ +%TypeHeaderCode +#include +%End + +public: + TQFontDatabase(); + + static TQValueList standardSizes(); + + TQStringList families() const; + TQStringList families(TQFont::Script) const; + TQStringList styles(const TQString &) const; + TQValueList pointSizes(const TQString &, + const TQString & = TQString::null); + TQValueList 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 +// +// 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 +TQFontDialog (TQt v2+) + + static TQFont getFont + bool *ok + const TQFont &def + TQWidget *parent = 0 + const char *name = 0 + + +This takes the def, parent and +name parameters and returns a tuple containing the +TQFont result and the ok value. + + + + static TQFont getFont + bool *ok + TQWidget *parent = 0 + const char *name = 0 + + +This takes the parent and name parameters +and returns a tuple containing the TQFont result and the +ok value. + + +%End + + +%If (TQt_FONTDIALOG) + +class TQFontDialog : TQDialog +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQFontInfo + +TQFontInfo is fully implemented. + + +%End + + +class TQFontInfo +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQFontMetrics + + TQRect boundingRect + int x + int y + int w + int h + int flags + const TQString &str + int len = -1 + int tabstops = 0 + int *tabarray = 0 + + +The tabarray parameter is a Python list of integers. + + + + TQSize size + int flags + const TQString &str + int len = -1 + int tabstops = 0 + int *tabarray = 0 + + +The tabarray parameter is a Python list of integers. + + +%End + + +class TQFontMetrics +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQFrame + +TQFrame is fully implemented. + + +%End + + +class TQFrame : TQWidget +{ +%TypeHeaderCode +#include +%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 +// +// 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 +%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 +// +// 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 +TQGrid (TQt v2+) + +TQGrid is fully implemented. + + +%End + + +class TQGrid : TQFrame +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQGridView (TQt v3+) + +TQGridView is fully implemented. + + +%End + + +class TQGridView : TQScrollView +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQGroupBox + +TQGroupBox is fully implemented. + + +%End + + +class TQGroupBox : TQFrame +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQHBox (TQt v2+) + +TQHBox is fully implemented. + + +%End + + +class TQHBox : TQFrame +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQHButtonGroup (TQt v2+) + +TQHButtonGroup is fully implemented. + + +%End + + +class TQHButtonGroup : TQButtonGroup +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQHeader + +TQHeader is fully implemented. + + +%End + + +class TQHeader : TQWidget +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQHGroupBox (TQt v2+) + +TQHGroupBox is fully implemented. + + +%End + + +class TQHGroupBox : TQGroupBox +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQIconSet + +TQIconSet is fully implemented. + + + +TQIconFactory (TQt v3.1+) + +TQIconFactory is fully implemented. + + +%End + + +class TQIconSet +{ +%TypeHeaderCode +#include +%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 +%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 +// +// 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 +TQIconView (TQt v2.1+) + + TQIconViewItem *makeRowLayout + TQIconViewItem *begin + int &y + + +Not yet implemented. + + + +TQIconViewItem (TQt v2.1+) + +TQIconViewItem is fully implemented. + + + +TQIconDrag (TQt v2.1+) + +TQIconDrag is fully implemented. + + + +TQIconDragItem (TQt v2.1+) + +TQIconDragItem is fully implemented. + + +%End + + +%If (TQt_ICONVIEW) + +%If (TQt_DRAGANDDROP) + +class TQIconDragItem +{ +%TypeHeaderCode +#include +%End + +public: + TQIconDragItem(); + + virtual TQByteArray data() const; + virtual void setData(const TQByteArray &); +}; + + +class TQIconDrag : TQDragObject +{ +%TypeHeaderCode +#include +%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 +%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 &); +%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 +%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 &); +%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 +// +// 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 +TQImage + +The Python == and != operators are +supported. + + + + TQImage + const char *xpm[] + + +This takes a list of strings as its parameter. + + + + TQImage + uchar *data + int w + int h + int depth + TQRgb *colorTable + int numColors + Endian bitOrder + + +The colorTable parameter is a list of TQRgb instances or +None. (TQt v2.1+) + + + + uchar *bits + + + +The return value is a sip.voidptr object which is only +useful if passed to another Python module. + + + + TQRgb *colorTable + + + +The return value is a sip.voidptr object which is only +useful if passed to another Python module. + + + + TQImage convertDepthWithPalette + int + TQRgb *p + int pc + int cf = 0 + + +Not implemented. + + + + uchar **jumpTable + + + +The return value is a sip.voidptr object which is only +useful if passed to another Python module. + + + + bool loadFromData + const uchar *buf + uint len + const char *format = 0 + ColorMode mode = Auto + + +len is derived from buf and not passed as +a parameter. + + + + uchar *scanLine + int i + + +The return value is a sip.voidptr object which is only +useful if passed to another Python module. + + + +TQImageIO + + static void defineIOHandler + const char *format + const char *header + const char *flags + image_io_handler read_image + image_io_handler write_image + + +Not implemented. + + + +TQImageTextKeyLang + +TQImageTextKeyLang is fully implemented. + + +%End + + +class TQImage +{ +%TypeHeaderCode +#include +%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 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 +%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 +%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 +// +// 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 +TQInputDialog (TQt v2.1+) + + static TQString getText + const TQString &caption + const TQString &label + const TQString &text = TQString::null + bool *ok = 0 + TQWidget *parent = 0 + const char *name = 0 + + +The ok is not passed and the returned value is a tuple of +the TQString result and the ok flag. +(TQt v2.1 - v2.3.1) + + + + static TQString getText + const TQString &caption + const TQString &label + TQLineEdit::EchoModeecho + const TQString &text = TQString::null + bool *ok = 0 + TQWidget *parent = 0 + const char *name = 0 + + +The ok is not passed and the returned value is a tuple of +the TQString result and the ok flag. +(TQt v2.2 - v2.3.1) + + + + static TQString getText + const TQString &caption + const TQString &label + TQLineEdit::EchoModeecho = TQLineEdit::Normal + const TQString &text = TQString::null + bool *ok = 0 + TQWidget *parent = 0 + const char *name = 0 + + +The ok is not passed and the returned value is a tuple of +the TQString result and the ok flag. +(TQt v3+) + + + + static int getInteger + const TQString &caption + const TQString &label + int num = 0 + int from = -2147483647 + int to = 2147483647 + int step = 1 + bool *ok = 0 + TQWidget *parent = 0 + const char *name = 0 + + +The ok is not passed and the returned value is a tuple of +the int result and the ok flag. + + + + static double getDouble + const TQString &caption + const TQString &label + double num = 0 + double from = -2147483647 + double to = 2147483647 + int step = 1 + bool *ok = 0 + TQWidget *parent = 0 + const char *name = 0 + + +The ok is not passed and the returned value is a tuple of +the double result and the ok flag. + + + + static TQString getItem + const TQString &caption + const TQString &label + const TQStringList &list + int current = 0 + bool editable = TRUE + bool *ok = 0 + TQWidget *parent = 0 + const char *name = 0 + + +The ok is not passed and the returned value is a tuple of +the TQString result and the ok flag. + + +%End + + +%If (TQt_INPUTDIALOG) + +class TQInputDialog : TQDialog +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQInterlaceStyle (TQt v2.3.1+) + + void scrollBarMetrics + const TQTabBar *sb + int &sliderMin + int &sliderMax + int &sliderLength + int &buttonDim + + +This takes only the sb parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. + + +%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 +%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 +// +// 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 +TQIODevice + +TQIODevice is fully implemented. + + +%End + + +%ModuleHeaderCode +#include +%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 +%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 +// +// 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 +TQKeySequence (TQt v3+) + +TQKeySequence is fully implemented including the operators +==, !=, TQString() and +int(). A TQString instance or a Python +integer may be used whenever a TQKeySequence can be used. + + +%End + + +class TQKeySequence : TQt +{ +%TypeHeaderCode +#include +%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(sipConvertToInstance(sipPy,sipClass_TQKeySequence,sipTransferObj,SIP_NO_CONVERTORS,0,sipIsErr)); + + return 0; + } + + if (sipCanConvertToInstance(sipPy,sipClass_TQString,0)) + { + int state; + TQString *s = reinterpret_cast(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 +// +// 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 +TQLabel + +TQLabel is fully implemented. + + +%End + + +class TQLabel : TQFrame +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQLayout + +TQLayout is fully implemented. + + + +TQBoxLayout + +TQBoxLayout is fully implemented. + + + +TQGLayoutIterator (TQt v2+) + +TQGLayoutIterator is fully implemented. + + + +TQGridLayout + + bool findWidget + TQWidget *w + int *row + int *col + + +This takes the w parameter and returns a tuple containing +the bool result, row and +col. (TQt v2+) + + + +TQHBoxLayout + +TQHBoxLayout is fully implemented. + + + +TQLayoutItem (TQt v2+) + +TQLayoutItem is fully implemented. + + + +TQLayoutIterator (TQt v2+) + + TQLayoutItem *next + + + +This is a wrapper around the TQLayoutIterator +++ operator. + + + +TQSpacerItem (TQt v2+) + +TQSpacerItem is fully implemented. + + + +TQVBoxLayout + +TQVBoxLayout is fully implemented. + + + +TQWidgetItem (TQt v2+) + +TQWidgetItem is fully implemented. + + +%End + + +class TQGLayoutIterator +{ +%TypeHeaderCode +#include +%End + +public: + virtual TQLayoutItem *next() = 0; + virtual TQLayoutItem *current() = 0; + virtual TQLayoutItem *takeCurrent() = 0 /TransferBack/; +}; + + +class TQLayoutIterator +{ +%TypeHeaderCode +#include +%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 +%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 +%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 +%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 +%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 +%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 +%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 +%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 +%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 +// +// 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 +TQLCDNumber + +TQLCDNumber is fully implemented. + + +%End + + +class TQLCDNumber : TQFrame +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQLibrary (TQt v3+) + +TQLibrary is fully implemented. + + +%End + + +class TQLibrary +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQLineEdit + + int characterAt + int xpos + TQChar *chr + + +This takes only the xpos parameter and returns the int +result and the chr value as a tuple. (TQt v3+) + + + + void del + + + +This has been renamed delChar in Python. (TQt v2+) + + + + bool getSelection + int *start + int *end + + +This takes no parameters and returns the bool result and the +start and end values as a tuple. +(TQt v3+) + + +%End + + +class TQLineEdit : TQFrame +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQListBox + + bool itemYPos + int index + int *yPos + + +This takes the index parameter and returns a tuple +containing the bool result and yPos. +(TQt v1.x) + + + +TQListBoxItem + +TQListBoxItem is fully implemented. + + + +TQListBoxPixmap + +TQListBoxPixmap is fully implemented. + + + +TQListBoxText + +TQListBoxText is fully implemented. + + +%End + + +class TQListBox : TQScrollView +{ +%TypeHeaderCode +#include +%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 +%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 +%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 +%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 +// +// 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 +TQListView + +TQListView is fully implemented. + + +Note that to remove a child TQListViewItem you must first +call takeItem() and then del(). + + + +TQListViewItem + +TQListViewItem is fully implemented. + + +Note that to remove a child TQListViewItem you must first +call takeItem() and then del(). + + + +TQCheckListItem + +TQCheckListItem is fully implemented. + + + +TQListViewItemIterator (TQt v2+) + +TQListViewItemIterator is fully implemented. + + +%End + + +class TQListViewItem : TQt +{ +%TypeHeaderCode +#include +%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 +%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 +%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 +%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 +// +// 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 +TQLocale (TQt v3.3+) + + short toShort + bool *ok = 0 + + +This returns a tuple of the short result and the +ok value. + + + + ushort toUShort + bool *ok = 0 + + +This returns a tuple of the ushort result and the +ok value. + + + + int toInt + bool *ok = 0 + + +This returns a tuple of the int result and the +ok value. + + + + uint toUInt + bool *ok = 0 + + +This returns a tuple of the uint result and the +ok value. + + + + TQ_LONG toLong + bool *ok = 0 + + +This returns a tuple of the long result and the +ok value. + + + + TQ_ULONG toULong + bool *ok = 0 + + +This returns a tuple of the ulong result and the +ok value. + + + + float toFloat + bool *ok = 0 + + +This returns a tuple of the float result and the +ok value. + + + + double toDouble + bool *ok = 0 + + +This returns a tuple of the double result and the +ok value. + + +%End + + +class TQLocale +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQMainWindow + + TQTextStream &operator<< + TQTextStream & + const TQMainWindow & + + +This operator is fully implemented. (TQt v3+) + + + + TQTextStream &operator>> + TQTextStream & + TQMainWindow & + + +This operator is fully implemented. (TQt v3+) + + + + bool getLocation + TQToolBar *tb + ToolBarDock &dock + int &index + bool &nl + int &extraOffset + + +This takes only the tb parameter and returns a tuple of the +result, dock, index, +nl and extraOffset values. (TQt v2.1.0+) + + + + TQPtrList<TQToolBar> toolBars + ToolBarDock dock + + +This returns a list of TQToolBar instances. (TQt v2.1.0+) + + +%End + + +class TQMainWindow : TQWidget +{ +%TypeHeaderCode +#include +%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 dockWindows(Dock) const; + TQPtrList dockWindows() const; + void lineUpDockWindows(bool = 0); + + void lineUpToolBars(bool = 0); + bool isDockMenuEnabled() const; + + bool hasDockWindow(TQDockWindow *); + TQPtrList 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 +// +// 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 +TQMemArray<type> (TQt v3+) + +Types based on the TQMemArray template are automatically +converted to and from Python lists of the type. + + +%End + + +%MappedType TQMemArray +{ +%TypeHeaderCode +#include +%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 on the heap. + + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + TQMemArray *qma = new TQMemArray(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 +%MappedType TQMemArray +{ +%TypeHeaderCode +#include +%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 *ql = new TQMemArray; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + int state; + TYPE *t = reinterpret_cast(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 +// +// 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 +TQMenuBar + +TQMenuBar is fully implemented. + + +%End + + +class TQMenuBar : TQFrame, TQMenuData +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQMenuData + + TQMenuItem *findItem + int id + TQMenuData **parent + + +Not implemented. + + + +TQCustomMenuItem (TQt v2.1+) + +TQCustomMenuItem is fully implemented. + + + +TQMenuItem + +TQMenuItem is an internal TQt class. + + +%End + + +// Even though this is an internal class, uic for TQt v3.1.0 generates code that +// uses it. +class TQMenuItem +{ +%TypeHeaderCode +#include +%End + +public: + TQMenuItem(); + + void setText(const TQString &); + +private: + TQMenuItem(const TQMenuItem &); +}; + + +class TQMenuData +{ +%TypeHeaderCode +#include +%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 +%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 +// +// 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 +TQMessageBox + +TQMessageBox is fully implemented. + + +%End + + +%If (TQt_MESSAGEBOX) + +class TQMessageBox : TQDialog +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQMetaObject + + int numClassInfo const + bool super = FALSE + + +Not implemented. + + + + const TQClassInfo *classInfo const + bool super = FALSE + + +Not implemented. + + + +TQMetaProperty + +TQMetaProperty is fully implemented. + + +%End + + +class TQMetaObject +{ +%TypeHeaderCode +#include +%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 +%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 +// +// 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 +TQMimeSource (TQt v2+) + +TQMimeSource is fully implemented. + + + +TQMimeSourceFactory (TQt v2+) + +TQMimeSourceFactory is fully implemented. + + + +TQWindowsMime (TQt v3+) + +TQWindowsMime is fully implemented. + + +%End + + +class TQMimeSource +{ +%TypeHeaderCode +#include +%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 +%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 +// +// 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 +TQMotifPlusStyle (TQt v2.2+) + + void getButtonShift + int &x + int &y + + +This takes no parameters and returns a tuple of the x and +y values. (TQt v2) + + + + void scrollBarMetrics + const TQScrollBar *sb + int &sliderMin + int &sliderMax + int &sliderLength + int &buttonDim + + +This takes only the sb parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. +(TQt v2) + + +%End + + +%If (TQt_STYLE_MOTIFPLUS) + +class TQMotifPlusStyle : TQMotifStyle +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQMotifStyle (TQt v2+) + + void scrollBarMetrics + const TQTabBar *sb + int &sliderMin + int &sliderMax + int &sliderLength + int &buttonDim + + +This takes only the sb parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. +(TQt v2) + + + + void tabbarMetrics + const TQTabBar *t + int &hframe + int &vframe + int &overlap + + +This takes only the t parameter and returns a tuple of the +hframe, vframe and +overlap values. (TQt v2) + + +%End + + +%If (TQt_STYLE_MOTIF) + +class TQMotifStyle : TQCommonStyle +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQMovie + + TQMovie + TQDataSource *src + int bufsize = 1024 + + +Not implemented. + + + + void pushData + const uchar *data + int length + + +length is derived from data and not +passed as a parameter. (TQt v2.2.0+) + + +%End + + +class TQMovie +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQMultiLineEdit + + void cursorPosition const + int *line + int *col + + +This takes no parameters and returns a tuple of the line and +col values. (TQt v1.x, TQt v2.x) + + + + virtual void del + + + +This has been renamed delChar in Python. (TQt v1.x, TQt v2.x) + + + + void getCursorPosition const + int *line + int *col + + +This takes no parameters and returns a tuple of the line and +col values. (TQt v1.x, TQt v2.x) + + + + bool getMarkedRegion + int *line1 + int *col1 + int *line2 + int *col2 + + +This takes no parameters and returns a tuple of the bool result and the +line1, col1, line2 and +col2 values. + + +%End + + +class TQMultiLineEdit : TQTextEdit +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQMutex (TQt v2.2+) + +TQMutex is fully implemented. + + + +TQMutexLocker (TQt v3.1+) + +TQMutexLocker is fully implemented. + + +%End + + +%If (TQt_THREAD_SUPPORT) + +class TQMutex +{ +%TypeHeaderCode +#include +%End + +public: + TQMutex(bool = 0); + + void lock() /ReleaseGIL/; + void unlock(); + bool locked(); + bool tryLock(); + +private: + TQMutex(const TQMutex &); +}; + + +class TQMutexLocker +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQt (TQt v2+) + +TQt is fully implemented. + + +%End + + +class TQt +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQNetworkOperation (TQt v2.1+) + +TQNetworkOperation is fully implemented. + + + +TQNetworkProtocol (TQt v2.1+) + +TQNetworkProtocol is fully implemented. + + + +TQNetworkProtocolFactoryBase (TQt v2.1+) + +TQNetworkProtocolFactoryBase is fully implemented. + + +%End + + +%If (TQt_NETWORKPROTOCOL) + +class TQNetworkProtocolFactoryBase +{ +%TypeHeaderCode +#include +%End + +public: + virtual TQNetworkProtocol *createObject() = 0 /Factory/; + +}; + + +class TQNetworkProtocol : TQObject +{ +%TypeHeaderCode +#include +%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 &,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 +%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 +// +// 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 +TQObject + + bool disconnect + const TQObject *receiver + const char *member = 0 + + +Not yet implemented. + + + + bool disconnect + const char *signal = 0 + const TQObject *receiver = 0 + const char *member = 0 + + +Not yet implemented. + + + + static bool disconnect + const TQObject *sender + const char *signal + const TQObject *receiver + const char *member + + +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 +signal and receiver parameters is not yet +supported. + + +%End + + +class TQObject : TQt +{ +%TypeHeaderCode +#include +#include +%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 + +#include +#include +#include +#include +#include + + +// 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(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(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(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(tx), sig, + reinterpret_cast(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(tx), sig, + reinterpret_cast(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(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(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 +// +// 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 +TQObjectCleanupHandler (TQt v3+) + +TQObjectCleanupHandler is fully implemented. + + +%End + + +class TQObjectCleanupHandler : TQObject +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQObjectList + +This class isn't implemented. Whenever a TQObjectList is the +return type of a function or the type of an argument, a Python list of +TQObject instances is used instead. + + +%End + + +%MappedType TQObjectList +{ +%TypeHeaderCode +#include +%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(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 +// +// 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 +TQPaintDevice + + virtual bool cmd + int + TQPainter * + TQPDevCmdParam * + + +Not implemented. + + +%End + + +%ModuleHeaderCode +#include +%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 +%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 +// +// 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 +TQPaintDeviceMetrics + +TQPaintDeviceMetrics is fully implemented. + + +%End + + +class TQPaintDeviceMetrics +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQPainter + + TQRect boundingRect + int x + int y + int w + int h + int flags + const char *str + int len = -1 + char **intern = 0 + + +The intern parameter is not supported. + + + + TQRect boundingRect + const TQRect& + int flags + const char *str + int len = -1 + char **intern = 0 + + +The intern parameter is not supported. + + + + void drawText + int x + int y + int w + int h + int flags + const char *str + int len = -1 + TQRect *br = 0 + char **intern = 0 + + +The intern parameter is not supported. + + + + void drawText + const TQRect& + int flags + const char *str + int len = -1 + TQRect *br = 0 + char **intern = 0 + + +The intern parameter is not supported. + + + + void setTabArray + int *ta + + +This takes a single parameter which is a list of tab stops. + + + + int *tabArray + + + +This returns a list of tab stops. + + +%End + + +class TQPainter : TQt +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQPair<type,type> (TQt v3+) + +Types based on the TQPair template are automatically +converted to and from Python tuples of two elements. + + +%End + + +%MappedType TQPair +{ +%TypeHeaderCode +#include +%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 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(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 +// +// 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 +TQPalette + +TQPalette is fully implemented, including the Python +== and != operators. + + +%End + + +class TQPalette +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQPen + +TQPen is fully implemented, including the Python +== and != operators. + + +%End + + +class TQPen : TQt +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQPicture + + const char *data + + + +Not implemented. + + + + void setData + const char *data + uint size + + +size is derived from data and not passed +as a parameter. + + +%End + + +%If (TQt_PICTURE) + +class TQPicture : TQPaintDevice +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQPixmap + + TQPixmap + const char *xpm[] + + +This takes a list of strings as its parameter. + + + + bool loadFromData + const uchar *buf + uint len + const char *format = 0 + ColorMode mode = Auto + + +len is derived from buf and not passed as +a parameter. + + + + bool loadFromData + const uchar *buf + uint len + const char *format + int conversion_flags + + +Not implemented. + + +%End + + +class TQPixmap : TQPaintDevice, TQt +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQPixmapCache (TQt v3+) + +TQPixmapCache is fully implemented. + + +%End + + +class TQPixmapCache +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQPlatinumStyle (TQt v2+) + + void scrollBarMetrics + const TQTabBar *sb + int &sliderMin + int &sliderMax + int &sliderLength + int &buttonDim + + +This takes only the sb parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. +(TQt v2) + + +%End + + +%If (TQt_STYLE_PLATINUM) + +class TQPlatinumStyle : TQWindowsStyle +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQPoint + +The Python ++, +=, +-, -=, unary -, +*, *=, +/, /=, +==, != and __nonzero__ +operators are supported. + + + + TQCOORD &rx + + + +Not implemented. + + + + TQCOORD &ry + + + +Not implemented. + + +%End + + +class TQPoint +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQPointArray + + TQPointArray + int nPoints + const TQCOORD *points + + +This takes a single parameter which is a list of points. + + + + void point + uint i + int *x + int *y + + +This takes the single parameter i and returns the +x and y values as a tuple. + + + + bool putPoints + int index + int nPoints + const TQCOORD *points + + +This takes two parameters, index and a list of points. + + + + bool putPoints + int index + int nPoints + int firstx + int firsty + ... + + +Not implemented. + + + + bool setPoints + int nPoints + const TQCOORD *points + + +This takes a single parameter which is a list of points. + + + + bool setPoints + int nPoints + int firstx + int firsty + ... + + +Not implemented. + + +%End + + +class TQPointArray +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQPopupMenu + + int exec + + + +This has been renamed exec_loop in Python. + + +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 +TQObject.deleteLater() or other techniques. + + + + int exec + const TQPoint &pos + int indexAtPoint = 0 + + +This has been renamed exec_loop in Python. + + +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 +TQObject.deleteLater() or other techniques. + + +%End + + +class TQPopupMenu : TQFrame, TQMenuData +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQPrintDialog (X11) + +TQPrintDialog is fully implemented. + + +%End + + +%If (WS_X11) +%If (TQt_PRINTDIALOG) + +class TQPrintDialog : TQDialog +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQPrinter + +TQPrinter is fully implemented. + + +%End + + +%If (TQt_PRINTER) + +class TQPrinter : TQPaintDevice +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQProcess (TQt v3+) + +TQProcess is fully implemented. + + +%End + + +class TQProcess : TQObject +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQProgressBar + +TQProgressBar is fully implemented. + + +%End + + +class TQProgressBar : TQFrame +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQProgressDialog + +TQProgressDialog is fully implemented. +value. + + +%End + + +%If (TQt_PROGRESSDIALOG) + +class TQProgressDialog : TQDialog +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQPtrList<type> (TQt v2+) + +Types based on the TQPtrList template are automatically +converted to and from Python lists of the type. + + +%End + + +template +%MappedType TQPtrList +{ +%TypeHeaderCode +#include +%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 *qpl = new TQPtrList; + + 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(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 +// +// 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 +TQPushButton + +TQPushButton is fully implemented. + + +%End + + +class TQPushButton : TQButton +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQRadioButton + +TQRadioButton is fully implemented. + + +%End + + +class TQRadioButton : TQButton +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQRangeControl + +TQRangeControl is fully implemented. + + +%End + + +class TQRangeControl +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQRect + +The Python +&, &=, +|, |=, +==, !=, in and +__nonzero__ operators are supported. + + + + void coords + int *x1 + int *y1 + int *x2 + int *y2 + + +This takes no parameters and returns a tuple containing the four values. + + + + void rect + int *x + int *y + int *w + int *h + + +This takes no parameters and returns a tuple containing the four values. + + + + TQCOORD &rBottom + + + +Not implemented. (TQt v2+) + + + + TQCOORD &rLeft + + + +Not implemented. (TQt v2+) + + + + TQCOORD &rRight + + + +Not implemented. (TQt v2+) + + + + TQCOORD &rTop + + + +Not implemented. (TQt v2+) + + +%End + + +class TQRect +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQRegExp + +The Python == and != operators are +supported. + + + + int match + const char *str + int index = 0 + int *len = 0 + + +This takes str and index parameters and +returns a tuple of the int result and the +len value. (TQt v1.x) + + + + int match + const TQString &str + int index = 0 + int *len = 0 + + +This takes str and index parameters and +returns a tuple of the int result and the +len value. (TQt v2+) + + +%End + + +class TQRegExp +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQRegion + +The Python +|, |=, ++, +=, +&, &=, +-, -=, +^, ^=, +==, !=, in and +__nonzero__ operators are supported. + + + + TQArray<TQRect> rects + + + +Not implemented. + + + + void setRects + TQRect *rects + int num + + +Not yet implemented. (TQt v2.2+) + + +%End + + +class TQRegion +{ +%TypeHeaderCode +#include +%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 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 +// +// 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 +TQScrollBar + +TQScrollBar is fully implemented. + + +%End + + +class TQScrollBar : TQWidget, TQRangeControl +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQScrollView + + void contentsToViewport + int x + int y + int &vx + int &vy + + +This takes the x and y parameters and +returns a tuple containing the vx and vy +values. (TQt v2+) + + + + void viewportToContents + int vx + int vy + int &x + int &y + + +This takes the vx and vy parameters and +returns a tuple containing the x and y +values. (TQt v2+) + + +%End + + +class TQScrollView : TQFrame +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQSemaphore (TQt v2.2+) + +TQSemaphore is fully implemented. The += +and -= operators have also been implemented, but require +Python v2.0 or later. + + +%End + + +%If (TQt_THREAD_SUPPORT) + +class TQSemaphore +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQSessionManager (TQt v2+) + +TQSessionManager is fully implemented. + + +%End + + +class TQSessionManager : TQObject +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQSettings (TQt v3+) + + bool readBoolEntry + const TQString &key + bool def = 0 + bool *ok = 0 + + +The ok is not passed and the returned value is a tuple of +the bool result and the ok flag. + + + +double readDoubleEntry + const TQString &key + double def = 0 + bool *ok = 0 + + +The ok is not passed and the returned value is a tuple of +the double result and the ok flag. + + + +TQString readEntry + const TQString &key + const TQString &def = TQString::null + bool *ok = 0 + + +The ok is not passed and the returned value is a tuple of +the TQString result and the ok flag. + + + +TQStringList readListEntry + const TQString &key + bool *ok = 0 + + +The ok is not passed and the returned value is a tuple of +the TQStringList result and the ok flag. + + + +TQStringList readListEntry + const TQString &key + const TQChar &separator + bool *ok = 0 + + +The ok is not passed and the returned value is a tuple of +the TQStringList result and the ok flag. + + + +int readNumEntry + const TQString &key + int def = 0 + bool *ok = 0 + + +The ok is not passed and the returned value is a tuple of +the int result and the ok flag. + + + + bool writeEntry + const TQString &key + bool value + + +Not implemented. + + +%End + + +class TQSettings +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQSGIStyle (TQt v2.2+) + + void scrollBarMetrics + const TQScrollBar *sb + int &sliderMin + int &sliderMax + int &sliderLength + int &buttonDim + + +This takes only the sb parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. +(TQt v2) + + +%End + + +%If (TQt_STYLE_SGI) + +class TQSGIStyle : TQMotifStyle +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQSignalMapper + +TQSignalMapper is fully implemented. + + +%End + + +class TQSignalMapper : TQObject +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQSimpleRichText (TQt v2+) + +TQSimpleRichText is fully implemented. + + +%End + + +class TQSimpleRichText +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQSize + +The Python ++, +=, +-, -=, +*, *=, +/, /=, +==, != and __nonzero__ +operators are supported. + + + + TQCOORD &rheight + + + +Not implemented. + + + + TQCOORD &rwidth + + + +Not implemented. + + +%End + + +class TQSize +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQSizeGrip (TQt v2+) + +TQSizeGrip is fully implemented. + + +%End + + +%If (TQt_SIZEGRIP) + +class TQSizeGrip : TQWidget +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQSizePolicy (TQt v2+) + +TQSizePolicy is fully implemented. + + +%End + + +class TQSizePolicy +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQSlider + +TQSlider is fully implemented. + + +%End + + +class TQSlider : TQWidget, TQRangeControl +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQSocketNotifier + +TQSocketNotifier is fully implemented. + + +%End + + +class TQSocketNotifier : TQObject +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQSound (TQt v2.2+) + +TQSound is fully implemented. + + +%End + + +%If (TQt_SOUND) + +class TQSound : TQObject +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQSpinBox + + virtual int mapTextToValue + bool *ok + + +This returns a tuple of the int result and the modified +ok value. + + +%End + + +class TQSpinBox : TQWidget, TQRangeControl +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQSplashScreen (TQt v3.2.0+) + +TQSplashScreen is fully implemented. + + +%End + + +class TQSplashScreen : TQWidget +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQSplitter + + void getRange + int id + int *min + int *max + + +This takes the id parameter and returns the +min and max values as a tuple. (TQt v2+) + + +%End + + +%If (TQt_SPLITTER) + +class TQSplitter : TQFrame +{ +%TypeHeaderCode +#include +%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 sizes() const; + void setSizes(TQValueList); + + 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 +// +// 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 +TQStatusBar + +TQStatusBar is fully implemented. + + +%End + + +class TQStatusBar : TQWidget +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQChar (TQt v2+) + + uchar &cell const + + + +Not implemented. + + + + uchar &row const + + + +Not implemented. + + + +TQString + +A Python string object (or Unicode object) can be used whenever a +TQString can be used. A TQString can be +converted to a Python string object using the Python str() +function, and to a Python Unicode object using the Python +unicode() function. + + + +The Python +, +=, *, +*=, len, [] +(for reading slices and individual characters), in and +comparison operators are supported. + + + + TQCharRef at + uint i + + +Not yet implemented. (TQt v2+) + + + + TQChar constref const + uint i + + +Not yet implemented. (TQt v2+) + + + + TQChar &ref + uint i + + +Not yet implemented. (TQt v2+) + + + + TQString &setUnicodeCodes + const ushort *unicode_as_shorts + uint len + + +Not yet implemented. (TQt v2.1+) + + + + TQString &sprintf + const char *format + ... + + +Not implemented. + + + + short toShort + bool *ok = 0 + + +This returns a tuple of the short result and the +ok value. + + + + ushort toUShort + bool *ok = 0 + + +This returns a tuple of the ushort result and the +ok value. + + + + int toInt + bool *ok = 0 + + +This returns a tuple of the int result and the +ok value. + + + + uint toUInt + bool *ok = 0 + + +This returns a tuple of the uint result and the +ok value. + + + + long toLong + bool *ok = 0 + + +This returns a tuple of the long result and the +ok value. + + + + ulong toULong + bool *ok = 0 + + +This returns a tuple of the ulong result and the +ok value. + + + + float toFloat + bool *ok = 0 + + +This returns a tuple of the float result and the +ok value. + + + + double toDouble + bool *ok = 0 + + +This returns a tuple of the double result and the +ok value. + + +%End + + +class TQChar +{ +%TypeHeaderCode +#include +%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 +#include +%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(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 +// +// 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 +TQStringList (TQt v2+) + +The Python len, [] (for both reading and +writing slices and individual elements), del (for deleting +slices and individual elements), +, +=, +*, *=, ==, +!= and in operators are supported. + + + + Iterator append + const TQString &x + + +This does not return a value. + + + + Iterator prepend + const TQString &x + + +This does not return a value. + + +%End + + +class TQStringList +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQStrList + +This class isn't implemented. Whenever a TQStrList is the +return type of a function or the type of an argument, a Python list of strings +is used instead. + + +%End + + +%MappedType TQStrList +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQStyle (TQt v2+) + + virtual void getButtonShift + int &x + int &y + + +This takes no parameters and returns a tuple of the x and +y values. (TQt v2) + + + + virtual void scrollBarMetrics + const TQScrollBar *b + int &sliderMin + int &sliderMax + int &sliderLength + int &buttonDim + + +Thus takes only the b parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. +(TQt v2) + + + + virtual void tabbarMetrics + const TQTabBar *t + int &hframe + int &vframe + int &overlap + + +This takes only the t parameter and returns a tuple of the +hframe, vframe and +overlap values. (TQt v2) + + + +TQStyleOption (TQt v3+) + +TQStyleOption is fully implemented. + + +%End + + +class TQStyleOption +{ +%TypeHeaderCode +#define ENABLE_TQSTYLECONTROLELEMENTDATA_SLOW_COPY 1 +#include +%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 DialogButtonSizeMap; +typedef TQMap 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 +%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 +%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 ObjectEventSourceToHandlerMap; + typedef TQMap ObjectEventSourceDataToHandlerMap; + typedef TQMap 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 +// +// 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 +TQStyleFactory (TQt v3+) + +TQStyleFactory is fully implemented. + + +%End + + +class TQStyleFactory +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQStyleSheet (TQt v2+) + +TQStyleSheet is fully implemented. + + + +TQStyleSheetItem (TQt v2+) + +TQStyleSheetItem is fully implemented. + + +%End + + +class TQStyleSheetItem : TQt +{ +%TypeHeaderCode +#include +%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 +%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 &, +// 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 +// +// 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 +TQSyntaxHighlighter (TQt v3.1+) + +TQSyntaxHighlighter is fully implemented. + + +%End + + +class TQSyntaxHighlighter : TQt +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQTab + +TQTab is fully implemented. + + + +TQTabBar + + TQPtrList<TQTab> tabList + + + +This returns a list of TQTab instances. + + +%End + + +class TQTab : TQt +{ +%TypeHeaderCode +#include +%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 +%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 *()]; +%MethodCode + if ((sipRes = PyList_New(0)) == NULL) + sipIsErr = 1; + else + { + TQPtrList *tl; + TQTab *tab; + + Py_BEGIN_ALLOW_THREADS + tl = sipCpp -> sipProtect_tabList(); + Py_END_ALLOW_THREADS + + // Convert the list. + for (TQPtrListIterator 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 +// +// 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 +TQTabDialog + +TQTabDialog is fully implemented. + + +%End + + +%If (TQt_TABDIALOG) + +class TQTabDialog : TQDialog +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQTabWidget (TQt v2+) + +TQTabWidget is fully implemented. + + +%End + + +class TQTabWidget : TQWidget +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQTextBrowser (TQt v2+) + +TQTextBrowser is fully implemented. + + +%End + + +class TQTextBrowser : TQTextEdit +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQTextCodec (TQt v2+) + + virtual TQCString fromUnicode + const TQString &uc + int &lenInOut + + +The returned value is a tuple of the TQCString result and the +updated lenInOut. + + + +TQTextDecoder (TQt v2+) + +TQTextDecoder is fully implemented. + + + +TQTextEncoder (TQt v2+) + + virtual TQCString fromUnicode = 0 + const TQString &uc + int &lenInOut + + +The returned value is a tuple of the TQCString result and the +updated lenInOut. + + +%End + + +class TQTextEncoder +{ +%TypeHeaderCode +#include +%End + +public: + virtual TQCString fromUnicode(const TQString &,int & /In,Out/) = 0; +}; + + +class TQTextDecoder +{ +%TypeHeaderCode +#include +%End + +public: + virtual TQString toUnicode(const char *,int) = 0; +}; + + +class TQTextCodec +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQTextEdit (TQt v3+) + +int charAt + const TQPoint &pos + int *para = 0 + + +This takes only the pos parameter and returns a tuple of the +value returned via the para pointer and the int result. + + + + void del + + + +This has been renamed delChar in Python. + + + +virtual bool find + const TQString &expr + bool cs + bool wo + bool forward = TRUE + int *para = 0 + int *index = 0 + + +If the para and index 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 +para and index is returned. + + + +void getCursorPosition + int *para + int *index + + +This takes no parameters and returns a tuple of the values returned via the +para and index pointers. + + + +void getSelection + int *paraFrom + int *indexFrom + int *paraTo + int *indexTo + int selNum = 0 + + +This takes only the selNum parameter and returns a tuple of +the paraFrom, indexFrom, +paraTo and indexTo values. + + +%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 +%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 +// +// 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 +TQTextStream + + TQTextStream + FILE *fp + int mode + + +Not implemented. + + + + TQTextStream &readRawBytes + char *buf + uint len + + +Not yet implemented. + + + + TQTextStream &writeRawBytes + const char *buf + uint len + + +Not yet implemented. + + + +TQTextIStream (TQt v2+) + + TQTextIStream + FILE *fp + int mode + + +Not implemented. + + + +TQTextOStream (TQt v2+) + + TQTextOStream + FILE *fp + int mode + + +Not implemented. + + +%End + + +class TQTextStream +{ +%TypeHeaderCode +#include +%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 +%End + +public: + TQTextIStream(TQString *); + TQTextIStream(TQByteArray); +// TQTextIStream(FILE *); + +private: + TQTextIStream(const TQTextIStream &); +}; + + +class TQTextOStream : TQTextStream +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQTextView (TQt v2+) + +TQTextView is fully implemented. + + +%End + + +class TQTextView : TQTextEdit +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQThread (TQt v2.2+) + +TQThread is fully implemented. + + +%End + + +%If (TQt_THREAD_SUPPORT) + +class TQThread : TQt /CreatesThread/ +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQTimer + +TQTimer is fully implemented. + + +%End + + +class TQTimer : TQObject +{ +%TypeHeaderCode +#include +%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 +// +// 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 +%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 +# +# 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 +// +// 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 +TQToolBar + +TQToolBar is fully implemented. + + +%End + + +class TQToolBar : TQDockWindow +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQToolBox (TQt v3.2.0+) + +TQToolBox is fully implemented. + + +%End + + +class TQToolBox : TQFrame +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQToolButton + +TQToolButton is fully implemented. + + +%End + + +class TQToolButton : TQButton +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQToolTip + +TQToolTip is fully implemented. + + + +TQToolTipGroup + +TQToolTipGroup is fully implemented. + + +%End + + +class TQToolTipGroup : TQObject +{ +%TypeHeaderCode +#include +%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 +%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 +// +// 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 +TQTranslator (TQt v2+) + +TQTranslator is fully implemented. + + + +TQTranslatorMessage (TQt v2.2+) + +TQTranslatorMessage is fully implemented. + + +%End + + +class TQTranslatorMessage +{ +%TypeHeaderCode +#include +%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 +%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 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 +// +// 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 +TQUrl (TQt v2.1+) + +TQUrl is fully implemented, including the +TQString(), == and != +operators. + + +%End + + +class TQUrl +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQUrlInfo (TQt v2.1+) + +TQUrlInfo is fully implemented. + + +%End + + +%If (TQt_NETWORKPROTOCOL) + +class TQUrlInfo +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQUrlOperator (TQt v2.1+) + + virtual bool isDir + bool *ok + + +This returns a tuple of the bool result and the +ok value. + + +%End + + +%If (TQt_NETWORKPROTOCOL) + +class TQUrlOperator : TQObject, TQUrl +{ +%TypeHeaderCode +#include +%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 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 &,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 &); + 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 +// +// 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 +TQUuid (TQt v3.0+) + +TQUuid is fully implemented. + + +%End + + +class TQUuid +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQValidator + + virtual State validate + TQString& input + int& pos + + +The returned value is a tuple of the State result and the +updated pos. + + + +TQDoubleValidator + + State validate + TQString& input + int& pos + + +The returned value is a tuple of the State result and the +updated pos. + + + +TQIntValidator + + State validate + TQString& input + int& pos + + +The returned value is a tuple of the State result and the +updated pos. + + + +TQRegExpValidator (TQt v3+) + + virtual State validate + TQString& input + int& pos + + +The returned value is a tuple of the State result and the +updated pos. + + +%End + + +class TQValidator : TQObject +{ +%TypeHeaderCode +#include +%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 +%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 +%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 +%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 +// +// 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 +TQValueList<type> (TQt v2+) + +Types based on the TQValueList template are automatically +converted to and from Python lists of the type. + + +%End + + +template +%MappedType TQValueList +{ +%TypeHeaderCode +#include +%End + +%ConvertFromTypeCode + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + TQValueListConstIterator 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 *qvl = new TQValueList; + + 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(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 +{ +%TypeHeaderCode +#include +%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 on the heap. + + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + TQValueList *qvl = new TQValueList; + + 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 +// +// 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 +TQVariant (TQt v2.1+) + + TQVariant + const char *val + + +Not implemented. + + + + TQVariant + const TQBitArray &val + + +Not yet implemented. (TQt v3+) + + + + TQVariant + const TQValueList<TQVariant> &val + + +Not yet implemented. + + + + TQVariant + const TQMap<TQString,TQVariant> &val + + +Not yet implemented. + + + + TQBitArray &asBitArray + + + +Not yet implemented. (TQt v3+) + + + + bool &asBool + + + +Not implemented. + + + + double &asDouble + + + +Not implemented. + + + + int &asInt + + + +Not implemented. + + + + TQValueList<TQVariant> &asList + + + +Not implemented. + + + + TQMap<TQString,TQVariant> &asMap + + + +Not implemented. + + + + uint &asUInt + + + +Not implemented. + + + + TQValueListConstIterator<TQVariant>listBegin const + + + +Not implemented. + + + + TQValueListConstIterator<TQVariant>listEnd const + + + +Not implemented. + + + + TQMapConstIterator<TQString,TQVariant>mapBegin const + + + +Not implemented. + + + + TQMapConstIterator<TQString,TQVariant>mapEnd const + + + +Not implemented. + + + + TQMapConstIterator<TQString,TQVariant>mapFind const + const TQString &key + + +Not implemented. + + + + TQValueListConstIterator<TQString>stringListBegin const + + + +Not implemented. + + + + TQValueListConstIterator<TQString>stringListEnd const + + + +Not implemented. + + + + const TQBitArray toBitArray const + + + +Not yet implemented. (TQt v3+) + + + + const TQValueList<TQVariant>toList const + + + +Not yet implemented. + + + + const TQMap<TQString,TQVariant>toMap const + + + +Not yet implemented. + + +%End + + +class TQVariant +{ +%TypeHeaderCode +#include +%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(const TQMap &); + 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 toList() const; +// const TQMap toMap() const; + TQSizePolicy toSizePolicy() const; + +// TQValueListConstIterator listBegin() const; +// TQValueListConstIterator listEnd() const; +// TQValueListConstIterator stringListBegin() const; +// TQValueListConstIterator stringListEnd() const; +// TQMapConstIterator mapBegin() const; +// TQMapConstIterator mapEnd() const; +// TQMapConstIterator 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 & asList(); +// TQMap & 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 +// +// 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 +TQVBox (TQt v2+) + +TQVBox is fully implemented. + + +%End + + +class TQVBox : TQHBox +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQVButtonGroup (TQt v2+) + +TQVButtonGroup is fully implemented. + + +%End + + +class TQVButtonGroup : TQButtonGroup +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQVGroupBox (TQt v2+) + +TQVGroupBox is fully implemented. + + +%End + + +class TQVGroupBox : TQGroupBox +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQWaitCondition (TQt v2.2+) + +TQWaitCondition is fully implemented. + + +%End + + +%If (TQt_THREAD_SUPPORT) + +class TQWaitCondition +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQWhatsThis + +TQWhatsThis is fully implemented. + + +%End + + +class TQWhatsThis : TQt +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQWidget + + TQWExtra *extraData + + + +Not implemented. + + + + TQFocusData *focusData + + + +Not implemented. + + + + void lower + + + +This has been renamed to lowerW in Python. + + + + void raise + + + +This has been renamed to raiseW in Python. + + +%End + + +class TQWidget : TQObject, TQPaintDevice +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQWidgetList + +This class isn't implemented. Whenever a TQWidgetList is the +return type of a function or the type of an argument, a Python list of +instances is used instead. + + +%End + + +%MappedType TQWidgetList +{ +%TypeHeaderCode +#include +%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(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 +// +// 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 +TQWidgetStack + +TQWidgetStack is fully implemented. + + +%End + + +class TQWidgetStack : TQFrame +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQt Constants + +All constant values defined by TQt have equivalent constants defined to Python. + + +%End + + +%ModuleHeaderCode +#include +%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 +// +// 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 +// +// 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 +// +// 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 +TQWindowsStyle (TQt v2+) + + void getButtonShift + int &x + int &y + + +This takes no parameters and returns a tuple of the x and +y values. (TQt v2) + + + + void scrollBarMetrics + const TQTabBar *sb + int &sliderMin + int &sliderMax + int &sliderLength + int &buttonDim + + +This takes only the sb parameter and returns a tuple of the +sliderMin, sliderMax, +sliderLength and buttonDim values. +(TQt v2) + + + + void tabbarMetrics + const TQTabBar *t + int &hframe + int &vframe + int &overlap + + +This takes only the t parameter and returns a tuple of the +hframe, vframe and +overlap values. (TQt v2) + + +%End + + +%If (TQt_STYLE_WINDOWS) + +class TQWindowsStyle : TQCommonStyle +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQWindowsXPStyle (TQt v3.0.1+, Windows) + +TQWindowsXPStyle is fully implemented. + + +%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 +// +// 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 +TQWizard (TQt v2+) + +TQWizard is fully implemented. + + +%End + + +%If (TQt_WIZARD) + +class TQWizard : TQDialog +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQWMatrix + +The Python ==, != and +*= operators are supported. + + + + TQWMatrix invert const + bool *invertible = 0 + + +This takes no parameters and returns a tuple of the TQWMatrix +result and the invertible value. + + + + void map const + int x + int y + int *tx + int *ty + + +This takes the x and y parameters and +returns a tuple containing the tx and ty +values. + + + + void map const + float x + float y + float *tx + float *ty + + +This takes the x and y parameters and +returns a tuple containing the tx and ty +values. (TQt v1.x) + + + + void map const + double x + double y + double *tx + double *ty + + +This takes the x and y parameters and +returns a tuple containing the tx and ty +values. (TQt v2+) + + +%End + + +class TQWMatrix +{ +%TypeHeaderCode +#include +%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 +// +// 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 +TQWorkspace (TQt v2.1+) + +TQWorkspace is fully implemented. + + +%End + + +%If (TQt_WORKSPACE) + +class TQWorkspace : TQWidget +{ +%TypeHeaderCode +#include +%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 +// +// 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 diff --git a/sip/tqtaxcontainer/copying.sip b/sip/tqtaxcontainer/copying.sip new file mode 100644 index 0000000..49b4531 --- /dev/null +++ b/sip/tqtaxcontainer/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyTQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 + +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/tqtaxcontainer/tqaxbase.sip b/sip/tqtaxcontainer/tqaxbase.sip new file mode 100644 index 0000000..a29d504 --- /dev/null +++ b/sip/tqtaxcontainer/tqaxbase.sip @@ -0,0 +1,86 @@ +// This is the SIP interface definition for TQAxBase. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQAxBase (Windows, TQt v3+) + + TQAxObject + IUnknown *iface = 0 + + +Not implemented. + + + + long queryInterface + const TQUuid &uuid + void **iface + + +Not implemented. + + + + PropertyBag propertyBag const + + + +Not implemented. + + + + void setPropertyBag + const PropertyBag &bag + + +Not implemented. + + + + unsigned long registerWeakActiveObject + const TQString &guid + + +This is a utility method provided by PyTQt to make it easier to use +Mark Hammond's win32com module to manipulate objects +created by the tqtaxcontainer module. + + +The RegisterActiveObject() COM function is called to +register the TQAxBase instance as a weak object with the +guid GUID. The revoke handle is returned. + + + + static void revokeActiveObject + unsigned long rhandle + + +This is a wrapper around the RevokeActiveObject() COM +function and is called to revoke the object registered using +registerWeakActiveObject(). rhandle is +the revoke handle returned by registerWeakActiveObject(). + + +%End + + diff --git a/sip/tqtaxcontainer/tqaxobject.sip b/sip/tqtaxcontainer/tqaxobject.sip new file mode 100644 index 0000000..01521c2 --- /dev/null +++ b/sip/tqtaxcontainer/tqaxobject.sip @@ -0,0 +1,37 @@ +// This is the SIP interface definition for TQAxObject. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQAxObject (Windows, TQt v3+) + + TQAxObject + IUnknown *iface + TQObject *parent = 0 + const char *name = 0 + + +Not implemented. + + +%End + + diff --git a/sip/tqtaxcontainer/tqaxwidget.sip b/sip/tqtaxcontainer/tqaxwidget.sip new file mode 100644 index 0000000..3751088 --- /dev/null +++ b/sip/tqtaxcontainer/tqaxwidget.sip @@ -0,0 +1,37 @@ +// This is the SIP interface definition for TQAxWidget. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQAxWidget (Windows, TQt v3+) + + TQAxWidget + IUnknown *iface + TQWidget *parent = 0 + const char *name = 0 + + +Not implemented. + + +%End + + diff --git a/sip/tqtaxcontainer/tqtaxcontainermod.sip b/sip/tqtaxcontainer/tqtaxcontainermod.sip new file mode 100644 index 0000000..e1a4268 --- /dev/null +++ b/sip/tqtaxcontainer/tqtaxcontainermod.sip @@ -0,0 +1,32 @@ +// This is the SIP interface definition for the tqtaxcontainer module of PyTQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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.tqtaxcontainer 1 + +%Import tqt/tqtmod.sip + +%Include copying.sip + + +%Include tqaxbase.sip +%Include tqaxobject.sip +%Include tqaxwidget.sip diff --git a/sip/tqtcanvas/copying.sip b/sip/tqtcanvas/copying.sip new file mode 100644 index 0000000..49b4531 --- /dev/null +++ b/sip/tqtcanvas/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyTQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 + +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/tqtcanvas/tqcanvas.sip b/sip/tqtcanvas/tqcanvas.sip new file mode 100644 index 0000000..2fc5c0b --- /dev/null +++ b/sip/tqtcanvas/tqcanvas.sip @@ -0,0 +1,749 @@ +// This is the SIP interface definition for TQCanvas, TQCanvasEllipse, +// TQCanvasItem, TQCanvasItemList, TQCanvasLine, TQCanvasPixmap, +// TQCanvasPixmapArray, TQCanvasPolygon, TQCanvasPolygonalItem, TQCanvasRectangle, +// TQCanvasSpline, TQCanvasSprite, TQCanvasText and TQCanvasView. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQCanvas (TQt v2.2+) + +TQCanvas is fully implemented. + + + +TQCanvasEllipse (TQt v2.2+) + +TQCanvasEllipse is fully implemented. + + + +TQCanvasItem (TQt v2.2+) + +TQCanvasItem is fully implemented. + + + +TQCanvasItemList (TQt v2.2+) + +This class isn't implemented. Whenever a TQCanvasItemList is +the return type of a function or the type of an argument, a Python list of +TQCanvasItem instances is used instead. + + + +TQCanvasLine (TQt v2.2+) + +TQCanvasLine is fully implemented. + + + +TQCanvasPixmap (TQt v2.2+) + +TQCanvasPixmap is fully implemented. + + + +TQCanvasPixmapArray (TQt v2.2+) + + TQPixmapArray + TQPtrList<TQPixmap> pixmaps + TQPtrList<TQPoint> hotspots + + +The pixmaps argument is a Python list of TQPixmap instances, +and the hotspots argument is a Python list of TQPoint +instances. (TQt v2.2.0 - TQt v2.3.1) + + + + TQPixmapArray + TQValueList<TQPixmap> pixmaps + TQPointArray hotspots = TQPointArray() + + +The pixmaps argument is a Python list of TQPixmap instances. +(TQt v3+) + + + +TQCanvasPolygon (TQt v2.2+) + +TQCanvasPolygon is fully implemented. + + + +TQCanvasPolygonalItem (TQt v2.2+) + +TQCanvasPolygonalItem is fully implemented. + + + +TQCanvasRectangle (TQt v2.2+) + +TQCanvasRectangle is fully implemented. + + + +TQCanvasSpline (TQt v3.0+) + +TQCanvasSpline is fully implemented. + + + +TQCanvasSprite (TQt v2.2+) + +TQCanvasSprite is fully implemented. + + + +TQCanvasText (TQt v2.2+) + +TQCanvasText is fully implemented. + + + +TQCanvasView (TQt v2.2+) + +TQCanvasView is fully implemented. + + +%End + + +%MappedType TQCanvasItemList +{ +%TypeHeaderCode +#include +%End + +%ConvertFromTypeCode + // Convert to a Python list of TQCanvasItem instances. + + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + + for (TQCanvasItemList::Iterator it = sipCpp -> begin(); it != sipCpp -> end(); ++it) + { + PyObject *ci; + + if ((ci = sipConvertFromInstance(*it,sipClass_TQCanvasItem,sipTransferObj)) == NULL || PyList_SetItem(l,i,ci) < 0) + { + Py_XDECREF(ci); + Py_DECREF(l); + + return NULL; + } + + ++i; + } + + return l; +%End + +%ConvertToTypeCode + // At the moment this will never be called, so provide a null + // implementation. + + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + PyErr_Format(PyExc_TypeError,"Converting to TQCanvasItemList not yet implemented"); + + *sipIsErr = 1; + + return 0; +%End +}; + + +class TQCanvasItem : TQt +{ +%TypeHeaderCode +#include +%End + +public: + TQCanvasItem(TQCanvas * /TransferThis/); + +%ConvertToSubClassCode + Py_BEGIN_ALLOW_THREADS + + // Use the numeric type values for compatibility with TQt v2. + switch (sipCpp -> rtti()) + { + case 1: + sipClass = sipClass_TQCanvasSprite; + break; + + case 2: + sipClass = sipClass_TQCanvasPolygonalItem; + break; + + case 3: + sipClass = sipClass_TQCanvasText; + break; + + case 4: + sipClass = sipClass_TQCanvasPolygon; + break; + + case 5: + sipClass = sipClass_TQCanvasRectangle; + break; + + case 6: + sipClass = sipClass_TQCanvasEllipse; + break; + + case 7: + sipClass = sipClass_TQCanvasLine; + break; + + case 8: + sipClass = sipClass_TQCanvasSpline; + break; + + default: + sipClass = 0; + } + + Py_END_ALLOW_THREADS +%End + + double x() const; + double y() const; + double z() const; + + virtual void moveBy(double,double); + void move(double,double); + void setX(double); + void setY(double); + void setZ(double); + + bool animated() const; + virtual void setAnimated(bool); + virtual void setVelocity(double,double); + void setXVelocity(double); + void setYVelocity(double); + double xVelocity() const; + double yVelocity() const; + virtual void advance(int); + + virtual bool collidesWith(const TQCanvasItem *) const = 0; + + TQCanvasItemList collisions(bool) const; + + virtual void setCanvas(TQCanvas * /GetWrapper/); +%MethodCode + if (sipCpp -> canvas() != a0) + { + if (a0) + sipTransferTo(sipSelf,a0Wrapper); + else + sipTransferBack(sipSelf); + } + + Py_BEGIN_ALLOW_THREADS + sipSelfWasArg ? sipCpp->TQCanvasItem::setCanvas(a0) : sipCpp->setCanvas(a0); + Py_END_ALLOW_THREADS +%End + + virtual void draw(TQPainter &) = 0; + + void show(); + void hide(); + + virtual void setVisible(bool); + bool isVisible() const; + virtual void setSelected(bool); + bool isSelected() const; + virtual void setEnabled(bool); + bool isEnabled() const; + virtual void setActive(bool); + bool isActive() const; + + enum RttiValues { + Rtti_Item, + Rtti_Sprite, + Rtti_PolygonalItem, + Rtti_Text, + Rtti_Polygon, + Rtti_Rectangle, + Rtti_Ellipse, + Rtti_Line, + Rtti_Spline + }; + + virtual int rtti() const; + + virtual TQRect boundingRect() const = 0; + virtual TQRect boundingRectAdvanced() const; + + TQCanvas *canvas() const; + +protected: + void update(); + +private: + virtual bool collidesWith(const TQCanvasSprite *, + const TQCanvasPolygonalItem *, + const TQCanvasRectangle *, + const TQCanvasEllipse *, + const TQCanvasText *) const = 0; +}; + + +class TQCanvas : TQObject +{ +%TypeHeaderCode +#include +%End + +public: + TQCanvas(TQObject * /TransferThis/ = 0,const char * = 0); + TQCanvas(int,int); + TQCanvas(TQPixmap,int,int,int,int); + +%ConvertToSubClassCode + static struct class_graph { + const char *name; + sipWrapperType **type; + int yes, no; + } graph[] = { + {sipName_TQCanvasView, &sipClass_TQCanvasView, -1, 1}, + {sipName_TQCanvas, &sipClass_TQCanvas, -1, -1}, + }; + + 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 + + virtual void setTiles(TQPixmap,int,int,int,int); + virtual void setBackgroundPixmap(const TQPixmap &); + TQPixmap backgroundPixmap() const; + + virtual void setBackgroundColor(const TQColor &); + TQColor backgroundColor() const; + + virtual void setTile(int,int,int); + int tile(int,int) const; + + int tilesHorizontally() const; + int tilesVertically() const; + + int tileWidth() const; + int tileHeight() const; + + virtual void resize(int,int); + int width() const; + int height() const; + TQSize size() const; + TQRect rect() const; + bool onCanvas(int,int) const; + bool onCanvas(const TQPoint &) const; + bool validChunk(int,int) const; + bool validChunk(const TQPoint &) const; + + int chunkSize() const; + virtual void retune(int,int = 100); + + // These next three are marked as internal in the TQt v2.x + // documentation. +// bool sameChunk() const; +// virtual void setChangedChunk(int,int); +// virtual void setChangedChunkContaining(int,int); + virtual void setAllChanged(); + virtual void setChanged(const TQRect &); + virtual void setUnchanged(const TQRect &); + + TQCanvasItemList allItems(); + TQCanvasItemList collisions(const TQPoint &) const; + TQCanvasItemList collisions(const TQRect &) const; + TQCanvasItemList collisions(const TQPointArray &,const TQCanvasItem *, + bool) const; + + void drawArea(const TQRect &,TQPainter *,bool = 0); + + virtual void setAdvancePeriod(int); + virtual void setUpdatePeriod(int); + + virtual void setDoubleBuffering(bool); + +signals: + void resized(); + +public slots: + virtual void advance(); + virtual void update(); + +protected: + virtual void drawBackground(TQPainter &,const TQRect &); + virtual void drawForeground(TQPainter &,const TQRect &); + +private: + TQCanvas(const TQCanvas &); +}; + + +class TQCanvasView : TQScrollView +{ +%TypeHeaderCode +#include +%End + +public: + TQCanvasView(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + TQCanvasView(TQCanvas *,TQWidget * /TransferThis/ = 0,const char * = 0, + WFlags = 0); + + TQCanvas* canvas() const; + void setCanvas(TQCanvas *); + + const TQWMatrix &worldMatrix() const; + const TQWMatrix &inverseWorldMatrix() const; + bool setWorldMatrix(const TQWMatrix &); + +protected: + void drawContents(TQPainter *,int,int,int,int); + TQSize sizeHint() const; + +private: + TQCanvasView(const TQCanvasView &); +}; + + +class TQCanvasPixmap : TQPixmap +{ +%TypeHeaderCode +#include +%End + +public: + TQCanvasPixmap(const TQString &); + TQCanvasPixmap(const TQImage &); + TQCanvasPixmap(const TQPixmap &,const TQPoint &); + + int offsetX() const; + int offsetY() const; + void setOffset(int,int); + +private: + TQCanvasPixmap(const TQCanvasPixmap &); +}; + + +class TQCanvasPixmapArray +{ +%TypeHeaderCode +#include +%End + +public: + TQCanvasPixmapArray(); + TQCanvasPixmapArray(const TQString &,int = 0); + TQCanvasPixmapArray(TQValueList,TQPointArray = TQPointArray()); + + bool readPixmaps(const TQString &,int = 0) /ReleaseGIL/; + bool readCollisionMasks(const TQString &) /ReleaseGIL/; + + bool isValid() const; + + TQCanvasPixmap *image(int) const; + void setImage(int,TQCanvasPixmap * /Transfer/); + uint count() const; + +private: + TQCanvasPixmapArray(const TQCanvasPixmapArray &); +}; + + +class TQCanvasSprite : TQCanvasItem +{ +%TypeHeaderCode +#include +%End + +public: + TQCanvasSprite(TQCanvasPixmapArray *,TQCanvas * /TransferThis/); + + void setSequence(TQCanvasPixmapArray *); + + void move(double,double); + virtual void move(double,double,int); + void setFrame(int); + + enum FrameAnimationType { + Cycle, + Oscillate + }; + + virtual void setFrameAnimation(FrameAnimationType = Cycle,int = 1, + int = 0); + int frame() const; + int frameCount() const; + + int rtti() const; + + bool collidesWith(const TQCanvasItem *) const; + + TQRect boundingRect() const; + + int width() const; + int height() const; + + int leftEdge() const; + int topEdge() const; + int rightEdge() const; + int bottomEdge() const; + + int leftEdge(int) const; + int topEdge(int) const; + int rightEdge(int) const; + int bottomEdge(int) const; + TQCanvasPixmap *image() const; + virtual TQCanvasPixmap *imageAdvanced() const; + TQCanvasPixmap *image(int) const; + // This is really virtual, but we want to use the super-class's virtual + // handler. Having to do this is really a SIP bug. + void advance(int); + + void draw(TQPainter &); + +private: + TQCanvasSprite(const TQCanvasSprite &); +}; + + +class TQCanvasPolygonalItem : TQCanvasItem +{ +%TypeHeaderCode +#include +%End + +public: + TQCanvasPolygonalItem(TQCanvas * /TransferThis/); + + bool collidesWith(const TQCanvasItem *) const; + + virtual void setPen(TQPen); + virtual void setBrush(TQBrush); + + TQPen pen() const; + TQBrush brush() const; + + virtual TQPointArray areaPoints() const = 0; + virtual TQPointArray areaPointsAdvanced() const; + TQRect boundingRect() const; + + int rtti() const; + +protected: + void draw(TQPainter &); + virtual void drawShape(TQPainter &) = 0; + + bool winding() const; + void setWinding(bool); + + void invalidate(); + bool isValid() const; +}; + + +class TQCanvasRectangle : TQCanvasPolygonalItem +{ +%TypeHeaderCode +#include +%End + +public: + TQCanvasRectangle(TQCanvas * /TransferThis/); + TQCanvasRectangle(const TQRect &,TQCanvas * /TransferThis/); + TQCanvasRectangle(int,int,int,int,TQCanvas * /TransferThis/); + + int width() const; + int height() const; + void setSize(int,int); + TQSize size() const; + TQPointArray areaPoints() const; + TQRect rect() const; + + bool collidesWith(const TQCanvasItem *) const; + + int rtti() const; + +protected: + void drawShape(TQPainter &); + TQPointArray chunks() const; +}; + + +class TQCanvasPolygon : TQCanvasPolygonalItem +{ +%TypeHeaderCode +#include +%End + +public: + TQCanvasPolygon(TQCanvas * /TransferThis/); + + void setPoints(TQPointArray); + TQPointArray points() const; + void moveBy(double,double); + + TQPointArray areaPoints() const; + + int rtti() const; + +protected: + void drawShape(TQPainter &); +}; + + +class TQCanvasSpline : TQCanvasPolygon +{ +%TypeHeaderCode +#include +%End + +public: + TQCanvasSpline(TQCanvas * /TransferThis/); + + void setControlPoints(TQPointArray,bool = 1); + TQPointArray controlPoints() const; + bool closed() const; + + int rtti() const; +}; + + +class TQCanvasLine : TQCanvasPolygonalItem +{ +%TypeHeaderCode +#include +%End + +public: + TQCanvasLine(TQCanvas * /TransferThis/); + + void setPoints(int,int,int,int); + + TQPoint startPoint() const; + TQPoint endPoint() const; + + int rtti() const; + + void setPen(TQPen); + void moveBy(double,double); + +protected: + void drawShape(TQPainter &); + TQPointArray areaPoints() const; +}; + + +class TQCanvasEllipse : TQCanvasPolygonalItem +{ +%TypeHeaderCode +#include +%End + +public: + TQCanvasEllipse(TQCanvas * /TransferThis/); + TQCanvasEllipse(int,int,TQCanvas * /TransferThis/); + TQCanvasEllipse(int,int,int,int,TQCanvas * /TransferThis/); + + int width() const; + int height() const; + void setSize(int,int); + void setAngles(int,int); + int angleStart() const; + int angleLength() const; + TQPointArray areaPoints() const; + + bool collidesWith(const TQCanvasItem *) const; + + int rtti() const; + +protected: + void drawShape(TQPainter &); +}; + + +class TQCanvasText : TQCanvasItem +{ +%TypeHeaderCode +#include +%End + +public: + TQCanvasText(TQCanvas * /TransferThis/); + TQCanvasText(const TQString &,TQCanvas * /TransferThis/); + TQCanvasText(const TQString &,TQFont,TQCanvas * /TransferThis/); + + void setText(const TQString &); + void setFont(const TQFont &); + void setColor(const TQColor &); + TQString text() const; + TQFont font() const; + TQColor color() const; + + void moveBy(double,double); + + int textFlags() const; + void setTextFlags(int); + + TQRect boundingRect() const; + + bool collidesWith(const TQCanvasItem *) const; + + int rtti() const; + +protected: + virtual void draw(TQPainter &); + +private: + TQCanvasText(const TQCanvasText &); +}; diff --git a/sip/tqtcanvas/tqtcanvasmod.sip b/sip/tqtcanvas/tqtcanvasmod.sip new file mode 100644 index 0000000..420305e --- /dev/null +++ b/sip/tqtcanvas/tqtcanvasmod.sip @@ -0,0 +1,70 @@ +// This is the SIP interface definition for the tqtcanvas module of PyTQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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.tqtcanvas 1 + +%Import tqt/tqtmod.sip + +%Include copying.sip + + +%Include tqcanvas.sip + + +// The build file template. + +%Makefile tqtcanvas.pro.in +# The project file for the tqtcanvas module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited +# +# 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_TQT_MODULE@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End diff --git a/sip/tqtext/copying.sip b/sip/tqtext/copying.sip new file mode 100644 index 0000000..49b4531 --- /dev/null +++ b/sip/tqtext/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyTQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 + +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/tqtext/tqextscintilla.sip b/sip/tqtext/tqextscintilla.sip new file mode 100644 index 0000000..f9a7592 --- /dev/null +++ b/sip/tqtext/tqextscintilla.sip @@ -0,0 +1,411 @@ +// This is the SIP interface definition for TQextScintilla. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class TQextScintilla : TQextScintillaBase +{ +%TypeHeaderCode +#include +%End + +public: + enum { + AiMaintain, + AiOpening, + AiClosing + }; + + enum AutoCompletionSource { + AcsDocument, + AcsAPIs, +%If (TQScintilla_1_7 -) + AcsAll, +%End + }; + + enum BraceMatch { + NoBraceMatch, + StrictBraceMatch, + SloppyBraceMatch + }; + +%If (TQScintilla_1_4 -) + enum EdgeMode { + EdgeNone, + EdgeLine, + EdgeBackground + }; +%End + + enum EolMode { + EolWindows, + EolUnix, + EolMac + }; + + enum FoldStyle { + NoFoldStyle, + PlainFoldStyle, + CircledFoldStyle, + BoxedFoldStyle, + CircledTreeFoldStyle, + BoxedTreeFoldStyle + }; + + enum MarkerSymbol { + Circle, + Rectangle, + RightTriangle, + SmallRectangle, + RightArrow, + Invisible, + DownTriangle, + Minus, + Plus, + VerticalLine, + BottomLeftCorner, + LeftSideSplitter, + BoxedPlus, + BoxedPlusConnected, + BoxedMinus, + BoxedMinusConnected, + RoundedBottomLeftCorner, + LeftSideRoundedSplitter, + CircledPlus, + CircledPlusConnected, + CircledMinus, + CircledMinusConnected, + Background, + ThreeDots, + ThreeRightArrows + }; + + enum WhitespaceVisibility { + WsInvisible, + WsVisible, + WsVisibleAfterIndent + }; + + enum WrapMode { + WrapNone, + WrapWord, +%If (TQScintilla_1_7 -) + WrapCharacter, +%End + }; + +%If (TQScintilla_1_7 -) + enum WrapVisualFlag { + WrapFlagNone, + WrapFlagByText, + WrapFlagByBorder, + }; +%End + + TQextScintilla(TQWidget * /TransferThis/ = 0,const char * = 0, + WFlags = 0); + + bool autoCompletionCaseSensitivity(); +%If (TQScintilla_1_7 -) + bool autoCompletionFillupsEnabled(); +%End + bool autoCompletionReplaceWord(); + bool autoCompletionShowSingle(); + AutoCompletionSource autoCompletionSource() const; + int autoCompletionThreshold() const; + bool autoIndent() const; + bool backspaceUnindents(); + void beginUndoAction(); + BraceMatch braceMatching() const; + int callTipsVisible() const; +%If (TQScintilla_1_7 -) + void cancelList(); +%End + void clearRegisteredImages(); + void convertEols(EolMode); +%If (TQScintilla_1_3 -) + TQextScintillaDocument document(); +%End + void endUndoAction(); + +%If (TQScintilla_1_4 -) + TQColor edgeColor(); + int edgeColumn(); + EdgeMode edgeMode(); +%End + + EolMode eolMode(); + bool eolVisibility(); + +%If (TQScintilla_1_7 -) + TQColor color() const; + TQColor paper() const; +%End + +%If (TQScintilla_1_6 -) + virtual bool findFirst(const TQString &,bool,bool,bool,bool,bool = 1, + int = -1,int = -1,bool = 1); +%End +%If (- TQScintilla_1_6) + virtual bool findFirst(const TQString &,bool,bool,bool,bool,bool = 1, + int = -1,int = -1); +%End + virtual bool findNext(); + +%If (TQScintilla_1_7 -) + int firstVisibleLine(); +%End + + FoldStyle folding() const; + + void getCursorPosition(int *,int *); + void getSelection(int *,int *,int *,int *); + bool hasSelectedText(); + + int indentation(int); + bool indentationGuides(); + bool indentationsUseTabs(); + int indentationWidth(); + +%If (TQScintilla_1_7 -) + bool isCallTipActive(); + bool isListActive(); +%End + bool isModified(); + bool isReadOnly(); + bool isRedoAvailable(); + bool isUndoAvailable(); + bool isUtf8(); + int lineAt(const TQPoint &); + int lineLength(int); + int lines(); + int length(); +%If (TQScintilla_1_7 -) + TQextScintillaLexer *lexer() const; +%End + + bool marginLineNumbers(int); + int marginMarkerMask(int); + bool marginSensitivity(int); + int marginWidth(int); + + int markerDefine(MarkerSymbol,int = -1); + int markerDefine(char,int = -1); + int markerDefine(const TQPixmap *,int = -1); + int markerAdd(int,int); + unsigned markersAtLine(int); + void markerDelete(int,int = -1); + void markerDeleteAll(int = -1); + void markerDeleteHandle(int); + int markerLine(int); + int markerFindNext(int,unsigned); + int markerFindPrevious(int,unsigned); +%If (TQScintilla_1_3 -) + virtual void recolor(int = 0,int = -1); +%End + void registerImage(int,const TQPixmap *); + virtual void replace(const TQString &); + void resetFoldMarginColors(); + void setFoldMarginColors(const TQColor &,const TQColor &); + + void setAutoCompletionAPIs(TQextScintillaAPIs * = 0); + void setAutoCompletionFillups(const char *); +%If (TQScintilla_1_7 -) + void setAutoCompletionFillupsEnabled(bool); + void setAutoCompletionStartCharacters(const char *); +%End + + void setCallTipsAPIs(TQextScintillaAPIs * = 0); + void setCallTipsBackgroundColor(const TQColor &); + void setCallTipsForegroundColor(const TQColor &); + void setCallTipsHighlightColor(const TQColor &); + void setCallTipsVisible(int); + +%If (TQScintilla_1_3 -) + void setDocument(const TQextScintillaDocument &); +%End + +%If (TQScintilla_1_4 -) + void setEdgeColor(const TQColor &); + void setEdgeColumn(int); + void setEdgeMode(EdgeMode); +%End + +%If (TQScintilla_1_7 -) + virtual void setFont(const TQFont &); +%End + + void setMarkerBackgroundColor(const TQColor &,int = -1); + void setMarkerForegroundColor(const TQColor &,int = -1); + + void setMatchedBraceBackgroundColor(const TQColor &); + void setMatchedBraceForegroundColor(const TQColor &); + void setUnmatchedBraceBackgroundColor(const TQColor &); + void setUnmatchedBraceForegroundColor(const TQColor &); + +%If (TQScintilla_1_7 -) + void setWrapVisualFlags(WrapVisualFlag, + WrapVisualFlag = TQextScintilla::WrapFlagNone, int = 0); +%End + + TQString selectedText(); +%If (TQScintilla_1_7 -) + void showUserList(int, const TQStringList &); +%End + TQextScintillaCommandSet *standardCommands() const; + bool tabIndents(); + int tabWidth(); + TQString text(); + TQString text(int); +%If (TQScintilla_1_7 -) + int textHeight(int); +%End + WhitespaceVisibility whitespaceVisibility(); +%If (TQScintilla_1_4 -) + WrapMode wrapMode(); +%End + +public slots: + virtual void append(const TQString &); +%If (TQScintilla_1_7 -) + virtual void autoCompleteFromAll(); +%End + virtual void autoCompleteFromAPIs(); + virtual void autoCompleteFromDocument(); + virtual void callTip(); + virtual void clear(); + virtual void copy(); + virtual void cut(); + + virtual void ensureCursorVisible(); + virtual void ensureLineVisible(int); +%If (TQScintilla_1_7 -) + virtual void foldAll(bool = 0); +%End +%If (- TQScintilla_1_7) + virtual void foldAll(); +%End + virtual void foldLine(int); + virtual void indent(int); +%If (TQScintilla_1_4 -) + virtual void insert(const TQString &); +%End + virtual void insertAt(const TQString &,int,int); + virtual void moveToMatchingBrace(); + virtual void paste(); + virtual void redo(); + virtual void removeSelectedText(); +%If (TQScintilla_1_4 -) + virtual void resetSelectionBackgroundColor(); + virtual void resetSelectionForegroundColor(); +%End + virtual void selectAll(bool = 1); + virtual void selectToMatchingBrace(); + + virtual void setAutoCompletionCaseSensitivity(bool); + virtual void setAutoCompletionReplaceWord(bool); + virtual void setAutoCompletionShowSingle(bool); + virtual void setAutoCompletionSource(AutoCompletionSource); + virtual void setAutoCompletionThreshold(int); + virtual void setAutoIndent(bool); + virtual void setBraceMatching(BraceMatch); + virtual void setBackspaceUnindents(bool); +%If (TQScintilla_1_3 -) + virtual void setCaretForegroundColor(const TQColor &); + virtual void setCaretLineBackgroundColor(const TQColor &); + virtual void setCaretLineVisible(bool); + virtual void setCaretWidth(int); +%End +%If (TQScintilla_1_7 -) + virtual void setColor(const TQColor &); +%End + virtual void setCursorPosition(int,int); + virtual void setEolMode(EolMode); + virtual void setEolVisibility(bool); + virtual void setFolding(FoldStyle); + + virtual void setIndentation(int,int); + virtual void setIndentationGuides(bool); + virtual void setIndentationGuidesBackgroundColor(const TQColor &); + virtual void setIndentationGuidesForegroundColor(const TQColor &); + virtual void setIndentationsUseTabs(bool); + virtual void setIndentationWidth(int); + + virtual void setLexer(TQextScintillaLexer * = 0); + + virtual void setMarginsBackgroundColor(const TQColor &); + virtual void setMarginsFont(const TQFont &); + virtual void setMarginsForegroundColor(const TQColor &); + + virtual void setMarginLineNumbers(int,bool); + virtual void setMarginMarkerMask(int,int); + virtual void setMarginSensitivity(int,bool); + virtual void setMarginWidth(int,int); + virtual void setMarginWidth(int,const TQString &); + + virtual void setModified(bool); +%If (TQScintilla_1_7 -) + virtual void setPaper(const TQColor &); +%End + virtual void setReadOnly(bool); + virtual void setSelection(int,int,int,int); +%If (TQScintilla_1_3 -) + virtual void setSelectionBackgroundColor(const TQColor &); + virtual void setSelectionForegroundColor(const TQColor &); +%End + virtual void setTabIndents(bool); + virtual void setTabWidth(int); + virtual void setText(const TQString &); + virtual void setUtf8(bool); + virtual void setWhitespaceVisibility(WhitespaceVisibility); +%If (TQScintilla_1_4 -) + virtual void setWrapMode(WrapMode); +%End + + virtual void undo(); + virtual void unindent(int); + + virtual void zoomIn(int); + virtual void zoomIn(); + virtual void zoomOut(int); + virtual void zoomOut(); + virtual void zoomTo(int); + +signals: + void cursorPositionChanged(int,int); + void copyAvailable(bool); + void marginClicked(int,int,TQt::ButtonState); + void modificationAttempted(); + void modificationChanged(bool); + void selectionChanged(); + void textChanged(); +%If (TQScintilla_1_7 -) + void userListActivated(int, const TQString &); +%End + +private: + TQextScintilla(const TQextScintilla &); + +}; diff --git a/sip/tqtext/tqextscintillaapis.sip b/sip/tqtext/tqextscintillaapis.sip new file mode 100644 index 0000000..170a80b --- /dev/null +++ b/sip/tqtext/tqextscintillaapis.sip @@ -0,0 +1,42 @@ +// This is the SIP interface definition for TQextScintillaAPIs. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class TQextScintillaAPIs +{ +%TypeHeaderCode +#include +%End + +public: + TQextScintillaAPIs(); + + void add(const TQString &); + bool load(const TQString &); + void clear(); + +private: + TQextScintillaAPIs(const TQextScintillaAPIs &); +}; diff --git a/sip/tqtext/tqextscintillabase.sip b/sip/tqtext/tqextscintillabase.sip new file mode 100644 index 0000000..23a2a65 --- /dev/null +++ b/sip/tqtext/tqextscintillabase.sip @@ -0,0 +1,1024 @@ +// This is the SIP interface definition for TQextScintillaBase. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class TQextScintillaBase : TQWidget +{ +%TypeHeaderCode +#include +%End + +public: + enum { + SCI_START, + SCI_OPTIONAL_START, + SCI_LEXER_START, + SCI_ADDTEXT, + SCI_ADDSTYLEDTEXT, + SCI_INSERTTEXT, + SCI_CLEARALL, + SCI_CLEARDOCUMENTSTYLE, + SCI_GETLENGTH, + SCI_GETCHARAT, + SCI_GETCURRENTPOS, + SCI_GETANCHOR, + SCI_GETSTYLEAT, + SCI_REDO, + SCI_SETUNDOCOLLECTION, + SCI_SELECTALL, + SCI_SETSAVEPOINT, + SCI_GETSTYLEDTEXT, + SCI_CANREDO, + SCI_MARKERLINEFROMHANDLE, + SCI_MARKERDELETEHANDLE, + SCI_GETUNDOCOLLECTION, + SCI_GETVIEWWS, + SCI_SETVIEWWS, + SCI_POSITIONFROMPOINT, + SCI_POSITIONFROMPOINTCLOSE, + SCI_GOTOLINE, + SCI_GOTOPOS, + SCI_SETANCHOR, + SCI_GETCURLINE, + SCI_GETENDSTYLED, + SCI_CONVERTEOLS, + SCI_GETEOLMODE, + SCI_SETEOLMODE, + SCI_STARTSTYLING, + SCI_SETSTYLING, + SCI_GETBUFFEREDDRAW, + SCI_SETBUFFEREDDRAW, + SCI_SETTABWIDTH, + SCI_GETTABWIDTH, + SCI_SETCODEPAGE, + SCI_SETUSEPALETTE, + SCI_MARKERDEFINE, + SCI_MARKERSETFORE, + SCI_MARKERSETBACK, + SCI_MARKERADD, + SCI_MARKERDELETE, + SCI_MARKERDELETEALL, + SCI_MARKERGET, + SCI_MARKERNEXT, + SCI_MARKERPREVIOUS, + SCI_MARKERDEFINEPIXMAP, + SCI_SETMARGINTYPEN, + SCI_GETMARGINTYPEN, + SCI_SETMARGINWIDTHN, + SCI_GETMARGINWIDTHN, + SCI_SETMARGINMASKN, + SCI_GETMARGINMASKN, + SCI_SETMARGINSENSITIVEN, + SCI_GETMARGINSENSITIVEN, + SCI_STYLECLEARALL, + SCI_STYLESETFORE, + SCI_STYLESETBACK, + SCI_STYLESETBOLD, + SCI_STYLESETITALIC, + SCI_STYLESETSIZE, + SCI_STYLESETFONT, + SCI_STYLESETEOLFILLED, + SCI_STYLERESETDEFAULT, + SCI_STYLESETUNDERLINE, + SCI_STYLESETCASE, + SCI_STYLESETCHARACTERSET, + SCI_SETSELFORE, + SCI_SETSELBACK, + SCI_SETCARETFORE, + SCI_ASSIGNCMDKEY, + SCI_CLEARCMDKEY, + SCI_CLEARALLCMDKEYS, + SCI_SETSTYLINGEX, + SCI_STYLESETVISIBLE, + SCI_GETCARETPERIOD, + SCI_SETCARETPERIOD, + SCI_SETWORDCHARS, + SCI_BEGINUNDOACTION, + SCI_ENDUNDOACTION, + SCI_INDICSETSTYLE, + SCI_INDICGETSTYLE, + SCI_INDICSETFORE, + SCI_INDICGETFORE, + SCI_SETWHITESPACEFORE, + SCI_SETWHITESPACEBACK, + SCI_SETSTYLEBITS, + SCI_GETSTYLEBITS, + SCI_SETLINESTATE, + SCI_GETLINESTATE, + SCI_GETMAXLINESTATE, + SCI_GETCARETLINEVISIBLE, + SCI_SETCARETLINEVISIBLE, + SCI_GETCARETLINEBACK, + SCI_SETCARETLINEBACK, + SCI_STYLESETCHANGEABLE, + SCI_AUTOCSHOW, + SCI_AUTOCCANCEL, + SCI_AUTOCACTIVE, + SCI_AUTOCPOSSTART, + SCI_AUTOCCOMPLETE, + SCI_AUTOCSTOPS, + SCI_AUTOCSETSEPARATOR, + SCI_AUTOCGETSEPARATOR, + SCI_AUTOCSELECT, + SCI_AUTOCSETCANCELATSTART, + SCI_AUTOCGETCANCELATSTART, + SCI_AUTOCSETFILLUPS, + SCI_AUTOCSETCHOOSESINGLE, + SCI_AUTOCGETCHOOSESINGLE, + SCI_AUTOCSETIGNORECASE, + SCI_AUTOCGETIGNORECASE, + SCI_USERLISTSHOW, + SCI_AUTOCSETAUTOHIDE, + SCI_AUTOCGETAUTOHIDE, + SCI_AUTOCSETDROPRESTOFWORD, + SCI_AUTOCGETDROPRESTOFWORD, + SCI_SETINDENT, + SCI_GETINDENT, + SCI_SETUSETABS, + SCI_GETUSETABS, + SCI_SETLINEINDENTATION, + SCI_GETLINEINDENTATION, + SCI_GETLINEINDENTPOSITION, + SCI_GETCOLUMN, + SCI_SETHSCROLLBAR, + SCI_GETHSCROLLBAR, + SCI_SETINDENTATIONGUIDES, + SCI_GETINDENTATIONGUIDES, + SCI_SETHIGHLIGHTGUIDE, + SCI_GETHIGHLIGHTGUIDE, + SCI_GETLINEENDPOSITION, + SCI_GETCODEPAGE, + SCI_GETCARETFORE, + SCI_GETUSEPALETTE, + SCI_GETREADONLY, + SCI_SETCURRENTPOS, + SCI_SETSELECTIONSTART, + SCI_GETSELECTIONSTART, + SCI_SETSELECTIONEND, + SCI_GETSELECTIONEND, + SCI_SETPRINTMAGNIFICATION, + SCI_GETPRINTMAGNIFICATION, + SCI_SETPRINTCOLOURMODE, + SCI_GETPRINTCOLOURMODE, + SCI_FINDTEXT, + SCI_FORMATRANGE, + SCI_GETFIRSTVISIBLELINE, + SCI_GETLINE, + SCI_GETLINECOUNT, + SCI_SETMARGINLEFT, + SCI_GETMARGINLEFT, + SCI_SETMARGINRIGHT, + SCI_GETMARGINRIGHT, + SCI_GETMODIFY, + SCI_SETSEL, + SCI_GETSELTEXT, + SCI_GETTEXTRANGE, + SCI_HIDESELECTION, + SCI_POINTXFROMPOSITION, + SCI_POINTYFROMPOSITION, + SCI_LINEFROMPOSITION, + SCI_POSITIONFROMLINE, + SCI_LINESCROLL, + SCI_SCROLLCARET, + SCI_REPLACESEL, + SCI_SETREADONLY, + SCI_NULL, + SCI_CANPASTE, + SCI_CANUNDO, + SCI_EMPTYUNDOBUFFER, + SCI_UNDO, + SCI_CUT, + SCI_COPY, + SCI_PASTE, + SCI_CLEAR, + SCI_SETTEXT, + SCI_GETTEXT, + SCI_GETTEXTLENGTH, + SCI_GETDIRECTFUNCTION, + SCI_GETDIRECTPOINTER, + SCI_SETOVERTYPE, + SCI_GETOVERTYPE, + SCI_SETCARETWIDTH, + SCI_GETCARETWIDTH, + SCI_SETTARGETSTART, + SCI_GETTARGETSTART, + SCI_SETTARGETEND, + SCI_GETTARGETEND, + SCI_REPLACETARGET, + SCI_REPLACETARGETRE, + SCI_SEARCHINTARGET, + SCI_SETSEARCHFLAGS, + SCI_GETSEARCHFLAGS, + SCI_CALLTIPSHOW, + SCI_CALLTIPCANCEL, + SCI_CALLTIPACTIVE, + SCI_CALLTIPPOSSTART, + SCI_CALLTIPSETHLT, + SCI_CALLTIPSETBACK, + SCI_CALLTIPSETFORE, + SCI_CALLTIPSETFOREHLT, +%If (TQScintilla_1_6 -) + SCI_AUTOCSETMAXWIDTH, + SCI_AUTOCGETMAXWIDTH, + SCI_AUTOCSETMAXHEIGHT, + SCI_AUTOCGETMAXHEIGHT, +%End +%If (TQScintilla_1_7 -) + SCI_CALLTIPUSESTYLE, +%End + SCI_VISIBLEFROMDOCLINE, + SCI_DOCLINEFROMVISIBLE, + SCI_SETFOLDLEVEL, + SCI_GETFOLDLEVEL, + SCI_GETLASTCHILD, + SCI_GETFOLDPARENT, + SCI_SHOWLINES, + SCI_HIDELINES, + SCI_GETLINEVISIBLE, + SCI_SETFOLDEXPANDED, + SCI_GETFOLDEXPANDED, + SCI_TOGGLEFOLD, + SCI_ENSUREVISIBLE, + SCI_SETFOLDFLAGS, + SCI_ENSUREVISIBLEENFORCEPOLICY, +%If (TQScintilla_1_6 -) + SCI_WRAPCOUNT, +%End + SCI_SETTABINDENTS, + SCI_GETTABINDENTS, + SCI_SETBACKSPACEUNINDENTS, + SCI_GETBACKSPACEUNINDENTS, + SCI_SETMOUSEDWELLTIME, + SCI_GETMOUSEDWELLTIME, + SCI_WORDSTARTPOSITION, + SCI_WORDENDPOSITION, + SCI_SETWRAPMODE, + SCI_GETWRAPMODE, + SCI_SETLAYOUTCACHE, + SCI_GETLAYOUTCACHE, + SCI_SETSCROLLWIDTH, + SCI_GETSCROLLWIDTH, + SCI_TEXTWIDTH, + SCI_SETENDATLASTLINE, + SCI_GETENDATLASTLINE, + SCI_TEXTHEIGHT, + SCI_SETVSCROLLBAR, + SCI_GETVSCROLLBAR, + SCI_APPENDTEXT, + SCI_GETTWOPHASEDRAW, + SCI_SETTWOPHASEDRAW, + SCI_AUTOCGETTYPESEPARATOR, + SCI_AUTOCSETTYPESEPARATOR, + SCI_TARGETFROMSELECTION, + SCI_LINESJOIN, + SCI_LINESSPLIT, + SCI_SETFOLDMARGINCOLOUR, + SCI_SETFOLDMARGINHICOLOUR, + SCI_LINEDOWN, + SCI_LINEDOWNEXTEND, + SCI_LINEUP, + SCI_LINEUPEXTEND, + SCI_CHARLEFT, + SCI_CHARLEFTEXTEND, + SCI_CHARRIGHT, + SCI_CHARRIGHTEXTEND, + SCI_WORDLEFT, + SCI_WORDLEFTEXTEND, + SCI_WORDRIGHT, + SCI_WORDRIGHTEXTEND, + SCI_HOME, + SCI_HOMEEXTEND, + SCI_LINEEND, + SCI_LINEENDEXTEND, + SCI_DOCUMENTSTART, + SCI_DOCUMENTSTARTEXTEND, + SCI_DOCUMENTEND, + SCI_DOCUMENTENDEXTEND, + SCI_PAGEUP, + SCI_PAGEUPEXTEND, + SCI_PAGEDOWN, + SCI_PAGEDOWNEXTEND, + SCI_EDITTOGGLEOVERTYPE, + SCI_CANCEL, + SCI_DELETEBACK, + SCI_TAB, + SCI_BACKTAB, + SCI_NEWLINE, + SCI_FORMFEED, + SCI_VCHOME, + SCI_VCHOMEEXTEND, + SCI_ZOOMIN, + SCI_ZOOMOUT, + SCI_DELWORDLEFT, + SCI_DELWORDRIGHT, + SCI_LINECUT, + SCI_LINEDELETE, + SCI_LINETRANSPOSE, + SCI_LOWERCASE, + SCI_UPPERCASE, + SCI_LINESCROLLDOWN, + SCI_LINESCROLLUP, + SCI_DELETEBACKNOTLINE, + SCI_HOMEDISPLAY, + SCI_HOMEDISPLAYEXTEND, + SCI_LINEENDDISPLAY, + SCI_LINEENDDISPLAYEXTEND, + SCI_MOVECARETINSIDEVIEW, + SCI_LINELENGTH, + SCI_BRACEHIGHLIGHT, + SCI_BRACEBADLIGHT, + SCI_BRACEMATCH, + SCI_GETVIEWEOL, + SCI_SETVIEWEOL, + SCI_GETDOCPOINTER, + SCI_SETDOCPOINTER, + SCI_SETMODEVENTMASK, + SCI_GETEDGECOLUMN, + SCI_SETEDGECOLUMN, + SCI_GETEDGEMODE, + SCI_SETEDGEMODE, + SCI_GETEDGECOLOUR, + SCI_SETEDGECOLOUR, + SCI_SEARCHANCHOR, + SCI_SEARCHNEXT, + SCI_SEARCHPREV, + SCI_LINESONSCREEN, + SCI_USEPOPUP, + SCI_SELECTIONISRECTANGLE, + SCI_SETZOOM, + SCI_GETZOOM, + SCI_CREATEDOCUMENT, + SCI_ADDREFDOCUMENT, + SCI_RELEASEDOCUMENT, + SCI_GETMODEVENTMASK, + SCI_SETFOCUS, + SCI_GETFOCUS, + SCI_SETSTATUS, + SCI_GETSTATUS, + SCI_SETMOUSEDOWNCAPTURES, + SCI_GETMOUSEDOWNCAPTURES, + SCI_SETCURSOR, + SCI_GETCURSOR, + SCI_SETCONTROLCHARSYMBOL, + SCI_GETCONTROLCHARSYMBOL, + SCI_WORDPARTLEFT, + SCI_WORDPARTLEFTEXTEND, + SCI_WORDPARTRIGHT, + SCI_WORDPARTRIGHTEXTEND, + SCI_SETVISIBLEPOLICY, + SCI_DELLINELEFT, + SCI_DELLINERIGHT, + SCI_SETXOFFSET, + SCI_GETXOFFSET, + SCI_CHOOSECARETX, + SCI_GRABFOCUS, + SCI_SETXCARETPOLICY, + SCI_SETYCARETPOLICY, + SCI_LINEDUPLICATE, + SCI_REGISTERIMAGE, + SCI_SETPRINTWRAPMODE, + SCI_GETPRINTWRAPMODE, + SCI_CLEARREGISTEREDIMAGES, + SCI_STYLESETHOTSPOT, + SCI_SETHOTSPOTACTIVEFORE, + SCI_SETHOTSPOTACTIVEBACK, + SCI_SETHOTSPOTACTIVEUNDERLINE, + SCI_PARADOWN, + SCI_PARADOWNEXTEND, + SCI_PARAUP, + SCI_PARAUPEXTEND, +%If (TQScintilla_1_1 -) + SCI_POSITIONBEFORE, + SCI_POSITIONAFTER, + SCI_COPYRANGE, + SCI_COPYTEXT, +%End +%If (TQScintilla_1_3 -) + SCI_SETSELECTIONMODE, + SCI_GETSELECTIONMODE, + SCI_GETLINESELSTARTPOSITION, + SCI_GETLINESELENDPOSITION, + SCI_LINEDOWNRECTEXTEND, + SCI_LINEUPRECTEXTEND, + SCI_CHARLEFTRECTEXTEND, + SCI_CHARRIGHTRECTEXTEND, + SCI_HOMERECTEXTEND, + SCI_VCHOMERECTEXTEND, + SCI_LINEENDRECTEXTEND, + SCI_PAGEUPRECTEXTEND, + SCI_PAGEDOWNRECTEXTEND, + SCI_STUTTEREDPAGEUP, + SCI_STUTTEREDPAGEUPEXTEND, + SCI_STUTTEREDPAGEDOWN, + SCI_STUTTEREDPAGEDOWNEXTEND, + SCI_WORDLEFTEND, + SCI_WORDLEFTENDEXTEND, + SCI_WORDRIGHTEND, + SCI_WORDRIGHTENDEXTEND, + SCI_SETWHITESPACECHARS, + SCI_SETCHARSDEFAULT, + SCI_AUTOCGETCURRENT, + SCI_ALLOCATE, +%End + SCI_HOMEWRAP, + SCI_HOMEWRAPEXTEND, + SCI_LINEENDWRAP, + SCI_LINEENDWRAPEXTEND, + SCI_VCHOMEWRAP, + SCI_VCHOMEWRAPEXTEND, +%If (TQScintilla_1_1 -) + SCI_LINECOPY, +%End +%If (TQScintilla_1_6 -) + SCI_FINDCOLUMN, + SCI_GETCARETSTICKY, + SCI_SETCARETSTICKY, + SCI_TOGGLECARETSTICKY, +%End +%If (TQScintilla_1_3 -) + SCI_SETWRAPVISUALFLAGS, + SCI_GETWRAPVISUALFLAGS, + SCI_SETWRAPVISUALFLAGSLOCATION, + SCI_GETWRAPVISUALFLAGSLOCATION, + SCI_SETWRAPSTARTINDENT, + SCI_GETWRAPSTARTINDENT, +%End +%If (TQScintilla_1_7 -) + SCI_MARKERADDSET, + SCI_SETPASTECONVERTENDINGS + SCI_GETPASTECONVERTENDINGS + SCI_SELECTIONDUPLICATE + SCI_SETCARETLINEBACKALPHA + SCI_GETCARETLINEBACKALPHA + SCI_MARKERSETALPHA, + SCI_GETSELALPHA, + SCI_SETSELALPHA, +%End + SCI_STARTRECORD, + SCI_STOPRECORD, + SCI_SETLEXER, + SCI_GETLEXER, + SCI_COLOURISE, + SCI_SETPROPERTY, + SCI_SETKEYWORDS, + SCI_SETLEXERLANGUAGE, +%If (TQScintilla_1_6 -) + SCI_LOADLEXERLIBRARY, + SCI_GETPROPERTY, + SCI_GETPROPERTYEXPANDED, + SCI_GETPROPERTYINT, +%End +%If (TQScintilla_1_7 -) + SCI_GETSTYLEBITSNEEDED, +%End + }; + +%If (TQScintilla_1_7 -) + enum + { + SC_ALPHA_TRANSPARENT, + SC_ALPHA_OPAQUE, + SC_ALPHA_NOALPHA, + }; +%End + +%If (TQScintilla_1_3 -) + enum + { + SC_WRAPVISUALFLAG_NONE, + SC_WRAPVISUALFLAG_END, + SC_WRAPVISUALFLAG_START + }; + + enum + { + SC_WRAPVISUALFLAGLOC_DEFAULT, + SC_WRAPVISUALFLAGLOC_END_BY_TEXT, + SC_WRAPVISUALFLAGLOC_START_BY_TEXT + }; + + enum { + SC_SEL_STREAM, + SC_SEL_RECTANGLE, + SC_SEL_LINES + }; +%End + + enum { + SCWS_INVISIBLE, + SCWS_VISIBLEALWAYS, + SCWS_VISIBLEAFTERINDENT + }; + + enum { + SC_EOL_CRLF, + SC_EOL_CR, + SC_EOL_LF + }; + + enum { + SC_CP_DBCS, + SC_CP_UTF8 + }; + + enum { + SC_MARK_CIRCLE, + SC_MARK_ROUNDRECT, + SC_MARK_ARROW, + SC_MARK_SMALLRECT, + SC_MARK_SHORTARROW, + SC_MARK_EMPTY, + SC_MARK_ARROWDOWN, + SC_MARK_MINUS, + SC_MARK_PLUS, + SC_MARK_VLINE, + SC_MARK_LCORNER, + SC_MARK_TCORNER, + SC_MARK_BOXPLUS, + SC_MARK_BOXPLUSCONNECTED, + SC_MARK_BOXMINUS, + SC_MARK_BOXMINUSCONNECTED, + SC_MARK_LCORNERCURVE, + SC_MARK_TCORNERCURVE, + SC_MARK_CIRCLEPLUS, + SC_MARK_CIRCLEPLUSCONNECTED, + SC_MARK_CIRCLEMINUS, + SC_MARK_CIRCLEMINUSCONNECTED, + SC_MARK_BACKGROUND, + SC_MARK_DOTDOTDOT, + SC_MARK_ARROWS, + SC_MARK_PIXMAP, +%If (TQScintilla_1_6 -) + SC_MARK_FULLRECT, +%End + SC_MARK_CHARACTER + }; + + enum { + SC_MARKNUM_FOLDEREND, + SC_MARKNUM_FOLDEROPENMID, + SC_MARKNUM_FOLDERMIDTAIL, + SC_MARKNUM_FOLDERTAIL, + SC_MARKNUM_FOLDERSUB, + SC_MARKNUM_FOLDER, + SC_MARKNUM_FOLDEROPEN, + SC_MASK_FOLDERS + }; + + enum { + SC_MARGIN_SYMBOL, + SC_MARGIN_NUMBER, +%If (TQScintilla_1_7 -) + SC_MARGIN_BACK, + SC_MARGIN_FORE, +%End + }; + + enum { + STYLE_DEFAULT, + STYLE_LINENUMBER, + STYLE_BRACELIGHT, + STYLE_BRACEBAD, + STYLE_CONTROLCHAR, + STYLE_INDENTGUIDE, +%If (TQScintilla_1_7 -) + STYLE_CALLTIP, +%End + STYLE_LASTPREDEFINED, +%If (TQScintilla_1_3 -) + STYLE_MAX +%End + }; + + enum { + SC_CHARSET_ANSI, + SC_CHARSET_DEFAULT, + SC_CHARSET_BALTIC, + SC_CHARSET_CHINESEBIG5, + SC_CHARSET_EASTEUROPE, + SC_CHARSET_GB2312, + SC_CHARSET_GREEK, + SC_CHARSET_HANGUL, + SC_CHARSET_MAC, + SC_CHARSET_OEM, + SC_CHARSET_RUSSIAN, + SC_CHARSET_SHIFTJIS, + SC_CHARSET_SYMBOL, + SC_CHARSET_TURKISH, + SC_CHARSET_JOHAB, + SC_CHARSET_HEBREW, + SC_CHARSET_ARABIC, + SC_CHARSET_VIETNAMESE, + SC_CHARSET_THAI, +%If (TQScintilla_1_6 -) + SC_CHARSET_8859_15, +%End + }; + + enum { + SC_CASE_MIXED, + SC_CASE_UPPER, + SC_CASE_LOWER + }; + + enum { + INDIC_MAX, + INDIC_PLAIN, + INDIC_SQUIGGLE, + INDIC_TT, + INDIC_DIAGONAL, + INDIC_STRIKE, +%If (TQScintilla_1_2 -) + INDIC_HIDDEN, +%End +%If (TQScintilla_1_3 -) + INDIC_BOX, +%End +%If (TQScintilla_1_7 -) + INDIC_ROUNDBOX, +%End + INDIC0_MASK, + INDIC1_MASK, + INDIC2_MASK, + INDICS_MASK + }; + + enum { + SC_PRINT_NORMAL, + SC_PRINT_INVERTLIGHT, + SC_PRINT_BLACKONWHITE, + SC_PRINT_COLOURONWHITE, + SC_PRINT_COLOURONWHITEDEFAULTBG + }; + + enum { + SCFIND_WHOLEWORD, + SCFIND_MATCHCASE, + SCFIND_WORDSTART, + SCFIND_REGEXP, + SCFIND_POSIX + }; + + enum { + SC_FOLDLEVELBASE, + SC_FOLDLEVELWHITEFLAG, + SC_FOLDLEVELHEADERFLAG, + SC_FOLDLEVELBOXHEADERFLAG, + SC_FOLDLEVELBOXFOOTERFLAG, + SC_FOLDLEVELCONTRACTED, + SC_FOLDLEVELUNINDENT, + SC_FOLDLEVELNUMBERMASK + }; + + enum + { + SC_FOLDFLAG_BOX, + SC_FOLDFLAG_LINEBEFORE_EXPANDED, + SC_FOLDFLAG_LINEBEFORE_CONTRACTED, + SC_FOLDFLAG_LINEAFTER_EXPANDED, + SC_FOLDFLAG_LINEAFTER_CONTRACTED, + SC_FOLDFLAG_LEVELNUMBERS + }; + + enum { + SC_TIME_FOREVER + }; + + enum { + SC_WRAP_NONE, + SC_WRAP_WORD, +%If (TQScintilla_1_6 -) + SC_WRAP_CHAR, +%End + }; + + enum { + SC_CACHE_NONE, + SC_CACHE_CARET, + SC_CACHE_PAGE, + SC_CACHE_DOCUMENT + }; + + enum { + EDGE_NONE, + EDGE_LINE, + EDGE_BACKGROUND + }; + + enum { + SC_CURSORNORMAL, + SC_CURSORWAIT + }; + + enum { + VISIBLE_SLOP, + VISIBLE_STRICT + }; + + enum { + CARET_SLOP, + CARET_STRICT, + CARET_JUMPS, + CARET_EVEN + }; + + enum { + SC_MOD_INSERTTEXT, + SC_MOD_DELETETEXT, + SC_MOD_CHANGESTYLE, + SC_MOD_CHANGEFOLD, + SC_PERFORMED_USER, + SC_PERFORMED_UNDO, + SC_PERFORMED_REDO, +%If (TQScintilla_1_6 -) + SC_MULTISTEPUNDOREDO, +%End + SC_LASTSTEPINUNDOREDO, + SC_MOD_CHANGEMARKER, + SC_MOD_BEFOREINSERT, + SC_MOD_BEFOREDELETE, +%If (TQScintilla_1_6 -) + SC_MULTILINEUNDOREDO, +%End + SC_MODEVENTMASKALL + }; + + enum { + SCK_DOWN, + SCK_UP, + SCK_LEFT, + SCK_RIGHT, + SCK_HOME, + SCK_END, + SCK_PRIOR, + SCK_NEXT, + SCK_DELETE, + SCK_INSERT, + SCK_ESCAPE, + SCK_BACK, + SCK_TAB, + SCK_RETURN, + SCK_ADD, + SCK_SUBTRACT, + SCK_DIVIDE + }; + + enum { +%If (TQScintilla_1_7 -) + SCMOD_NORM, +%End + SCMOD_SHIFT, + SCMOD_CTRL, + SCMOD_ALT + }; + + enum { + SCLEX_CONTAINER, + SCLEX_NULL, + SCLEX_PYTHON, + SCLEX_CPP, + SCLEX_HTML, + SCLEX_XML, + SCLEX_PERL, + SCLEX_SQL, + SCLEX_VB, + SCLEX_PROPERTIES, + SCLEX_ERRORLIST, + SCLEX_MAKEFILE, + SCLEX_BATCH, + SCLEX_LATEX, + SCLEX_LUA, + SCLEX_DIFF, + SCLEX_CONF, + SCLEX_PASCAL, + SCLEX_AVE, + SCLEX_ADA, + SCLEX_LISP, + SCLEX_RUBY, + SCLEX_EIFFEL, + SCLEX_EIFFELKW, + SCLEX_TCL, + SCLEX_NNCRONTAB, + SCLEX_BULLANT, + SCLEX_VBSCRIPT, + SCLEX_ASP, + SCLEX_PHP, + SCLEX_BAAN, + SCLEX_MATLAB, +%If (TQScintilla_1_2 -) + SCLEX_SCRIPTOL, +%End + SCLEX_ASM, + SCLEX_CPPNOCASE, + SCLEX_FORTRAN, + SCLEX_F77, + SCLEX_CSS, + SCLEX_POV, +%If (TQScintilla_1_1 -) + SCLEX_LOUT, + SCLEX_ESCRIPT, +%End +%If (TQScintilla_1_2 -) + SCLEX_PS, + SCLEX_NSIS, + SCLEX_MMIXAL, +%End +%If (TQScintilla_1_3 -) + SCLEX_CLW, + SCLEX_CLWNOCASE, + SCLEX_LOT, + SCLEX_YAML, + SCLEX_TEX, + SCLEX_METAPOST, + SCLEX_POWERBASIC, + SCLEX_FORTH, + SCLEX_ERLANG, + SCLEX_OCTAVE, + SCLEX_MSSQL, + SCLEX_VERILOG, + SCLEX_KIX, + SCLEX_GUI4CLI, + SCLEX_SPECMAN, + SCLEX_AU3, + SCLEX_APDL, + SCLEX_BASH, +%End +%If (TQScintilla_1_5 -) + SCLEX_ASN1, + SCLEX_VHDL, +%End +%If (TQScintilla_1_6 -) + SCLEX_CAML, + SCLEX_BLITZBASIC, + SCLEX_PUREBASIC, + SCLEX_HASKELL, + SCLEX_PHPSCRIPT, + SCLEX_TADS3, + SCLEX_REBOL, + SCLEX_SMALLTALK, + SCLEX_FLAGSHIP, + SCLEX_CSOUND, +%End +%If (TQScintilla_1_7 -) + SCLEX_FREEBASIC, + SCLEX_INNOSETUP, + SCLEX_OPAL, + SCLEX_SPICE, +%End + }; + + TQextScintillaBase(TQWidget * /TransferThis/,const char *, + WFlags = 0); + +%ConvertToSubClassCode + static struct class_graph { + const char *name; + sipWrapperType **type; + int yes, no; + } graph[] = { + {sipName_TQextScintillaLexer, &sipClass_TQextScintillaLexer, 3, 1}, + {sipName_TQextScintillaBase, &sipClass_TQextScintillaBase, 15, 2}, + {sipName_TQextScintillaMacro, &sipClass_TQextScintillaMacro, -1, -1}, +#if TQSCINTILLA_VERSION >= 0x010300 + {sipName_TQextScintillaLexerPerl, &sipClass_TQextScintillaLexerPerl, -1, 4}, +#else + {NULL, NULL, -1, 4}, +#endif +#if TQSCINTILLA_VERSION >= 0x010100 + {sipName_TQextScintillaLexerHTML, &sipClass_TQextScintillaLexerHTML, -1, 5}, +#else + {NULL, NULL, -1, 5}, +#endif +#if TQSCINTILLA_VERSION >= 0x010500 + {sipName_TQextScintillaLexerRuby, &sipClass_TQextScintillaLexerRuby, -1, 6}, +#else + {NULL, NULL, -1, 6}, +#endif + {sipName_TQextScintillaLexerCPP, &sipClass_TQextScintillaLexerCPP, 11, 7}, + {sipName_TQextScintillaLexerPython, &sipClass_TQextScintillaLexerPython, -1, 8}, +#if TQSCINTILLA_VERSION >= 0x010100 + {sipName_TQextScintillaLexerSQL, &sipClass_TQextScintillaLexerSQL, -1, 9}, +#else + {NULL, NULL, -1, 9}, +#endif +#if TQSCINTILLA_VERSION >= 0x010400 + {sipName_TQextScintillaLexerBash, &sipClass_TQextScintillaLexerBash, -1, 10}, +#else + {NULL, NULL, -1, 10}, +#endif +#if TQSCINTILLA_VERSION >= 0x010500 + {sipName_TQextScintillaLexerLua, &sipClass_TQextScintillaLexerLua, -1, -1}, +#else + {NULL, NULL, -1, -1}, +#endif + {sipName_TQextScintillaLexerIDL, &sipClass_TQextScintillaLexerIDL, -1, 12}, + {sipName_TQextScintillaLexerJavaScript, &sipClass_TQextScintillaLexerJavaScript, -1, 13}, + {sipName_TQextScintillaLexerCSharp, &sipClass_TQextScintillaLexerCSharp, -1, 14}, + {sipName_TQextScintillaLexerJava, &sipClass_TQextScintillaLexerJava, -1, -1}, + {sipName_TQextScintilla, &sipClass_TQextScintilla, -1, -1}, + }; + + 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 + +%If (TQScintilla_1_3 -) + TQextScintillaBase *pool(); +%End + + long SendScintilla(unsigned int,unsigned long = 0,long = 0); + long SendScintilla(unsigned int,unsigned long,const char *); + long SendScintilla(unsigned int,const char *); + long SendScintilla(unsigned int,const char *,const char *); + long SendScintilla(unsigned int,long); + //long SendScintilla(unsigned int,int); + long SendScintilla(unsigned int,long,long,char *); + long SendScintilla(unsigned int,unsigned long,const TQColor &); + long SendScintilla(unsigned int,const TQColor &); + long SendScintilla(unsigned int,unsigned long,TQPainter *,const TQRect &, + long,long); + long SendScintilla(unsigned int,unsigned long,const TQPixmap *); + + virtual TQSize sizeHint() const; +%If (TQScintilla_1_5 -) + TQWidget *viewport() const; +%End + +signals: + void TQSCN_SELCHANGED(bool); + + void SCEN_CHANGE(); + +%If (TQScintilla_1_6 -) + void SCN_AUTOCSELECTION(const char *,int); +%End + void SCN_CHARADDED(int); + void SCN_CALLTIPCLICK(int); + void SCN_DOUBLECLICK(); + void SCN_DWELLEND(int,int,int); + void SCN_DWELLSTART(int,int,int); + void SCN_HOTSPOTCLICK(int,int); + void SCN_HOTSPOTDOUBLECLICK(int,int); + void SCN_MACRORECORD(unsigned int,unsigned long,long); + void SCN_MARGINCLICK(int,int,int); + void SCN_MODIFIED(int,int,const char *,int,int,int,int,int); + void SCN_MODIFYATTEMPTRO(); + void SCN_NEEDSHOWN(int,int); + void SCN_PAINTED(); + void SCN_SAVEPOINTLEFT(); + void SCN_SAVEPOINTREACHED(); + void SCN_STYLENEEDED(int); + void SCN_UPDATEUI(); + void SCN_USERLISTSELECTION(const char *,int); + void SCN_ZOOM(); + +protected: + bool eventFilter(TQObject *,TQEvent *); + virtual void keyPressEvent(TQKeyEvent *); + virtual void focusInEvent(TQFocusEvent *); + virtual void focusOutEvent(TQFocusEvent *); + virtual bool focusNextPrevChild(bool); +%If (TQScintilla_1_5 -) + virtual void startDrag(); +%End + +private: + TQextScintillaBase(const TQextScintillaBase &); +}; diff --git a/sip/tqtext/tqextscintillacommand.sip b/sip/tqtext/tqextscintillacommand.sip new file mode 100644 index 0000000..77dfb56 --- /dev/null +++ b/sip/tqtext/tqextscintillacommand.sip @@ -0,0 +1,44 @@ +// This is the SIP interface definition for TQextScintillaCommand. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class TQextScintillaCommand +{ +%TypeHeaderCode +#include +%End + +public: + void setKey(int); + void setAlternateKey(int); + int key() const; + int alternateKey() const; + static bool validKey(int); + TQString description() const; + +private: + TQextScintillaCommand(TQextScintilla *,int,int,const char *); + TQextScintillaCommand(const TQextScintillaCommand &); +}; diff --git a/sip/tqtext/tqextscintillacommandset.sip b/sip/tqtext/tqextscintillacommandset.sip new file mode 100644 index 0000000..b472345 --- /dev/null +++ b/sip/tqtext/tqextscintillacommandset.sip @@ -0,0 +1,52 @@ +// This is the SIP interface definition for the TQextScintillaCommandSet. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class TQextScintillaCommandSet +{ +%TypeHeaderCode +#include +%End + +public: + bool readSettings(TQSettings &,const char * = "/Scintilla"); + bool writeSettings(TQSettings &,const char * = "/Scintilla"); + +%If (TQScintilla_1_4 -) + TQPtrList &commands(); +%End +%If (- TQScintilla_1_4) + const TQPtrList &commands() const; +%End + +%If (TQScintilla_1_4 -) + void clearKeys(); + void clearAlternateKeys(); +%End + +private: + TQextScintillaCommandSet(TQextScintilla *); + TQextScintillaCommandSet(const TQextScintillaCommandSet &); +}; diff --git a/sip/tqtext/tqextscintilladocument.sip b/sip/tqtext/tqextscintilladocument.sip new file mode 100644 index 0000000..9c656b8 --- /dev/null +++ b/sip/tqtext/tqextscintilladocument.sip @@ -0,0 +1,42 @@ +// This is the SIP interface definition for TQextScintillaDocument. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (TQScintilla_1_3 -) + +class TQextScintillaDocument +{ +%TypeHeaderCode +#include +%End + +public: + TQextScintillaDocument(); + virtual ~TQextScintillaDocument(); + + TQextScintillaDocument(const TQextScintillaDocument &); +}; + +%End diff --git a/sip/tqtext/tqextscintillalexer.sip b/sip/tqtext/tqextscintillalexer.sip new file mode 100644 index 0000000..b13b14d --- /dev/null +++ b/sip/tqtext/tqextscintillalexer.sip @@ -0,0 +1,80 @@ +// This is the SIP interface definition for TQextScintillaLexer. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class TQextScintillaLexer : TQObject +{ +%TypeHeaderCode +#include +%End + +public: + TQextScintillaLexer(TQObject * /TransferThis/ = 0,const char * = 0); + + virtual const char *language() const = 0; + virtual const char *lexer() const = 0; + int autoIndentStyle(); + virtual TQColor color(int) const; + virtual bool eolFill(int) const; + virtual TQFont font(int) const; + virtual const char *keywords(int) const; + virtual TQString description(int) const = 0; + virtual TQColor paper(int) const; + virtual TQFont defaultFont() const; +%If (TQScintilla_1_7 -) + virtual TQColor defaultColor() const; + virtual TQColor defaultPaper() const; +%End + virtual void refreshProperties(); + bool readSettings(TQSettings &,const char * = "/Scintilla"); + bool writeSettings(TQSettings &,const char * = "/Scintilla") const; + +public slots: + virtual void setAutoIndentStyle(int); + virtual void setColor(const TQColor &,int = -1); + virtual void setDefaultFont(const TQFont &); +%If (TQScintilla_1_7 -) + virtual void setDefaultColor(const TQColor &); + virtual void setDefaultPaper(const TQColor &); +%End + virtual void setEolFill(bool,int = -1); + virtual void setFont(const TQFont &,int = -1); + virtual void setPaper(const TQColor &,int = -1); + +signals: + void colorChanged(const TQColor &,int); + void eolFillChanged(bool,int); + void fontChanged(const TQFont &,int); + void paperChanged(const TQColor &,int); + void propertyChanged(const char *,const char *); + +protected: + virtual bool readProperties(TQSettings &,const TQString &); + virtual bool writeProperties(TQSettings &,const TQString &) const; + +private: + TQextScintillaLexer(const TQextScintillaLexer &); + +}; diff --git a/sip/tqtext/tqextscintillalexerbash.sip b/sip/tqtext/tqextscintillalexerbash.sip new file mode 100644 index 0000000..0a3b95c --- /dev/null +++ b/sip/tqtext/tqextscintillalexerbash.sip @@ -0,0 +1,80 @@ +// This is the SIP interface definition for TQextScintillaLexerBash. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (TQScintilla_1_4 -) + +class TQextScintillaLexerBash : TQextScintillaLexer +{ +%TypeHeaderCode +#include +%End + +public: + enum { + Default, + Error, + Comment, + Number, + Keyword, + DoubleQuotedString, + SingleQuotedString, + Operator, + Identifier, + Scalar, + ParameterExpansion, + Backticks, + HereDocumentDelimiter, + SingleQuotedHereDocument + }; + + TQextScintillaLexerBash(TQObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + TQColor color(int) const; + bool eolFill(int) const; + TQFont font(int) const; + const char *keywords(int) const; + TQString description(int) const; + TQColor paper(int) const; + + void refreshProperties(); + bool foldComments() const; + bool foldCompact() const; + +public slots: + virtual void setFoldComments(bool); + virtual void setFoldCompact(bool); + +protected: + bool readProperties(TQSettings &,const TQString &); + bool writeProperties(TQSettings &,const TQString &) const; + +private: + TQextScintillaLexerBash(const TQextScintillaLexerBash &); +}; + +%End diff --git a/sip/tqtext/tqextscintillalexerbatch.sip b/sip/tqtext/tqextscintillalexerbatch.sip new file mode 100644 index 0000000..fa660f0 --- /dev/null +++ b/sip/tqtext/tqextscintillalexerbatch.sip @@ -0,0 +1,62 @@ +// This is the SIP interface definition for TQextScintillaLexerBatch. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (TQScintilla_1_6 -) + +class TQextScintillaLexerBatch : TQextScintillaLexer +{ +%TypeHeaderCode +#include +%End + +public: + enum { + Default, + Comment, + Keyword, + Label, + HideCommandChar, + ExternalCommand, + Variable, + Operator + }; + + TQextScintillaLexerBatch(TQObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + TQColor color(int) const; + bool eolFill(int) const; + TQFont font(int) const; + const char *keywords(int) const; + TQString description(int) const; + TQColor paper(int) const; + +private: + TQextScintillaLexerBatch(const TQextScintillaLexerBatch &); +}; + +%End diff --git a/sip/tqtext/tqextscintillalexercpp.sip b/sip/tqtext/tqextscintillalexercpp.sip new file mode 100644 index 0000000..786893d --- /dev/null +++ b/sip/tqtext/tqextscintillalexercpp.sip @@ -0,0 +1,98 @@ +// This is the SIP interface definition for TQextScintillaLexerCPP. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class TQextScintillaLexerCPP : TQextScintillaLexer +{ +%TypeHeaderCode +#include +%End + +public: + enum { +%If (TQScintilla_1_1 -) + Default, +%End + WhiteSpace, + Comment, + CommentLine, + CommentDoc, + Number, + Keyword, + DoubleQuotedString, + SingleQuotedString, + UUID, + PreProcessor, + Operator, + Identifier, + UnclosedString, + VerbatimString, + Regex, + CommentLineDoc, + KeywordSet2, + CommentDocKeyword, + CommentDocKeywordError, +%If (TQScintilla_1_1 -) + GlobalClass, +%End + }; + + TQextScintillaLexerCPP(TQObject * /TransferThis/ = 0,const char * = 0, + bool = 0); + + const char *language() const; + const char *lexer() const; + TQColor color(int) const; + bool eolFill(int) const; + TQFont font(int) const; + const char *keywords(int) const; + TQString description(int) const; + TQColor paper(int) const; + + void refreshProperties(); +%If (TQScintilla_1_1 -) + bool foldAtElse() const; +%End + bool foldComments() const; + bool foldCompact() const; + bool foldPreprocessor() const; + bool stylePreprocessor() const; + +public slots: +%If (TQScintilla_1_1 -) + virtual void setFoldAtElse(bool); +%End + virtual void setFoldComments(bool); + virtual void setFoldCompact(bool); + virtual void setFoldPreprocessor(bool); + virtual void setStylePreprocessor(bool); + +protected: + bool readProperties(TQSettings &,const TQString &); + bool writeProperties(TQSettings &,const TQString &) const; + +private: + TQextScintillaLexerCPP(const TQextScintillaLexerCPP &); +}; diff --git a/sip/tqtext/tqextscintillalexercsharp.sip b/sip/tqtext/tqextscintillalexercsharp.sip new file mode 100644 index 0000000..cf5aafb --- /dev/null +++ b/sip/tqtext/tqextscintillalexercsharp.sip @@ -0,0 +1,47 @@ +// This is the SIP interface definition for TQextScintillaLexerCSharp. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class TQextScintillaLexerCSharp : TQextScintillaLexerCPP +{ +%TypeHeaderCode +#include +%End + +public: + TQextScintillaLexerCSharp(TQObject * /TransferThis/ = 0, + const char * = 0); + + const char *language() const; + TQColor color(int) const; + bool eolFill(int) const; + TQFont font(int) const; + const char *keywords(int) const; + TQString description(int) const; + TQColor paper(int) const; + +private: + TQextScintillaLexerCSharp(const TQextScintillaLexerCSharp &); +}; diff --git a/sip/tqtext/tqextscintillalexercss.sip b/sip/tqtext/tqextscintillalexercss.sip new file mode 100644 index 0000000..adc5672 --- /dev/null +++ b/sip/tqtext/tqextscintillalexercss.sip @@ -0,0 +1,81 @@ +// This is the SIP interface definition for TQextScintillaLexerCSS. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (TQScintilla_1_6 -) + +class TQextScintillaLexerCSS : TQextScintillaLexer +{ +%TypeHeaderCode +#include +%End + +public: + enum { + Default, + Tag, + ClassSelector, + PseudoClass, + UnknownPseudoClass, + Operator, + CSS1Property, + UnknownProperty, + Value, + Comment, + IDSelector, + Important, + AtRule, + DoubleQuotedString, + SingleQuotedString, + CSS2Property, + Attribute + }; + + TQextScintillaLexerCSS(TQObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + TQColor color(int) const; + TQFont font(int) const; + const char *keywords(int) const; + TQString description(int) const; + + void refreshProperties(); + bool foldComments() const; + bool foldCompact() const; + +public slots: + virtual void setFoldComments(bool); + virtual void setFoldCompact(bool); + +protected: + bool readProperties(TQSettings &,const TQString &); + bool writeProperties(TQSettings &,const TQString &) const; + +private: + TQextScintillaLexerCSS(const TQextScintillaLexerCSS &); +}; + +%End diff --git a/sip/tqtext/tqextscintillalexerdiff.sip b/sip/tqtext/tqextscintillalexerdiff.sip new file mode 100644 index 0000000..576c826 --- /dev/null +++ b/sip/tqtext/tqextscintillalexerdiff.sip @@ -0,0 +1,57 @@ +// This is the SIP interface definition for TQextScintillaLexerDiff. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (TQScintilla_1_6 -) + +class TQextScintillaLexerDiff : TQextScintillaLexer +{ +%TypeHeaderCode +#include +%End + +public: + enum { + Default, + Comment, + Command, + Header, + Position, + LineRemoved, + LineAdded + }; + + TQextScintillaLexerDiff(TQObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + TQColor color(int) const; + TQString description(int) const; + +private: + TQextScintillaLexerDiff(const TQextScintillaLexerDiff &); +}; + +%End diff --git a/sip/tqtext/tqextscintillalexerhtml.sip b/sip/tqtext/tqextscintillalexerhtml.sip new file mode 100644 index 0000000..6133b98 --- /dev/null +++ b/sip/tqtext/tqextscintillalexerhtml.sip @@ -0,0 +1,178 @@ +// This is the SIP interface definition for TQextScintillaLexerHTML. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (TQScintilla_1_1 -) + +class TQextScintillaLexerHTML : TQextScintillaLexer +{ +%TypeHeaderCode +#include +%End + +public: + enum { + Default, + Tag, + UnknownTag, + Attribute, + UnknownAttribute, + HTMLNumber, + HTMLDoubleQuotedString, + HTMLSingleQuotedString, + OtherInTag, + HTMLComment, + Entity, + XMLTagEnd, + XMLStart, + XMLEnd, + Script, + ASPAtStart, + ASPStart, + CDATA, + PHPStart, + HTMLValue, + ASPXCComment, + SGMLDefault, + SGMLCommand, + SGMLParameter, + SGMLDoubleQuotedString, + SGMLSingleQuotedString, + SGMLError, + SGMLSpecial, + SGMLEntity, + SGMLComment, + SGMLParameterComment, + SGMLBlockDefault, + JavaScriptStart, + JavaScriptDefault, + JavaScriptComment, + JavaScriptCommentLine, + JavaScriptCommentDoc, + JavaScriptNumber, + JavaScriptWord, + JavaScriptKeyword, + JavaScriptDoubleQuotedString, + JavaScriptSingleQuotedString, + JavaScriptSymbol, + JavaScriptUnclosedString, + JavaScriptRegex, + ASPJavaScriptStart, + ASPJavaScriptDefault, + ASPJavaScriptComment, + ASPJavaScriptCommentLine, + ASPJavaScriptCommentDoc, + ASPJavaScriptNumber, + ASPJavaScriptWord, + ASPJavaScriptKeyword, + ASPJavaScriptDoubleQuotedString, + ASPJavaScriptSingleQuotedString, + ASPJavaScriptSymbol, + ASPJavaScriptUnclosedString, + ASPJavaScriptRegex, + VBScriptStart, + VBScriptDefault, + VBScriptComment, + VBScriptNumber, + VBScriptKeyword, + VBScriptString, + VBScriptIdentifier, + VBScriptUnclosedString, + ASPVBScriptStart, + ASPVBScriptDefault, + ASPVBScriptComment, + ASPVBScriptNumber, + ASPVBScriptKeyword, + ASPVBScriptString, + ASPVBScriptIdentifier, + ASPVBScriptUnclosedString, + PythonStart, + PythonDefault, + PythonComment, + PythonNumber, + PythonDoubleQuotedString, + PythonSingleQuotedString, + PythonKeyword, + PythonTripleSingleQuotedString, + PythonTripleDoubleQuotedString, + PythonClassName, + PythonFunctionMethodName, + PythonOperator, + PythonIdentifier, + ASPPythonStart, + ASPPythonDefault, + ASPPythonComment, + ASPPythonNumber, + ASPPythonDoubleQuotedString, + ASPPythonSingleQuotedString, + ASPPythonKeyword, + ASPPythonTripleSingleQuotedString, + ASPPythonTripleDoubleQuotedString, + ASPPythonClassName, + ASPPythonFunctionMethodName, + ASPPythonOperator, + ASPPythonIdentifier, + PHPDefault, + PHPDoubleQuotedString, + PHPSingleQuotedString, + PHPKeyword, + PHPNumber, + PHPVariable, + PHPComment, + PHPCommentLine, + PHPDoubleQuotedVariable, + PHPOperator + }; + + TQextScintillaLexerHTML(TQObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + TQColor color(int) const; + bool eolFill(int) const; + TQFont font(int) const; + const char *keywords(int) const; + TQString description(int) const; + TQColor paper(int) const; + + void refreshProperties(); + bool foldCompact() const; + bool foldPreprocessor() const; + bool caseSensitiveTags() const; + +public slots: + virtual void setFoldCompact(bool); + virtual void setFoldPreprocessor(bool); + virtual void setCaseSensitiveTags(bool); + +protected: + bool readProperties(TQSettings &,const TQString &); + bool writeProperties(TQSettings &,const TQString &) const; + +private: + TQextScintillaLexerHTML(const TQextScintillaLexerHTML &); +}; + +%End diff --git a/sip/tqtext/tqextscintillalexeridl.sip b/sip/tqtext/tqextscintillalexeridl.sip new file mode 100644 index 0000000..8ae2a83 --- /dev/null +++ b/sip/tqtext/tqextscintillalexeridl.sip @@ -0,0 +1,43 @@ +// This is the SIP interface definition for TQextScintillaLexerIDL. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class TQextScintillaLexerIDL : TQextScintillaLexerCPP +{ +%TypeHeaderCode +#include +%End + +public: + TQextScintillaLexerIDL(TQObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + TQColor color(int) const; + const char *keywords(int) const; + TQString description(int) const; + +private: + TQextScintillaLexerIDL(const TQextScintillaLexerIDL &); +}; diff --git a/sip/tqtext/tqextscintillalexerjava.sip b/sip/tqtext/tqextscintillalexerjava.sip new file mode 100644 index 0000000..7ffb790 --- /dev/null +++ b/sip/tqtext/tqextscintillalexerjava.sip @@ -0,0 +1,41 @@ +// This is the SIP interface definition for TQextScintillaLexerJava. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class TQextScintillaLexerJava : TQextScintillaLexerCPP +{ +%TypeHeaderCode +#include +%End + +public: + TQextScintillaLexerJava(TQObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *keywords(int) const; + +private: + TQextScintillaLexerJava(const TQextScintillaLexerJava &); +}; diff --git a/sip/tqtext/tqextscintillalexerjavascript.sip b/sip/tqtext/tqextscintillalexerjavascript.sip new file mode 100644 index 0000000..0624788 --- /dev/null +++ b/sip/tqtext/tqextscintillalexerjavascript.sip @@ -0,0 +1,47 @@ +// This is the SIP interface definition for TQextScintillaLexerJavaScript. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class TQextScintillaLexerJavaScript : TQextScintillaLexerCPP +{ +%TypeHeaderCode +#include +%End + +public: + TQextScintillaLexerJavaScript(TQObject * /TransferThis/ = 0, + const char * = 0); + + const char *language() const; + TQColor color(int) const; + bool eolFill(int) const; + TQFont font(int) const; + const char *keywords(int) const; + TQString description(int) const; + TQColor paper(int) const; + +private: + TQextScintillaLexerJavaScript(const TQextScintillaLexerJavaScript &); +}; diff --git a/sip/tqtext/tqextscintillalexerlua.sip b/sip/tqtext/tqextscintillalexerlua.sip new file mode 100644 index 0000000..3a70a01 --- /dev/null +++ b/sip/tqtext/tqextscintillalexerlua.sip @@ -0,0 +1,79 @@ +// This is the SIP interface definition for TQextScintillaLexerLua. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (TQScintilla_1_5 -) + +class TQextScintillaLexerLua : TQextScintillaLexer +{ +%TypeHeaderCode +#include +%End + +public: + enum { + Default, + Comment, + LineComment, + Number, + Keyword, + String, + Character, + LiteralString, + Preprocessor, + Operator, + Identifier, + UnclosedString, + BasicFunctions, + StringTableMathsFunctions, + CoroutinesIOSystemFacilities + }; + + TQextScintillaLexerLua(TQObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + TQColor color(int) const; + bool eolFill(int) const; + TQFont font(int) const; + const char *keywords(int) const; + TQString description(int) const; + TQColor paper(int) const; + + void refreshProperties(); + bool foldCompact() const; + +public slots: + virtual void setFoldCompact(bool); + +protected: + bool readProperties(TQSettings &,const TQString &); + bool writeProperties(TQSettings &,const TQString &) const; + +private: + TQextScintillaLexerLua(const TQextScintillaLexerLua &); +}; + +%End diff --git a/sip/tqtext/tqextscintillalexermakefile.sip b/sip/tqtext/tqextscintillalexermakefile.sip new file mode 100644 index 0000000..d15259e --- /dev/null +++ b/sip/tqtext/tqextscintillalexermakefile.sip @@ -0,0 +1,60 @@ +// This is the SIP interface definition for TQextScintillaLexerMakefile. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (TQScintilla_1_6 -) + +class TQextScintillaLexerMakefile : TQextScintillaLexer +{ +%TypeHeaderCode +#include +%End + +public: + enum { + Default, + Comment, + Preprocessor, + Variable, + Operator, + Target, + Error + }; + + TQextScintillaLexerMakefile(TQObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + TQColor color(int) const; + bool eolFill(int) const; + TQFont font(int) const; + TQString description(int) const; + TQColor paper(int) const; + +private: + TQextScintillaLexerMakefile(const TQextScintillaLexerMakefile &); +}; + +%End diff --git a/sip/tqtext/tqextscintillalexerperl.sip b/sip/tqtext/tqextscintillalexerperl.sip new file mode 100644 index 0000000..e63e71b --- /dev/null +++ b/sip/tqtext/tqextscintillalexerperl.sip @@ -0,0 +1,96 @@ +// This is the SIP interface definition for TQextScintillaLexerPerl. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (TQScintilla_1_3 -) + +class TQextScintillaLexerPerl : TQextScintillaLexer +{ +%TypeHeaderCode +#include +%End + +public: + enum { + Default, + Error, + Comment, + POD, + Number, + Keyword, + DoubleQuotedString, + SingleQuotedString, + Operator, + Identifier, + Scalar, + Array, + Hash, + SymbolTable, + Regex, + Substitution, + Backticks, + DataSection, + HereDocumentDelimiter, + SingleQuotedHereDocument, + DoubleQuotedHereDocument, + BacktickHereDocument, + QuotedStringQ, + QuotedStringQQ, + QuotedStringQX, + QuotedStringQR, + QuotedStringQW, +%If (TQScintilla_1_6 -) + PODVerbatim, +%End + }; + + TQextScintillaLexerPerl(TQObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + TQColor color(int) const; + bool eolFill(int) const; + TQFont font(int) const; + const char *keywords(int) const; + TQString description(int) const; + TQColor paper(int) const; + + void refreshProperties(); + bool foldComments() const; + bool foldCompact() const; + +public slots: + virtual void setFoldComments(bool); + virtual void setFoldCompact(bool); + +protected: + bool readProperties(TQSettings &,const TQString &); + bool writeProperties(TQSettings &,const TQString &) const; + +private: + TQextScintillaLexerPerl(const TQextScintillaLexerPerl &); +}; + +%End diff --git a/sip/tqtext/tqextscintillalexerpov.sip b/sip/tqtext/tqextscintillalexerpov.sip new file mode 100644 index 0000000..f4f87ad --- /dev/null +++ b/sip/tqtext/tqextscintillalexerpov.sip @@ -0,0 +1,85 @@ +// This is the SIP interface definition for TQextScintillaLexerPOV. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (TQScintilla_1_6 -) + +class TQextScintillaLexerPOV : TQextScintillaLexer +{ +%TypeHeaderCode +#include +%End + +public: + enum { + Default, + Comment, + CommentLine, + Number, + Operator, + Identifier, + String, + UnclosedString, + Directive, + BadDirective, + ObjectsCSGAppearance, + TypesModifiersItems, + PredefinedIdentifiers, + PredefinedFunctions, + KeywordSet6, + KeywordSet7, + KeywordSet8 + }; + + TQextScintillaLexerPOV(TQObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + TQColor color(int) const; + bool eolFill(int) const; + TQFont font(int) const; + const char *keywords(int) const; + TQString description(int) const; + TQColor paper(int) const; + + void refreshProperties(); + bool foldComments() const; + bool foldCompact() const; + bool foldDirectives() const; + +public slots: + virtual void setFoldComments(bool); + virtual void setFoldCompact(bool); + virtual void setFoldDirectives(bool); + +protected: + bool readProperties(TQSettings &,const TQString &); + bool writeProperties(TQSettings &,const TQString &) const; + +private: + TQextScintillaLexerPOV(const TQextScintillaLexerPOV &); +}; + +%End diff --git a/sip/tqtext/tqextscintillalexerproperties.sip b/sip/tqtext/tqextscintillalexerproperties.sip new file mode 100644 index 0000000..b3be195 --- /dev/null +++ b/sip/tqtext/tqextscintillalexerproperties.sip @@ -0,0 +1,68 @@ +// This is the SIP interface definition for TQextScintillaLexerProperties. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (TQScintilla_1_6 -) + +class TQextScintillaLexerProperties : TQextScintillaLexer +{ +%TypeHeaderCode +#include +%End + +public: + enum { + Default, + Comment, + Section, + Assignment, + DefaultValue + }; + + TQextScintillaLexerProperties(TQObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + TQColor color(int) const; + bool eolFill(int) const; + TQFont font(int) const; + TQString description(int) const; + TQColor paper(int) const; + + void refreshProperties(); + bool foldCompact() const; + +public slots: + virtual void setFoldCompact(bool); + +protected: + bool readProperties(TQSettings &,const TQString &); + bool writeProperties(TQSettings &,const TQString &) const; + +private: + TQextScintillaLexerProperties(const TQextScintillaLexerProperties &); +}; + +%End diff --git a/sip/tqtext/tqextscintillalexerpython.sip b/sip/tqtext/tqextscintillalexerpython.sip new file mode 100644 index 0000000..d14a51d --- /dev/null +++ b/sip/tqtext/tqextscintillalexerpython.sip @@ -0,0 +1,94 @@ +// This is the SIP interface definition for TQextScintillaLexerPython. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class TQextScintillaLexerPython : TQextScintillaLexer +{ +%TypeHeaderCode +#include +%End + +public: + enum { +%If (TQScintilla_1_1 -) + Default, +%End + WhiteSpace, + Comment, + Number, + DoubleQuotedString, + SingleQuotedString, + Keyword, + TripleSingleQuotedString, + TripleDoubleQuotedString, + ClassName, + FunctionMethodName, + Operator, + Identifier, + CommentBlock, + UnclosedString, +%If (TQScintilla_1_7 -) + HighlightedIdentifier, + Decorator, +%End + }; + + enum IndentationWarning { + NoWarning, + Inconsistent, + TabsAfterSpaces, + Spaces, + Tabs + }; + + TQextScintillaLexerPython(TQObject * /TransferThis/ = 0, + const char * = 0); + + const char *language() const; + const char *lexer() const; + TQColor color(int) const; + bool eolFill(int) const; + TQFont font(int) const; + const char *keywords(int) const; + TQString description(int) const; + TQColor paper(int) const; + void refreshProperties(); + + bool foldComments() const; + bool foldQuotes() const; + IndentationWarning indentationWarning() const; + +public slots: + virtual void setFoldComments(bool); + virtual void setFoldQuotes(bool); + virtual void setIndentationWarning(IndentationWarning); + +protected: + bool readProperties(TQSettings &,const TQString &); + bool writeProperties(TQSettings &,const TQString &) const; + +private: + TQextScintillaLexerPython(const TQextScintillaLexerPython &); +}; diff --git a/sip/tqtext/tqextscintillalexerruby.sip b/sip/tqtext/tqextscintillalexerruby.sip new file mode 100644 index 0000000..257aad2 --- /dev/null +++ b/sip/tqtext/tqextscintillalexerruby.sip @@ -0,0 +1,128 @@ +// This is the SIP interface definition for TQextScintillaLexerRuby. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (TQScintilla_1_5 -) + +class TQextScintillaLexerRuby : TQextScintillaLexer +{ +%TypeHeaderCode +#include +%End + +public: +%If (TQScintilla_1_7 -) + enum { + Default, + Comment, + POD, + Number, + Keyword, + DoubleQuotedString, + SingleQuotedString, + ClassName, + FunctionMethodName, + Operator, + Identifier, + Regex, + Global, + Symbol, + ModuleName, + InstanceVariable, + ClassVariable, + Backticks, + DataSection, + HereDocumentDelimiter, + HereDocument, + PercentStringq, + PercentStringQ, + PercentStringx, + PercentStringr, + PercentStringw, + DemotedKeyword, + Stdin, + Stdout, + Stderr + }; +%End +%If (- TQScintilla_1_7) + enum { + Default, + WhiteSpace, + Comment, + Number, + DoubleQuotedString, + SingleQuotedString, + Keyword, + TripleDoubleQuotedString, + ClassName, + FunctionMethodName, + Operator, + Identifier, + CommentBlock, + UnclosedString + }; + + enum IndentationWarning { + NoWarning, + Inconsistent, + TabsAfterSpaces, + Spaces, + Tabs + }; +%End + + TQextScintillaLexerRuby(TQObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + TQColor color(int) const; + bool eolFill(int) const; + TQFont font(int) const; + const char *keywords(int) const; + TQString description(int) const; + TQColor paper(int) const; +%If (- TQScintilla_1_7) + void refreshProperties(); + + IndentationWarning indentationWarning() const; +%End + +public slots: +%If (- TQScintilla_1_7) + virtual void setIndentationWarning(IndentationWarning); +%End + +protected: +%If (- TQScintilla_1_7) + bool readProperties(TQSettings &,const TQString &); + bool writeProperties(TQSettings &,const TQString &) const; +%End + +private: + TQextScintillaLexerRuby(const TQextScintillaLexerRuby &); +}; + +%End diff --git a/sip/tqtext/tqextscintillalexersql.sip b/sip/tqtext/tqextscintillalexersql.sip new file mode 100644 index 0000000..418351f --- /dev/null +++ b/sip/tqtext/tqextscintillalexersql.sip @@ -0,0 +1,105 @@ +// This is the SIP interface definition for TQextScintillaLexerSQL. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (TQScintilla_1_1 -) + +class TQextScintillaLexerSQL : TQextScintillaLexer +{ +%TypeHeaderCode +#include +%End + +public: + enum { + Default, + Comment, +%If (TQScintilla_1_6 -) + CommentLine, + CommentDoc, +%End + LineComment, // Obsolete. + Number, + Keyword, +%If (TQScintilla_1_6 -) + DoubleQuotedString, +%End + SingleQuotedString, +%If (TQScintilla_1_6 -) + PlusKeyword, + PlusPrompt, +%End + Operator, + Identifier, +%If (TQScintilla_1_6 -) + PlusComment, + CommentLineHash, + CommentDocKeyword, + CommentDocKeywordError, + KeywordSet5, + KeywordSet6, + KeywordSet7, + KeywordSet8, +%End + }; + + TQextScintillaLexerSQL(TQObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + TQColor color(int) const; +%If (TQScintilla_1_6 -) + bool eolFill(int) const; +%End + TQFont font(int) const; + const char *keywords(int) const; + TQString description(int) const; +%If (TQScintilla_1_6 -) + TQColor paper(int) const; + + void refreshProperties(); + bool foldComments() const; + bool foldCompact() const; + bool backslashEscapes() const; +%End + +public slots: +%If (TQScintilla_1_6 -) + virtual void setFoldComments(bool); + virtual void setFoldCompact(bool); + virtual void setBackslashEscapes(bool); +%End + +protected: +%If (TQScintilla_1_6 -) + bool readProperties(TQSettings &,const TQString &); + bool writeProperties(TQSettings &,const TQString &) const; +%End + +private: + TQextScintillaLexerSQL(const TQextScintillaLexerSQL &); +}; + +%End diff --git a/sip/tqtext/tqextscintillalexertex.sip b/sip/tqtext/tqextscintillalexertex.sip new file mode 100644 index 0000000..24f42fe --- /dev/null +++ b/sip/tqtext/tqextscintillalexertex.sip @@ -0,0 +1,57 @@ +// This is the SIP interface definition for TQextScintillaLexerTeX. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (TQScintilla_1_6 -) + +class TQextScintillaLexerTeX : TQextScintillaLexer +{ +%TypeHeaderCode +#include +%End + +public: + enum { + Default, + Special, + Group, + Symbol, + Command, + Text + }; + + TQextScintillaLexerTeX(TQObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + TQColor color(int) const; + const char *keywords(int) const; + TQString description(int) const; + +private: + TQextScintillaLexerTeX(const TQextScintillaLexerTeX &); +}; + +%End diff --git a/sip/tqtext/tqextscintillamacro.sip b/sip/tqtext/tqextscintillamacro.sip new file mode 100644 index 0000000..e29ab1f --- /dev/null +++ b/sip/tqtext/tqextscintillamacro.sip @@ -0,0 +1,49 @@ +// This is the SIP interface definition for TQextScintillaMacro. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class TQextScintillaMacro : TQObject +{ +%TypeHeaderCode +#include +%End + +public: + TQextScintillaMacro(TQextScintilla * /TransferThis/,const char * = 0); + TQextScintillaMacro(const TQCString &,TQextScintilla * /TransferThis/, + const char * = 0); + + void clear(); + bool load(const TQCString &); + TQCString save() const; + +public slots: + virtual void play(); + virtual void startRecording(); + virtual void endRecording(); + +private: + TQextScintillaMacro(const TQextScintillaMacro &); +}; diff --git a/sip/tqtext/tqextscintillaprinter.sip b/sip/tqtext/tqextscintillaprinter.sip new file mode 100644 index 0000000..b5ee0d6 --- /dev/null +++ b/sip/tqtext/tqextscintillaprinter.sip @@ -0,0 +1,45 @@ +// This is the SIP interface definition for TQextScintillaPrinter. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class TQextScintillaPrinter : TQPrinter +{ +%TypeHeaderCode +#include +%End + +public: + TQextScintillaPrinter(TQPrinter::PrinterMode = TQPrinter::ScreenResolution); + + virtual void formatPage(TQPainter &,bool,TQRect &,int); + virtual int printRange(TQextScintillaBase *,int = -1,int = -1); + int magnification() const; + virtual void setMagnification(int); + TQextScintilla::WrapMode wrapMode() const; + virtual void setWrapMode(TQextScintilla::WrapMode); + +private: + TQextScintillaPrinter(const TQextScintillaPrinter &); +}; diff --git a/sip/tqtext/tqtextmod.sip b/sip/tqtext/tqtextmod.sip new file mode 100644 index 0000000..dc57de3 --- /dev/null +++ b/sip/tqtext/tqtextmod.sip @@ -0,0 +1,107 @@ +// This is the SIP interface definition for the tqtext module of PyTQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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.tqtext 4 + +%Import tqt/tqtmod.sip + +%Include copying.sip + + +// The TQScintilla versions. +%Timeline {TQScintilla_1_1 TQScintilla_1_2 TQScintilla_1_3 TQScintilla_1_4 + TQScintilla_1_5 TQScintilla_1_6 TQScintilla_1_7} + + +const unsigned TQSCINTILLA_VERSION; +const char *TQSCINTILLA_VERSION_STR; +const char *TQSCINTILLA_BUILD; + + +%Include tqextscintillaapis.sip +%Include tqextscintillabase.sip +%Include tqextscintilla.sip +%Include tqextscintillacommand.sip +%Include tqextscintillacommandset.sip +%Include tqextscintilladocument.sip +%Include tqextscintillalexer.sip +%Include tqextscintillalexerbash.sip +%Include tqextscintillalexerbatch.sip +%Include tqextscintillalexercpp.sip +%Include tqextscintillalexercsharp.sip +%Include tqextscintillalexercss.sip +%Include tqextscintillalexerdiff.sip +%Include tqextscintillalexerhtml.sip +%Include tqextscintillalexeridl.sip +%Include tqextscintillalexerjava.sip +%Include tqextscintillalexerjavascript.sip +%Include tqextscintillalexerlua.sip +%Include tqextscintillalexermakefile.sip +%Include tqextscintillalexerperl.sip +%Include tqextscintillalexerpov.sip +%Include tqextscintillalexerproperties.sip +%Include tqextscintillalexerpython.sip +%Include tqextscintillalexerruby.sip +%Include tqextscintillalexersql.sip +%Include tqextscintillalexertex.sip +%Include tqextscintillamacro.sip +%Include tqextscintillaprinter.sip + + +// The build file template. + +%Makefile tqtext.pro.in +# The project file for the tqtext module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited +# +# 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@ @PYTQT_TQSCINTILLA_INC@ +DEFINES = @BLX_DEFINES@ TQEXTSCINTILLA_DLL +LIBS += @PYTQT_TQT_MODULE@ @PYTQT_TQSCINTILLA_LIB@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End diff --git a/sip/tqtgl/copying.sip b/sip/tqtgl/copying.sip new file mode 100644 index 0000000..49b4531 --- /dev/null +++ b/sip/tqtgl/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyTQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 + +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/tqtgl/tqgl.sip b/sip/tqtgl/tqgl.sip new file mode 100644 index 0000000..1d1b080 --- /dev/null +++ b/sip/tqtgl/tqgl.sip @@ -0,0 +1,276 @@ +// This is the SIP interface definition for TQGL, TQGLContext, TQGLFormat and +// TQGLWidget. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQGL + +TQGL is fully implemented. + + + +TQGLContext + +TQGLContext is fully implemented. + + + +TQGLFormat + +TQGLFormat is fully implemented. + + + +TQGLWidget + +TQGLWidget is fully implemented. + + +%End + + +const int TQGL_VERSION; +const char *TQGL_VERSION_STR; + +const char *qGLVersion(); + + +class TQGL +{ +%TypeHeaderCode +#include +%End + +public: + enum FormatOption { + DoubleBuffer, + DepthBuffer, + Rgba, + AlphaChannel, + AccumBuffer, + StencilBuffer, + StereoBuffers, + DirectRendering, + HasOverlay, + SingleBuffer, + NoDepthBuffer, + ColorIndex, + NoAlphaChannel, + NoAccumBuffer, + NoStencilBuffer, + NoStereoBuffers, + IndirectRendering, + NoOverlay + }; +}; + + +class TQGLFormat : TQGL +{ +%TypeHeaderCode +#include +%End + +public: + TQGLFormat(); + TQGLFormat(int,int = 0); + + bool doubleBuffer() const; + void setDoubleBuffer(bool); + bool depth() const; + void setDepth(bool); + bool rgba() const; + void setRgba(bool); + bool alpha() const; + void setAlpha(bool); + bool accum() const; + void setAccum(bool); + bool stencil() const; + void setStencil(bool); + bool stereo() const; + void setStereo(bool); + bool directRendering() const; + void setDirectRendering(bool); + bool hasOverlay() const; + void setOverlay(bool); + + int plane() const; + void setPlane(int); + + void setOption(FormatOption); + bool testOption(FormatOption) const; + + static TQGLFormat defaultFormat(); + static void setDefaultFormat(const TQGLFormat &); + + static TQGLFormat defaultOverlayFormat(); + static void setDefaultOverlayFormat(const TQGLFormat &); + + static bool hasOpenGL(); + static bool hasOpenGLOverlays(); +}; + + +class TQGLContext : TQGL +{ +%TypeHeaderCode +#include +%End + +public: + TQGLContext(const TQGLFormat &,TQPaintDevice *); + TQGLContext(const TQGLFormat &); + + virtual bool create(const TQGLContext * = 0); + bool isValid() const; + bool isSharing() const; + virtual void reset(); + + TQGLFormat format() const; + TQGLFormat requestedFormat() const; + virtual void setFormat(const TQGLFormat &); + + virtual void makeCurrent(); + virtual void swapBuffers() const; + + TQPaintDevice *device() const; + + TQColor overlayTransparentColor() const; + + static const TQGLContext *currentContext(); + +protected: + virtual bool chooseContext(const TQGLContext * = 0); + virtual void doneCurrent(); + +%If (WS_X11) + virtual void *tryVisual(const TQGLFormat &,int = 1); + virtual void *chooseVisual(); +%End + + bool deviceIsPixmap() const; + bool windowCreated() const; + void setWindowCreated(bool); + bool initialized() const; + void setInitialized(bool); + void generateFontDisplayLists(const TQFont &,int); + + uint colorIndex(const TQColor &) const; + void setValid(bool); + void setDevice(TQPaintDevice *); + +private: + TQGLContext(); + TQGLContext(const TQGLContext &); +}; + + +class TQGLWidget : TQWidget, TQGL +{ +%TypeHeaderCode +#include +%End + +public: + TQGLWidget(TQWidget * /TransferThis/ = 0,const char * = 0, + const TQGLWidget * = 0,WFlags = 0); + TQGLWidget(TQGLContext * /Transfer/,TQWidget * /TransferThis/ = 0,const char * = 0, + const TQGLWidget * = 0,WFlags = 0); + TQGLWidget(const TQGLFormat &,TQWidget * /TransferThis/ = 0, + const char * = 0,const TQGLWidget * = 0,WFlags = 0); + +%ConvertToSubClassCode + sipClass = (sipCpp->inherits(sipName_TQGLWidget) ? sipClass_TQGLWidget : NULL); +%End + + void qglColor(const TQColor &) const; + void qglClearColor(const TQColor &) const; + + bool isValid() const; + bool isSharing() const; + virtual void makeCurrent(); + void doneCurrent(); + + bool doubleBuffer() const; + virtual void swapBuffers(); + + TQGLFormat format() const; + + const TQGLContext *context() const; + + virtual TQPixmap renderPixmap(int = 0,int = 0,bool = 0); + virtual TQImage grabFrameBuffer(bool = 0); + + virtual void makeOverlayCurrent(); + const TQGLContext *overlayContext() const; + + static TQImage convertToGLFormat(const TQImage &); + + void setMouseTracking(bool); + + 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->TQGLWidget::reparent(a0, a1, *a2, a3) : sipCpp->reparent(a0, a1, *a2, a3); + Py_END_ALLOW_THREADS +%End + + const TQGLColormap &colormap() const; + void setColormap(const TQGLColormap &); + + void renderText(int,int,const TQString &,const TQFont & = TQFont(), + int = 2000); + void renderText(double,double,double,const TQString &, + const TQFont & = TQFont(),int = 2000); + +public slots: + virtual void updateGL(); + virtual void updateOverlayGL(); + +protected: + virtual void initializeGL(); + virtual void resizeGL(int,int); + virtual void paintGL(); + + virtual void initializeOverlayGL(); + virtual void resizeOverlayGL(int,int); + virtual void paintOverlayGL(); + + void setAutoBufferSwap(bool); + bool autoBufferSwap() const; + + void paintEvent(TQPaintEvent *); + void resizeEvent(TQResizeEvent *); + + virtual void glInit(); + virtual void glDraw(); + +private: + TQGLWidget(const TQGLWidget &); +}; diff --git a/sip/tqtgl/tqglcolormap.sip b/sip/tqtgl/tqglcolormap.sip new file mode 100644 index 0000000..4d621ae --- /dev/null +++ b/sip/tqtgl/tqglcolormap.sip @@ -0,0 +1,59 @@ +// This is the SIP interface definition for TQGLColormap. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQGLColormap (TQt v3.0+) + + void setEntries + int count + const TQRgb *colors + int base = 0 + + +Not yet implemented. + + +%End + + +class TQGLColormap +{ +%TypeHeaderCode +#include +%End + +public: + TQGLColormap(); + TQGLColormap(const TQGLColormap &); + + bool isEmpty() const; + int size() const; + void detach(); + +// void setEntries(int,const TQRgb *,int = 0); + void setEntry(int,TQRgb); + void setEntry(int,const TQColor &); + TQRgb entryRgb(int) const; + TQColor entryColor(int) const; + int find(TQRgb) const; + int findNearest(TQRgb) const; +}; diff --git a/sip/tqtgl/tqtglmod.sip b/sip/tqtgl/tqtglmod.sip new file mode 100644 index 0000000..618de9b --- /dev/null +++ b/sip/tqtgl/tqtglmod.sip @@ -0,0 +1,71 @@ +// This is the SIP interface definition for the tqtgl module of PyTQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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.tqtgl 1 + +%Import tqt/tqtmod.sip + +%Include copying.sip + + +%Include tqgl.sip +%Include tqglcolormap.sip + + +// The build file template. + +%Makefile tqtgl.pro.in +# The project file for the tqtgl module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited +# +# 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@ opengl @PYTQT_WARN@ +INCLUDEPATH = @BLX_INCLUDEPATH@ +DEFINES = @BLX_DEFINES@ +LIBS += @PYTQT_TQT_MODULE@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End diff --git a/sip/tqtnetwork/copying.sip b/sip/tqtnetwork/copying.sip new file mode 100644 index 0000000..49b4531 --- /dev/null +++ b/sip/tqtnetwork/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyTQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 + +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/tqtnetwork/tqdns.sip b/sip/tqtnetwork/tqdns.sip new file mode 100644 index 0000000..7d9c436 --- /dev/null +++ b/sip/tqtnetwork/tqdns.sip @@ -0,0 +1,272 @@ +// This is the SIP interface definition for TQDns. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQDns (TQt v2.2+) + +TQDns is fully implemented. + + +%End + + +%If (TQt_DNS) + +class TQDns : TQObject +{ +%TypeHeaderCode +#include +%End + +public: + enum RecordType { + None, + A, + Aaaa, + Mx, + Srv, + Cname, + Ptr, + Txt + }; + + TQDns(); + TQDns(const TQString &,RecordType = A); + TQDns(const TQHostAddress &,RecordType = A); + + virtual void setLabel(const TQString &); + virtual void setLabel(const TQHostAddress &); + TQString label() const; + + virtual void setRecordType(RecordType = A); + RecordType recordType() const; + + bool isWorking() const; + + TQValueList addresses() const; + + class MailServer + { + public: + MailServer(const TQString & = TQString::null,TQ_UINT16 = 0); + + TQString name; + TQ_UINT16 priority; + }; + + TQValueList mailServers() const; + + class Server + { + public: + Server(const TQString & = TQString::null,TQ_UINT16 = 0, + TQ_UINT16 = 0,TQ_UINT16 = 0); + + TQString name; + TQ_UINT16 priority; + TQ_UINT16 weight; + TQ_UINT16 port; + }; + + TQValueList servers() const; + + TQStringList hostNames() const; + + TQStringList texts() const; + + TQString canonicalName() const; + + TQStringList qualifiedNames() const; + +signals: + void resultsReady(); +}; + + +%MappedType TQValueList +{ +%TypeHeaderCode +#include +%End + +%ConvertFromTypeCode + // Convert to a Python list of TQHostAddress instances. + + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + TQValueListConstIterator it; + + for (it = sipCpp -> begin(); it != sipCpp -> end(); ++it) + { + PyObject *tmobj; + + if ((tmobj = sipConvertFromNewInstance(new TQHostAddress(*it),sipClass_TQHostAddress,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0) + { + Py_XDECREF(tmobj); + Py_DECREF(l); + + return NULL; + } + + ++i; + } + + return l; +%End + +%ConvertToTypeCode + // At the moment this will never be called, so provide a null + // implementation. + + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + PyErr_Format(PyExc_TypeError,"Converting to TQValueList not yet implemented"); + + *sipIsErr = 1; + + return 0; +%End +}; + + +%MappedType TQValueList +{ +%TypeHeaderCode +#include +%End + +%ConvertFromTypeCode + // Convert to a Python list of TQDns::MailServer instances. + + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + TQValueListConstIterator it; + + for (it = sipCpp -> begin(); it != sipCpp -> end(); ++it) + { + PyObject *tmobj; + + if ((tmobj = sipConvertFromNewInstance(new TQDns::MailServer(*it),sipClass_TQDns_MailServer,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0) + { + Py_XDECREF(tmobj); + Py_DECREF(l); + + return NULL; + } + + ++i; + } + + return l; +%End + +%ConvertToTypeCode + // At the moment this will never be called, so provide a null + // implementation. + + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + PyErr_Format(PyExc_TypeError,"Converting to TQValueList not yet implemented"); + + *sipIsErr = 1; + + return 0; +%End +}; + + +%MappedType TQValueList +{ +%TypeHeaderCode +#include +%End + +%ConvertFromTypeCode + // Convert to a Python list of TQDns::Server instances. + + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + TQValueListConstIterator it; + + for (it = sipCpp -> begin(); it != sipCpp -> end(); ++it) + { + PyObject *tmobj; + + if ((tmobj = sipConvertFromNewInstance(new TQDns::Server(*it),sipClass_TQDns_Server,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0) + { + Py_XDECREF(tmobj); + Py_DECREF(l); + + return NULL; + } + + ++i; + } + + return l; +%End + +%ConvertToTypeCode + // At the moment this will never be called, so provide a null + // implementation. + + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + PyErr_Format(PyExc_TypeError,"Converting to TQValueList not yet implemented"); + + *sipIsErr = 1; + + return 0; +%End +}; + +%End diff --git a/sip/tqtnetwork/tqftp.sip b/sip/tqtnetwork/tqftp.sip new file mode 100644 index 0000000..ee945db --- /dev/null +++ b/sip/tqtnetwork/tqftp.sip @@ -0,0 +1,171 @@ +// This is the SIP interface definition for TQFtp. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQFtp (TQt v2.2+) + + TQ_LONG readBlock + char *data + TQ_ULONG maxlen + + +This takes a single maxlen parameter. The +data is returned if there was no error, otherwise +None is returned. + + +%End + + +%If (TQt_NETWORKPROTOCOL_FTP) + +class TQFtp : TQNetworkProtocol +{ +%TypeHeaderCode +#include +%End + +public: + TQFtp(); + TQFtp(TQObject * /TransferThis/,const char * = 0); + virtual ~TQFtp(); + + int supportedOperations() const; + + enum State { + Unconnected, + HostLookup, + Connecting, + Connected, + LoggedIn, + Closing + }; + + enum Error { + NoError, + UnknownError, + HostNotFound, + ConnectionRefused, + NotConnected + }; + + enum Command { + None, + ConnectToHost, + Login, + Close, + List, + Cd, + Get, + Put, + Remove, + Mkdir, + Rmdir, + Rename, + RawCommand + }; + + int connectToHost(const TQString &,TQ_UINT16 = 21) /ReleaseGIL/; + int login(const TQString & = TQString::null, + const TQString & = TQString::null) /ReleaseGIL/; + int close() /ReleaseGIL/; + int list(const TQString & = TQString::null) /ReleaseGIL/; + int cd(const TQString &) /ReleaseGIL/; + int get(const TQString &,TQIODevice * = 0) /ReleaseGIL/; + int put(const TQByteArray &,const TQString &) /ReleaseGIL/; + int put(TQIODevice *,const TQString &) /ReleaseGIL/; + int remove(const TQString &) /ReleaseGIL/; + int mkdir(const TQString &) /ReleaseGIL/; + int rmdir(const TQString &) /ReleaseGIL/; + int rename(const TQString &,const TQString &) /ReleaseGIL/; + + int rawCommand(const TQString &) /ReleaseGIL/; + + unsigned long bytesAvailable() 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 = sipCpp -> TQFtp::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 + + TQByteArray readAll() /ReleaseGIL/; + + int currentId() const; + TQIODevice* currentDevice() const; + Command currentCommand() const; + bool hasPendingCommands() const; + void clearPendingCommands(); + + State state() const; + + Error error() const; + TQString errorString() const; + +public slots: + void abort(); + +signals: + void stateChanged(int); + void listInfo(const TQUrlInfo &); + void readyRead(); + void dataTransferProgress(int,int); + void rawCommandReply(int,const TQString &); + + void commandStarted(int); + void commandFinished(int,bool); + void done(bool); + +protected: + void parseDir(const TQString &,TQUrlInfo &); + virtual void operationListChildren(TQNetworkOperation *); + virtual void operationMkDir(TQNetworkOperation *); + virtual void operationRemove(TQNetworkOperation *); + virtual void operationRename(TQNetworkOperation *); + virtual void operationGet(TQNetworkOperation *); + virtual void operationPut(TQNetworkOperation *); + +private: + virtual bool checkConnection(TQNetworkOperation *); +}; + +%End diff --git a/sip/tqtnetwork/tqhostaddress.sip b/sip/tqtnetwork/tqhostaddress.sip new file mode 100644 index 0000000..6e1cc91 --- /dev/null +++ b/sip/tqtnetwork/tqhostaddress.sip @@ -0,0 +1,89 @@ +// This is the SIP interface definition for TQHostAddress. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQHostAddress (TQt v2.2+) + + TQHostAddress + TQ_UINT8 *ip6Addr + + +Not yet implemented. + + + + TQHostAddress + const Q_IPV6ADDR &ip6Addr + + +Not yet implemented. + + + + void setAddress + TQ_UINT8 *ip6Addr + + +Not yet implemented. + + + + Q_IPV6ADDR toIPv6Address const + + + +Not yet implemented. + + +%End + + +class TQHostAddress +{ +%TypeHeaderCode +#include +%End + +public: + TQHostAddress(); + TQHostAddress(TQ_UINT32); +// TQHostAddress(TQ_UINT8 *); + //TQHostAddress(const Q_IPV6ADDR &); + // This isn't mentioned in the documentation. + //TQHostAddress(const TQString &); + TQHostAddress(const TQHostAddress &); + + void setAddress(TQ_UINT32); +// void setAddress(TQ_UINT8 *); + bool setAddress(const TQString &); + bool isIp4Addr() const; + TQ_UINT32 ip4Addr() const; + + bool isIPv4Address() const; + TQ_UINT32 toIPv4Address() const; + bool isIPv6Address() const; + //Q_IPV6ADDR toIPv6Address() const; + + TQString toString() const; + + bool isNull() const; +}; diff --git a/sip/tqtnetwork/tqhttp.sip b/sip/tqtnetwork/tqhttp.sip new file mode 100644 index 0000000..2f80e22 --- /dev/null +++ b/sip/tqtnetwork/tqhttp.sip @@ -0,0 +1,263 @@ +// This is the SIP interface definition for TQHttp, TQHttpHeader, +// TQHttpRequestHeader and TQHttpResponseHeader. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQHttp (TQt v3+) + + TQ_LONG readBlock + char *data + TQ_ULONG maxlen + + +This takes a single maxlen parameter. The +data is returned if there was no error, otherwise +None is returned. + + + +TQHttpHeader (TQt v3.1+) + +TQHttpHeader is fully implemented. + + + +TQHttpRequestHeader (TQt v3.1+) + +TQHttpRequestHeader is fully implemented. + + + +TQHttpResponseHeader (TQt v3.1+) + +TQHttpResponseHeader is fully implemented. + + +%End + + +%If (TQt_NETWORKPROTOCOL_HTTP) + +class TQHttpHeader +{ +%TypeHeaderCode +#include +%End + +public: + TQHttpHeader(); + TQHttpHeader(const TQHttpHeader &); + TQHttpHeader(const TQString &); + virtual ~TQHttpHeader(); + + TQString value(const TQString &) const; + void setValue(const TQString &,const TQString &); + void removeValue(const TQString &); + + TQStringList keys() const; + bool hasKey(const TQString &) const; + + bool hasContentLength() const; + uint contentLength() const; + void setContentLength(int); + + bool hasContentType() const; + TQString contentType() const; + void setContentType(const TQString &); + + virtual TQString toString() const; + bool isValid() const; + + virtual int majorVersion() const = 0; + virtual int minorVersion() const = 0; + +protected: + virtual bool parseLine(const TQString &,int); + bool parse(const TQString &); + void setValid(bool); +}; + + +class TQHttpResponseHeader : TQHttpHeader +{ +%TypeHeaderCode +#include +%End + +public: + TQHttpResponseHeader(); + TQHttpResponseHeader(const TQHttpResponseHeader &); + + int statusCode() const; + TQString reasonPhrase() const; + + int majorVersion() const; + int minorVersion() const; + + TQString toString() const; + +protected: + bool parseLine(const TQString &,int); +}; + + +class TQHttpRequestHeader : TQHttpHeader +{ +%TypeHeaderCode +#include +%End + +public: + TQHttpRequestHeader(); + TQHttpRequestHeader(const TQString &,const TQString &,int = 1,int = 1); + TQHttpRequestHeader(const TQHttpRequestHeader &); + TQHttpRequestHeader(const TQString &); + + void setRequest(const TQString &,const TQString &,int = 1,int = 1); + + TQString method() const; + TQString path() const; + + int majorVersion() const; + int minorVersion() const; + + TQString toString() const; + +protected: + bool parseLine(const TQString &,int); +}; + + +class TQHttp : TQNetworkProtocol +{ +%TypeHeaderCode +#include +%End + +public: + TQHttp(); + TQHttp(TQObject * /TransferThis/,const char * = 0); + TQHttp(const TQString &,TQ_UINT16 = 80,TQObject * /TransferThis/ = 0, + const char * = 0); + virtual ~TQHttp(); + + int supportedOperations() const; + + enum State { + Unconnected, + HostLookup, + Connecting, + Sending, + Reading, + Connected, + Closing + }; + + enum Error { + NoError, + UnknownError, + HostNotFound, + ConnectionRefused, + UnexpectedClose, + InvalidResponseHeader, + WrongContentLength, + Aborted + }; + + int setHost(const TQString &,TQ_UINT16 = 80); + + int get(const TQString &,TQIODevice * = 0) /ReleaseGIL/; + int post(const TQString &,TQIODevice *,TQIODevice * = 0) /ReleaseGIL/; + int post(const TQString &,const TQByteArray &, + TQIODevice * = 0) /ReleaseGIL/; + int head(const TQString &) /ReleaseGIL/; + int request(const TQHttpRequestHeader &,TQIODevice * = 0, + TQIODevice * = 0) /ReleaseGIL/; + int request(const TQHttpRequestHeader &,const TQByteArray &, + TQIODevice * = 0) /ReleaseGIL/; + + int closeConnection(); + + unsigned long bytesAvailable() 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 = sipCpp -> TQHttp::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 + + TQByteArray readAll() /ReleaseGIL/; + + int currentId() const; + TQIODevice *currentSourceDevice() const; + TQIODevice *currentDestinationDevice() const; + TQHttpRequestHeader currentRequest() const; + bool hasPendingRequests() const; + void clearPendingRequests(); + + State state() const; + + Error error() const; + TQString errorString() const; + +public slots: + void abort(); + +signals: + void stateChanged(int); + void responseHeaderReceived(const TQHttpResponseHeader &); + void readyRead(const TQHttpResponseHeader &); + void dataSendProgress(int,int); + void dataReadProgress(int,int); + + void requestStarted(int); + void requestFinished(int,bool); + void done(bool); + +protected: + void operationGet(TQNetworkOperation *); + void operationPut(TQNetworkOperation *); + + void timerEvent(TQTimerEvent *); +}; + +%End diff --git a/sip/tqtnetwork/tqlocalfs.sip b/sip/tqtnetwork/tqlocalfs.sip new file mode 100644 index 0000000..f33d6e0 --- /dev/null +++ b/sip/tqtnetwork/tqlocalfs.sip @@ -0,0 +1,54 @@ +// This is the SIP interface definition for TQLocalFs. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQLocalFs (TQt v2.1+) + +TQLocalFs is fully implemented. + + +%End + + +%If (TQt_NETWORKPROTOCOL) + +class TQLocalFs : TQNetworkProtocol +{ +%TypeHeaderCode +#include +%End + +public: + TQLocalFs(); + + virtual int supportedOperations() const; + +protected: + virtual void operationListChildren(TQNetworkOperation *); + virtual void operationMkDir(TQNetworkOperation *); + virtual void operationRemove(TQNetworkOperation *); + virtual void operationRename(TQNetworkOperation *); + virtual void operationGet(TQNetworkOperation *); + virtual void operationPut(TQNetworkOperation *); +}; + +%End diff --git a/sip/tqtnetwork/tqnetwork.sip b/sip/tqtnetwork/tqnetwork.sip new file mode 100644 index 0000000..b0a6af3 --- /dev/null +++ b/sip/tqtnetwork/tqnetwork.sip @@ -0,0 +1,32 @@ +// This is the SIP interface definition for tqInitNetworkProtocols. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 (TQt_NETWORKPROTOCOL) + +%ModuleHeaderCode +#include +#include +%End + +void tqInitNetworkProtocols(); + +%End diff --git a/sip/tqtnetwork/tqserversocket.sip b/sip/tqtnetwork/tqserversocket.sip new file mode 100644 index 0000000..4cbcdce --- /dev/null +++ b/sip/tqtnetwork/tqserversocket.sip @@ -0,0 +1,58 @@ +// This is the SIP interface definition for TQServerSocket. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQServerSocket (TQt v2.2+) + +TQServerSocket is fully implemented. + + +%End + + +class TQServerSocket : TQObject +{ +%TypeHeaderCode +#include +%End + +public: + TQServerSocket(TQ_UINT16,int = 1,TQObject * /TransferThis/ = 0, + const char * = 0); + TQServerSocket(const TQHostAddress &,TQ_UINT16,int = 1, + TQObject * /TransferThis/ = 0,const char * = 0); + TQServerSocket(TQObject * /TransferThis/ = 0,const char * = 0); + + bool ok() const; + + TQ_UINT16 port() const; + + int socket() const; + virtual void setSocket(int); + + TQHostAddress address() const ; + + virtual void newConnection(int) = 0; + +protected: + TQSocketDevice *socketDevice(); +}; diff --git a/sip/tqtnetwork/tqsocket.sip b/sip/tqtnetwork/tqsocket.sip new file mode 100644 index 0000000..ed52819 --- /dev/null +++ b/sip/tqtnetwork/tqsocket.sip @@ -0,0 +1,241 @@ +// This is the SIP interface definition for TQSocket. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQSocket (TQt v2.2+) + + TQ_LONG readBlock + char *data + TQ_ULONG len + + +This takes a single len parameter. The +data is returned if there was no error, otherwise +Py_None is returned. + + + + TQ_LONG readLine + char *data + TQ_ULONG maxlen + + +This takes a single maxlen parameter. The +data is returned if there was no error, otherwise +Py_None is returned. + + + + TQ_LONG writeBlock + const char *data + TQ_ULONG len + + +len is derived from data and not passed +as a parameter. + + +%End + + +class TQSocket : TQObject, TQIODevice +{ +%TypeHeaderCode +#include +%End + +public: + enum Error { + ErrConnectionRefused, + ErrHostNotFound, + ErrSocketRead + }; + + TQSocket(TQObject * /TransferThis/ = 0,const char * = 0); + + enum State { + Idle, + HostLookup, + Connecting, + Connected, + Closing, + Connection + }; + +%ConvertToSubClassCode + static struct class_graph { + const char *name; + sipWrapperType **type; + int yes, no; + } graph[] = { + {sipName_TQServerSocket, &sipClass_TQServerSocket, -1, 1}, + {sipName_TQSocket, &sipClass_TQSocket, -1, 2}, + {sipName_TQFtp, &sipClass_TQFtp, -1, 3}, + {sipName_TQLocalFs, &sipClass_TQLocalFs, -1, 4}, + {sipName_TQHttp, &sipClass_TQHttp, -1, 5}, + {sipName_TQDns, &sipClass_TQDns, -1, -1}, + }; + + 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 + + State state() const; + + int socket() const; + virtual void setSocket(int); + + TQSocketDevice *socketDevice(); + virtual void setSocketDevice(TQSocketDevice *); + +%If (TQt_DNS) + virtual void connectToHost(const TQString &,TQ_UINT16) /ReleaseGIL/; +%End + TQString peerName() const; + + bool open(int) /ReleaseGIL/; + void close() /ReleaseGIL/; + void flush() /ReleaseGIL/; + Offset size() const; + Offset at() const; + bool at(Offset); + bool atEnd() const; + + TQ_ULONG bytesAvailable() const; + TQ_ULONG waitForMore(int) const /ReleaseGIL/; + //TQ_ULONG waitForMore(int,bool *) const /ReleaseGIL/; + TQ_ULONG bytesToWrite() const; + void clearPendingData(); + + 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->TQSocket::readBlock(buf, a0) : 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 + + TQ_LONG writeBlock(const char * /Array/, + TQ_ULONG /ArraySize/) /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 = 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 + + int getch() /ReleaseGIL/; + int putch(int) /ReleaseGIL/; + int ungetch(int); + + bool canReadLine() const; + virtual TQString readLine() /ReleaseGIL/; + + TQ_UINT16 port() const; + TQ_UINT16 peerPort() const; + TQHostAddress address() const; + TQHostAddress peerAddress() const; + + void setReadBufferSize(TQ_ULONG); + TQ_ULONG readBufferSize() const; + +signals: + void hostFound(); + void connected(); + void connectionClosed(); + void delayedCloseFinished(); + void readyRead(); + void bytesWritten(int); + void error(int); + +protected: + +private: + TQSocket(const TQSocket &); +}; diff --git a/sip/tqtnetwork/tqsocketdevice.sip b/sip/tqtnetwork/tqsocketdevice.sip new file mode 100644 index 0000000..32ee5e5 --- /dev/null +++ b/sip/tqtnetwork/tqsocketdevice.sip @@ -0,0 +1,168 @@ +// This is the SIP interface definition for TQSocketDevice. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQSocketDevice (TQt v2.2+) + + TQ_LONG readBlock + char *data + TQ_ULONG len + + +This takes a single len parameter. The +data is returned if there was no error, otherwise +None is returned. + + + + TQ_LONG writeBlock + const char *data + TQ_ULONG len + + +len is derived from data and not passed +as a parameter. + + +%End + + +class TQSocketDevice : TQIODevice +{ +%TypeHeaderCode +#include +%End + +public: + enum Type { + Stream, + Datagram + }; + + enum Protocol { + IPv4, + IPv6, + Unknown + }; + + TQSocketDevice(Type = Stream); + TQSocketDevice(Type,Protocol,int); + TQSocketDevice(int,Type); + + bool isValid() const; + Type type() const; + Protocol protocol() const; + + int socket() const; + virtual void setSocket(int,Type); + + bool open(int) /ReleaseGIL/; + void close(); + void flush() /ReleaseGIL/; + + Offset size() const; + Offset at() const; + bool at(Offset); + bool atEnd() const; + + bool blocking() const; + virtual void setBlocking(bool); + + bool addressReusable() const; + virtual void setAddressReusable(bool); + + int receiveBufferSize() const; + virtual void setReceiveBufferSize(uint); + int sendBufferSize() const; + virtual void setSendBufferSize(uint); + + virtual bool connect(const TQHostAddress &,TQ_UINT16); + + virtual bool bind(const TQHostAddress &,TQ_UINT16); + virtual bool listen(int); + virtual int accept(); + + TQ_LONG bytesAvailable() const; + TQ_LONG waitForMore(int) const /ReleaseGIL/; + + 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->TQSocketDevice::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/; + virtual TQ_LONG writeBlock(const char * /Array/,TQ_ULONG /ArraySize/, + const TQHostAddress &,TQ_UINT16) /ReleaseGIL/; + + int getch(); + int putch(int); + int ungetch(int); + + TQ_UINT16 port() const; + TQ_UINT16 peerPort() const; + TQHostAddress address() const; + TQHostAddress peerAddress() const; + + enum Error { + NoError, + AlreadyBound, + Inaccessible, + NoResources, + Bug, + Impossible, + NoFiles, + ConnectionRefused, + NetworkFailure, + UnknownError + }; + + Error error() const; + +protected: + void setError(Error); + +private: + TQSocketDevice(const TQSocketDevice &); +}; diff --git a/sip/tqtnetwork/tqtnetworkmod.sip b/sip/tqtnetwork/tqtnetworkmod.sip new file mode 100644 index 0000000..db78a13 --- /dev/null +++ b/sip/tqtnetwork/tqtnetworkmod.sip @@ -0,0 +1,78 @@ +// This is the SIP interface definition for the tqtnetwork module of PyTQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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.tqtnetwork 1 + +%Import tqt/tqtmod.sip + +%Include copying.sip + + +%Include tqdns.sip +%Include tqhostaddress.sip +%Include tqftp.sip +%Include tqhttp.sip +%Include tqlocalfs.sip +%Include tqnetwork.sip +%Include tqserversocket.sip +%Include tqsocket.sip +%Include tqsocketdevice.sip + + +// The build file template. + +%Makefile tqtnetwork.pro.in +# The project file for the tqtnetwork module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited +# +# 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_TQT_MODULE@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End diff --git a/sip/tqtpe/copying.sip b/sip/tqtpe/copying.sip new file mode 100644 index 0000000..49b4531 --- /dev/null +++ b/sip/tqtpe/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyTQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 + +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/tqtpe/tqpeapplication.sip b/sip/tqtpe/tqpeapplication.sip new file mode 100644 index 0000000..9e6b99b --- /dev/null +++ b/sip/tqtpe/tqpeapplication.sip @@ -0,0 +1,223 @@ +// This is the SIP interface definition for TQPEApplication. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class TQPEApplication : TQApplication +{ +%TypeHeaderCode +#include +#include +%End + +public: + TQPEApplication(SIP_PYLIST,Type=GuiClient) [(int &,char **,Type=GuiClient)]; +%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. + int nargc = argc; + + Py_BEGIN_ALLOW_THREADS + sipCpp = new sipTQPEApplication(nargc,argv,(TQApplication::Type)a1); + Py_END_ALLOW_THREADS + + // Now modify the original list. + updatePyArgv(a0,argc,argv); + } +%End + + ~TQPEApplication(); +%MethodCode + // See the comments in ~TQApplication() to understand what's + // being done here. + + 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 + +%ConvertToSubClassCode + // The table of Python class objects indexed by their names. The table + // must be sorted by name. + + static sipStringTypeClassMap map[] = { + {sipName_FileSelector, &sipClass_FileSelector}, + {sipName_MenuButton, &sipClass_MenuButton}, + {sipName_TQPEApplication, &sipClass_TQPEApplication}, + {sipName_TQPEMenuBar, &sipClass_TQPEMenuBar}, + {sipName_TQPEToolBar, &sipClass_TQPEToolBar}, + }; + + sipClass = sipMapStringToClass(sipCpp -> className(),map, + sizeof (map)/sizeof (map[0])); +%End + + static TQString qpeDir(); + static TQString documentDir(); + void applyStyle(); + static int defaultRotation(); + static void setDefaultRotation(int); + static void grabKeyboard(); + static void ungrabKeyboard(); + + enum StylusMode { + LeftOnly, + RightOnHold + }; + + static void setStylusOperation(TQWidget *,StylusMode); + static StylusMode stylusOperation(TQWidget *); + + enum InputMethodHint { + Normal, + AlwaysOff, + AlwaysOn + }; + + enum screenSaverHint { + Disable, + DisableLightOff, + DisableSuspend, + Enable + }; + + static void setInputMethodHint(TQWidget *,InputMethodHint); + static InputMethodHint inputMethodHint(TQWidget *); + + void showMainWidget(TQWidget *,bool = 0); + void showMainDocumentWidget(TQWidget *,bool = 0); + + static void setKeepRunning(); + bool keepRunning() const; + + int exec() /PyName=exec_loop, ReleaseGIL, + PreHook=__pyTQtPreEventLoopHook__, + PostHook=__pyTQtPostEventLoopHook__/; + +signals: + void clientMoused(); + void timeChanged(); + void clockChanged(bool); + void volumeChanged(bool); + void appMessage(const TQCString &,const TQByteArray &); + void weekChanged(bool); + void dateFormatChanged(DateFormat); + void flush(); + void reload(); + +protected: +// bool qwsEventFilter(TQWSEvent *); +// void internalSetStyle(const TQString &); + void prepareForTermination(bool); + virtual void restart(); + virtual void shutdown(); + bool eventFilter(TQObject *,TQEvent *); + void timerEvent(TQTimerEvent *); + bool keyboardGrabbed() const; + bool raiseAppropriateWindow(); + virtual void tryQuit(); + + +%TypeCode +#include + + +// Convert a Python argv list to a conventional C argc count and argv array. +static char **pyArgvToC(PyObject *argvlist,int *argcp) +{ + 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) + { + char *arg; + + // Get the argument and allocate memory for it. + if ((arg = (char *)sipBytes_AsString(PyList_GetItem(argvlist,a))) == NULL || + (argv[a] = (char *)sipMalloc(strlen(arg) + 1)) == NULL) + return NULL; + + // Copy the argument and save a pointer to it. + strcpy(argv[a],arg); + argv[a + argc + 1] = argv[a]; + } + + argv[argc + argc + 1] = argv[argc] = NULL; + + *argcp = argc; + + 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 + +}; + +%End diff --git a/sip/tqtpe/tqpeapplnk.sip b/sip/tqtpe/tqpeapplnk.sip new file mode 100644 index 0000000..0216bdd --- /dev/null +++ b/sip/tqtpe/tqpeapplnk.sip @@ -0,0 +1,157 @@ +// This is the SIP interface definition for AppLnk, AppLnkSet, DocLnk and +// DocLnkSet. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class AppLnk +{ +%TypeHeaderCode +#include +%End + +public: + AppLnk(); + AppLnk(const TQString &); + AppLnk(const AppLnk &); + + bool isValid() const; + + static void setSmallIconSize(int); + static void setBigIconSize(int); + static int smallIconSize(); + static int bigIconSize(); + + TQString name() const; + const TQPixmap& pixmap() const; + const TQPixmap& bigPixmap() const; + virtual TQString exec() const /PyName=exec_property/; + TQString type() const; + TQString rotation() const; + TQString comment() const; + TQString file() const; + TQString linkFile() const; + TQStringList mimeTypes() const; + TQStringList mimeTypeIcons() const; + const TQArray &categories() const; + int id() const; + + bool fileKnown() const; + bool linkFileKnown() const; + + void execute() const /ReleaseGIL/; + void execute(const TQStringList &) const /ReleaseGIL/; + void removeFiles(); + void removeLinkFile(); + + void setName(const TQString &); + void setExec(const TQString &); + void setFile(const TQString &); + void setLinkFile(const TQString &); + void setComment(const TQString &); + void setType(const TQString &); + void setIcon(const TQString &); + void setCategories(const TQArray &); + bool writeLink() const; + + void setProperty(const TQString &,const TQString &); + TQString property(const TQString &) const; + +protected: + virtual void invoke(const TQStringList &) const; + bool ensureLinkExists() const; +// Undocumented and missing on the Zaurus. +// void storeLink() const; +}; + + +class DocLnk : AppLnk +{ +%TypeHeaderCode +#include +%End + +public: + DocLnk(); + DocLnk(const DocLnk &); + DocLnk(const TQString &); + DocLnk(const TQString &,bool); + + TQString exec() const /PyName=exec_property/; + +protected: + void invoke(const TQStringList &) const; +}; + + +class AppLnkSet +{ +%TypeHeaderCode +#include +%End + +public: + AppLnkSet(); + AppLnkSet(const TQString &); + + const AppLnk *find(int) const; + const AppLnk *findExec(const TQString &) const; + + TQStringList types() const; + TQString typeName(const TQString &) const; + TQPixmap typePixmap(const TQString &) const; + TQPixmap typeBigPixmap(const TQString &) const; + + void add(AppLnk *); + bool remove(AppLnk *); + + const TQPtrList &children() const; + void detachChildren(); + +private: + AppLnkSet(const AppLnkSet &); +}; + + +class DocLnkSet : AppLnkSet +{ +%TypeHeaderCode +#include +%End + +public: + DocLnkSet(); + DocLnkSet(const TQString &,const TQString & = TQString::null); + + const TQPtrList &children() const; + + void appendFrom(DocLnkSet &); + +private: + DocLnkSet(const DocLnkSet &); +}; + +%End diff --git a/sip/tqtpe/tqpeconfig.sip b/sip/tqtpe/tqpeconfig.sip new file mode 100644 index 0000000..39c788f --- /dev/null +++ b/sip/tqtpe/tqpeconfig.sip @@ -0,0 +1,78 @@ +// This is the SIP interface definition for Config. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class Config +{ +%TypeHeaderCode +#include +%End + +public: + typedef TQMap ConfigGroup; + + enum Domain { + File, + User + }; + + Config(const TQString &,Domain = User); + + bool isValid() const; + bool hasKey(const TQString &) const; + + void setGroup(const TQString &); +// void writeEntry(const TQString &,const char *); + void writeEntry(const TQString &,const TQString &); + void writeEntryCrypt(const TQString &,const TQString &); + void writeEntry(const TQString &,int); +// void writeEntry(const TQString &,bool); + void writeEntry(const TQString &,const TQStringList &,const TQChar &); + void removeEntry(const TQString &); + + TQString readEntry(const TQString &, + const TQString & = TQString::null) const; + TQString readEntryCrypt(const TQString &, + const TQString & = TQString::null) const; + TQString readEntryDirect(const TQString &, + const TQString & = TQString::null) const; + int readNumEntry(const TQString &,int = -1) const; + bool readBoolEntry(const TQString &,bool = 0) const; + TQStringList readListEntry(const TQString &,const TQChar &) const; + + void clearGroup(); + + void write(const TQString & = TQString::null); + +protected: +// void read(); +// bool parse(const TQString &); + +// static TQString configFilename(const TQString &,Domain); +}; + +%End diff --git a/sip/tqtpe/tqpefilemanager.sip b/sip/tqtpe/tqpefilemanager.sip new file mode 100644 index 0000000..bc7d76e --- /dev/null +++ b/sip/tqtpe/tqpefilemanager.sip @@ -0,0 +1,53 @@ +// This is the SIP interface definition for FileManager. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class FileManager +{ +%TypeHeaderCode +#include +%End + +public: + FileManager(); + + bool saveFile(const DocLnk &,const TQByteArray &); + bool saveFile(const DocLnk &,const TQString &); + bool loadFile(const DocLnk &,TQByteArray &); + bool loadFile(const DocLnk &,TQString &); + bool copyFile(const AppLnk &,const AppLnk &); + + TQIODevice *openFile(const DocLnk &) /ReleaseGIL/; + TQIODevice *saveFile(const DocLnk &) /ReleaseGIL/; + + bool exists(const DocLnk &); + +protected: + bool ensurePathExists(const TQString &); +}; + +%End diff --git a/sip/tqtpe/tqpefileselector.sip b/sip/tqtpe/tqpefileselector.sip new file mode 100644 index 0000000..a7d3d01 --- /dev/null +++ b/sip/tqtpe/tqpefileselector.sip @@ -0,0 +1,69 @@ +// This is the SIP interface definition for FileSelector and FileSelectorItem. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class FileSelectorItem : TQListViewItem +{ +%TypeHeaderCode +#include +%End + +public: + FileSelectorItem(TQListView * /TransferThis/,const DocLnk &); + + DocLnk file() const; +}; + + +class FileSelector : TQVBox +{ +%TypeHeaderCode +#include +%End + +public: + FileSelector(const TQString &,TQWidget * /TransferThis/,const char *, + bool = 1,bool = 1); + + void setNewVisible(bool); + void setCloseVisible(bool); + void reread(); + int fileCount(); +%If (- TQtPE_1_6_0) + const DocLnk *selected(); +%End +%If (TQtPE_1_6_0 -) + DocLnk selectedDocument(); +%End + +signals: + void fileSelected(const DocLnk &); + void newSelected(const DocLnk &); + void closeMe(); +}; + +%End diff --git a/sip/tqtpe/tqpefontdatabase.sip b/sip/tqtpe/tqpefontdatabase.sip new file mode 100644 index 0000000..1b250ed --- /dev/null +++ b/sip/tqtpe/tqpefontdatabase.sip @@ -0,0 +1,67 @@ +// This is the SIP interface definition for FontDatabase. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +%If (TQt_FONTDATABASE) + +class FontDatabase : TQFontDatabase +{ +%TypeHeaderCode +#include +%End + +public: + FontDatabase(); + + TQStringList families() const; + + static void loadRenderers(); +}; + +%End + + +%If (!TQt_FONTDATABASE) + +class FontDatabase +{ +%TypeHeaderCode +#include +%End + +public: + FontDatabase(); + + TQStringList families() const; + static TQValueList standardSizes(); + + static void loadRenderers(); +}; + +%End + +%End diff --git a/sip/tqtpe/tqpeglobal.sip b/sip/tqtpe/tqpeglobal.sip new file mode 100644 index 0000000..0810f65 --- /dev/null +++ b/sip/tqtpe/tqpeglobal.sip @@ -0,0 +1,83 @@ +// This is the SIP interface definition for Global. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class Global +{ +%TypeHeaderCode +#include +%End + +public: + Global(); + + static const TQDawg &fixedDawg(); + static const TQDawg &addedDawg(); + static const TQDawg &dawg(const TQString &); + + static void addWords(const TQStringList &); + static void addWords(const TQString &,const TQStringList &); + + static void createDocDir(); + + static void findDocuments(DocLnkSet *,const TQString & = TQString::null); + + static TQString applicationFileName(const TQString &,const TQString &); + +// struct Command { +// const char *file; +// TQWidget *(*func)(bool); +// bool maximized; +// bool documentary; +// }; + +// static void setBuiltinCommands(Command *); + +%If (- TQtPE_1_6_0) + static void invoke(const TQString &); +%End + static void execute(const TQString &,const TQString & = TQString::null) /ReleaseGIL/; + static void setDocument(TQWidget *,const TQString &); + static bool terminateBuiltin(const TQString &); + static void terminate(const AppLnk *); + + static bool isBuiltinCommand(const TQString &); + + static void applyStyle(); + static void statusMessage(const TQString &); + static TQWidget *shutdown(bool = 0); + static TQWidget *restart(bool = 0); + static void hideInputMethod(); + static void showInputMethod(); + + static void writeHWClock(); + + static TQString shellQuote(const TQString &); + static TQString stringQuote(const TQString &); +}; + +%End diff --git a/sip/tqtpe/tqpemenubar.sip b/sip/tqtpe/tqpemenubar.sip new file mode 100644 index 0000000..d572cef --- /dev/null +++ b/sip/tqtpe/tqpemenubar.sip @@ -0,0 +1,42 @@ +// This is the SIP interface definition for TQPEMenuBar. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class TQPEMenuBar : TQMenuBar +{ +%TypeHeaderCode +#include +%End + +public: + TQPEMenuBar(TQWidget * /TransferThis/ = 0,const char * = 0); + +protected: + virtual void keyPressEvent(TQKeyEvent *); +}; + +%End diff --git a/sip/tqtpe/tqpemenubutton.sip b/sip/tqtpe/tqpemenubutton.sip new file mode 100644 index 0000000..7d5da05 --- /dev/null +++ b/sip/tqtpe/tqpemenubutton.sip @@ -0,0 +1,61 @@ +// This is the SIP interface definition for MenuButton. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class MenuButton : TQPushButton +{ +%TypeHeaderCode +#include +%End + +public: + MenuButton(TQWidget * /TransferThis/,const char * = 0); + MenuButton(const TQStringList &,TQWidget * /TransferThis/, + const char * = 0); + + void clear(); + + int currentItem() const; + TQString currentText() const; + + void insertItems(const TQStringList &); + void insertItem(const TQIconSet &,const TQString & = TQString::null); + void insertItem(const TQString &); + void insertSeparator(); + + void setLabel(const TQString &); + +signals: + void selected(int); + void selected(const TQString &); + +public slots: + void select(int); + void select(const TQString &); +}; + +%End diff --git a/sip/tqtpe/tqpeqcopenvelope.sip b/sip/tqtpe/tqpeqcopenvelope.sip new file mode 100644 index 0000000..f066d4d --- /dev/null +++ b/sip/tqtpe/tqpeqcopenvelope.sip @@ -0,0 +1,39 @@ +// This is the SIP interface definition for TQCopEnvelope. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class TQCopEnvelope : TQDataStream +{ +%TypeHeaderCode +#include +%End + +public: + TQCopEnvelope(const TQCString &,const TQCString &); +}; + +%End diff --git a/sip/tqtpe/tqpeqdawg.sip b/sip/tqtpe/tqpeqdawg.sip new file mode 100644 index 0000000..fa24f47 --- /dev/null +++ b/sip/tqtpe/tqpeqdawg.sip @@ -0,0 +1,65 @@ +// This is the SIP interface definition for TQDawg. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class TQDawg +{ +%TypeHeaderCode +#include +%End + +public: + TQDawg(); + + bool readFile(const TQString &) /ReleaseGIL/; + bool read(TQIODevice *) /ReleaseGIL/; + bool write(TQIODevice *) const /ReleaseGIL/; + bool createFromWords(TQIODevice *); + void createFromWords(const TQStringList &); + TQStringList allWords() const; + + bool contains(const TQString &) const; + int countWords() const; + + class Node { + public: + TQChar letter() const; + bool isWord() const; + bool isLast() const; + const TQDawg::Node *next() const; + const TQDawg::Node *jump() const; + + private: + Node(); + }; + + const TQDawg::Node *root() const; + + void dump() const; +}; + +%End diff --git a/sip/tqtpe/tqperesource.sip b/sip/tqtpe/tqperesource.sip new file mode 100644 index 0000000..5a25680 --- /dev/null +++ b/sip/tqtpe/tqperesource.sip @@ -0,0 +1,50 @@ +// This is the SIP interface definition for Resource. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class Resource +{ +%TypeHeaderCode +#include +%End + +public: + Resource(); + + static TQImage loadImage(const TQString &); + + static TQPixmap loadPixmap(const TQString &); + static TQBitmap loadBitmap(const TQString &); + static TQString findPixmap(const TQString &); + + static TQIconSet loadIconSet(const TQString &); + + static TQString findSound(const TQString &); + static TQStringList allSounds(); +}; + +%End diff --git a/sip/tqtpe/tqpetimestring.sip b/sip/tqtpe/tqpetimestring.sip new file mode 100644 index 0000000..47dda55 --- /dev/null +++ b/sip/tqtpe/tqpetimestring.sip @@ -0,0 +1,71 @@ +// This is the SIP interface definition for DateFormat. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class DateFormat +{ +%TypeHeaderCode +#include +%End + +public: + enum Order { + DayMonthYear, + MonthDayYear, + YearMonthDay + }; + + DateFormat(TQChar = '/',Order = MonthDayYear); + DateFormat(TQChar,Order,Order); + DateFormat(const DateFormat &); + + enum Verbosity { + shortNumber, + longNumber, + padNumber, + shortWord, + longWord, + showWeekDay + }; + + TQString toNumberString() const; + TQString toWordString() const; + + TQString numberDate(const TQDate &,int = 0) const; + TQString wordDate(const TQDate &,int = 0) const; + +%If (TQt_DATASTREAM) + void load(TQDataStream &); + void save(TQDataStream &) const; +%End + + TQChar separator() const; + Order shortOrder() const; + Order longOrder() const; +}; + +%End diff --git a/sip/tqtpe/tqpetoolbar.sip b/sip/tqtpe/tqpetoolbar.sip new file mode 100644 index 0000000..10fd387 --- /dev/null +++ b/sip/tqtpe/tqpetoolbar.sip @@ -0,0 +1,42 @@ +// This is the SIP interface definition for TQPEToolBar. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class TQPEToolBar : TQToolBar +{ +%TypeHeaderCode +#include +%End + +public: + TQPEToolBar(TQMainWindow * /TransferThis/ = 0,const char * = 0); + +protected: + virtual void childEvent(TQChildEvent *); +}; + +%End diff --git a/sip/tqtpe/tqtpemod.sip b/sip/tqtpe/tqtpemod.sip new file mode 100644 index 0000000..f0dad71 --- /dev/null +++ b/sip/tqtpe/tqtpemod.sip @@ -0,0 +1,94 @@ +// This is the SIP interface definition for the tqtpe module of PyTQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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.tqtpe 1 + +%Import tqt/tqtmod.sip + +%Include copying.sip + + +// TQPE has it's own version numbering. +%Timeline {TQtPE_1_5_0 TQtPE_1_6_0} + + +%ModuleHeaderCode +#include +%End + +const char *TQPE_VERSION; + + +%Include tqpeapplication.sip +%Include tqpeapplnk.sip +%Include tqpeconfig.sip +%Include tqpefilemanager.sip +%Include tqpefileselector.sip +%Include tqpefontdatabase.sip +%Include tqpeglobal.sip +%Include tqpemenubar.sip +%Include tqpemenubutton.sip +%Include tqpeqcopenvelope.sip +%Include tqpeqdawg.sip +%Include tqperesource.sip +%Include tqpetimestring.sip +%Include tqpetoolbar.sip + + +// The build file template. + +%Makefile tqtpe.pro.in +# The project file for the tqtpe module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited +# +# 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_TQT_MODULE@ @BLX_LIBS@ -lqpe +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End diff --git a/sip/tqtsql/copying.sip b/sip/tqtsql/copying.sip new file mode 100644 index 0000000..49b4531 --- /dev/null +++ b/sip/tqtsql/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyTQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 + +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/tqtsql/tqdatabrowser.sip b/sip/tqtsql/tqdatabrowser.sip new file mode 100644 index 0000000..4aa7281 --- /dev/null +++ b/sip/tqtsql/tqdatabrowser.sip @@ -0,0 +1,144 @@ +// This is the SIP interface definition for TQDataBrowser. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQDataBrowser (TQt v3+) + + virtual void del + + + +This has been renamed delOnCursor in Python. + + +%End + + +class TQDataBrowser : TQWidget +{ +%TypeHeaderCode +#include +%End + +public: + TQDataBrowser(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + enum Boundary { + Unknown, + None, + BeforeBeginning, + Beginning, + End, + AfterEnd + }; + + Boundary boundary(); + void setBoundaryChecking(bool); + bool boundaryChecking() const; + + void setSort(const TQSqlIndex &); + void setSort(const TQStringList &); + TQStringList sort() const; + void setFilter(const TQString &); + TQString filter() const; + + virtual void setSqlCursor(TQSqlCursor * /GetWrapper/,bool = 0); +%MethodCode + Py_BEGIN_ALLOW_THREADS + sipSelfWasArg ? sipCpp->TQDataBrowser::setSqlCursor(a0, a1) : sipCpp->setSqlCursor(a0, a1); + Py_END_ALLOW_THREADS + + // Transfer ownership of the cursor if the autoDelete flag is + // set. + if (a0 && a1) + sipTransferTo(a0Wrapper,sipSelf); +%End + + TQSqlCursor* sqlCursor() const; + virtual void setForm(TQSqlForm *); + TQSqlForm* form(); + + virtual void setConfirmEdits(bool); + virtual void setConfirmInsert(bool); + virtual void setConfirmUpdate(bool); + virtual void setConfirmDelete(bool); + virtual void setConfirmCancels(bool); + bool confirmEdits() const; + bool confirmInsert() const; + bool confirmUpdate() const; + bool confirmDelete() const; + bool confirmCancels() const; + + virtual void setReadOnly(bool); + bool isReadOnly() const; + virtual void setAutoEdit(bool); + bool autoEdit() const; + + virtual bool seek(int,bool = 0) /ReleaseGIL/; + +signals: + void firstRecordAvailable(bool); + void lastRecordAvailable(bool); + void nextRecordAvailable(bool); + void prevRecordAvailable(bool); + + void currentChanged(const TQSqlRecord *); + void primeInsert(TQSqlRecord *); + void primeUpdate(TQSqlRecord *); + void primeDelete(TQSqlRecord *); + void beforeInsert(TQSqlRecord *); + void beforeUpdate(TQSqlRecord *); + void beforeDelete(TQSqlRecord *); + void cursorChanged(TQSqlCursor::Mode); + +public slots: + virtual void refresh(); + + virtual void insert() /ReleaseGIL/; + virtual void update() /ReleaseGIL/; + virtual void del() /PyName=delOnCursor, ReleaseGIL/; + + virtual void first() /ReleaseGIL/; + virtual void last() /ReleaseGIL/; + virtual void next() /ReleaseGIL/; + virtual void prev() /ReleaseGIL/; + + virtual void readFields(); + virtual void writeFields(); + virtual void clearValues(); + + void updateBoundary(); + +protected: + virtual bool insertCurrent() /ReleaseGIL/; + virtual bool updateCurrent() /ReleaseGIL/; + virtual bool deleteCurrent() /ReleaseGIL/; + virtual bool currentEdited(); + + virtual TQSql::Confirm confirmEdit(TQSql::Op) /ReleaseGIL/; + virtual TQSql::Confirm confirmCancel(TQSql::Op) /ReleaseGIL/; + + virtual void handleError(const TQSqlError &) /ReleaseGIL/; + +private: + TQDataBrowser(const TQDataBrowser &); +}; diff --git a/sip/tqtsql/tqdatatable.sip b/sip/tqtsql/tqdatatable.sip new file mode 100644 index 0000000..5840f3e --- /dev/null +++ b/sip/tqtsql/tqdatatable.sip @@ -0,0 +1,185 @@ +// This is the SIP interface definition for TQDataTable. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQDataTable (TQt v3+) + +TQDataTable is fully implemented. + + +%End + + +class TQDataTable : TQTable +{ +%TypeHeaderCode +#include +%End + +public: + TQDataTable(TQWidget* /TransferThis/ = 0,const char * = 0); + TQDataTable(TQSqlCursor *,bool = 0,TQWidget * /TransferThis/ = 0, + const char * = 0); + + virtual void addColumn(const TQString &,const TQString & = TQString::null, + int = -1,const TQIconSet & = TQIconSet()); + virtual void removeColumn(uint); + virtual void setColumn(uint,const TQString &, + const TQString & = TQString::null,int = -1, + const TQIconSet & = TQIconSet()); + + TQString nullText() const; + TQString trueText() const; + TQString falseText() const; + DateFormat dateFormat() const; + bool confirmEdits() const; + bool confirmInsert() const; + bool confirmUpdate() const; + bool confirmDelete() const; + bool confirmCancels() const; + bool autoDelete() const; + bool autoEdit() const; + TQString filter() const; + TQStringList sort() const; + + virtual void setSqlCursor(TQSqlCursor * /GetWrapper/ = 0,bool = 0,bool = 0); +%MethodCode + Py_BEGIN_ALLOW_THREADS + sipSelfWasArg ? sipCpp->TQDataTable::setSqlCursor(a0, a1, a2) : sipCpp->setSqlCursor(a0, a1, a2); + Py_END_ALLOW_THREADS + + // Transfer ownership of the cursor if the autoDelete flag is + // set. + if (a0 && a2) + sipTransferTo(a0Wrapper,sipSelf); +%End + + TQSqlCursor *sqlCursor() const; + + virtual void setNullText(const TQString &); + virtual void setTrueText(const TQString &); + virtual void setFalseText(const TQString &); + virtual void setDateFormat(const DateFormat); + virtual void setConfirmEdits(bool); + virtual void setConfirmInsert(bool); + virtual void setConfirmUpdate(bool); + virtual void setConfirmDelete(bool); + virtual void setConfirmCancels(bool); + virtual void setAutoDelete(bool); + virtual void setAutoEdit(bool); + virtual void setFilter(const TQString &); + virtual void setSort(const TQStringList &); + virtual void setSort(const TQSqlIndex &); + + enum Refresh { + RefreshData, + RefreshColumns, + RefreshAll + }; + + void refresh(Refresh); + void sortColumn(int,bool = 1,bool = 0); + TQString text(int,int) const; + TQVariant value(int,int) const; + TQSqlRecord *currentRecord() const; + + void installEditorFactory(TQSqlEditorFactory * /Transfer/); + void installPropertyMap(TQSqlPropertyMap * /Transfer/); + + int numCols() const; + int numRows() const; + void setNumCols(int); + void setNumRows(int); + bool findBuffer(const TQSqlIndex &,int = 0); + + void hideColumn(int); + void showColumn(int); + +signals: + void currentChanged(TQSqlRecord *); + void primeInsert(TQSqlRecord *); + void primeUpdate(TQSqlRecord *); + void primeDelete(TQSqlRecord *); + void beforeInsert(TQSqlRecord *); + void beforeUpdate(TQSqlRecord *); + void beforeDelete(TQSqlRecord *); + void cursorChanged(TQSql::Op); + +public slots: + virtual void find(const TQString &,bool,bool); + virtual void sortAscending(int); + virtual void sortDescending(int); + virtual void refresh(); + void setColumnWidth(int,int); + void adjustColumn(int); + void setColumnStretchable(int,bool); + void swapColumns(int,int,bool = 0); + +protected: + virtual bool insertCurrent(); + virtual bool updateCurrent(); + virtual bool deleteCurrent(); + + virtual TQSql::Confirm confirmEdit(TQSql::Op); + virtual TQSql::Confirm confirmCancel(TQSql::Op); + + virtual void handleError(const TQSqlError &); + + virtual bool beginInsert(); + virtual TQWidget *beginUpdate(int,int,bool); + + bool eventFilter(TQObject *,TQEvent *); + void keyPressEvent(TQKeyEvent *); + void resizeEvent(TQResizeEvent *); + void contentsMousePressEvent(TQMouseEvent *); + void contentsContextMenuEvent(TQContextMenuEvent *); + void endEdit(int,int,bool,bool); + + // We don't specify /Factory/ for this because the returned TQWidget + // will always have a parent which will own it. + TQWidget *createEditor(int,int,bool) const; + + void activateNextCell(); + int indexOf(uint) const; + void reset(); + void setSize(TQSqlCursor *); + void repaintCell(int,int); + void paintCell(TQPainter *,int,int,const TQRect &,bool, + const TQColorGroup &); + virtual void paintField(TQPainter *,const TQSqlField *,const TQRect &, + bool); + void drawContents(TQPainter *,int,int,int,int); + virtual int fieldAlignment(const TQSqlField *); + void columnClicked(int); + void resizeData(int); + + TQTableItem *item(int,int) const; + void setItem(int,int,TQTableItem *); + void clearCell(int,int); + void setPixmap(int,int,const TQPixmap &); + void takeItem(TQTableItem *); + +private: + TQWidget *beginEdit(int,int,bool); + + TQDataTable(const TQDataTable &); +}; diff --git a/sip/tqtsql/tqdataview.sip b/sip/tqtsql/tqdataview.sip new file mode 100644 index 0000000..cfa3c98 --- /dev/null +++ b/sip/tqtsql/tqdataview.sip @@ -0,0 +1,54 @@ +// This is the SIP interface definition for TQDataView. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQDataView (TQt v3+) + +TQDataView is fully implemented. + + +%End + + +class TQDataView : TQWidget +{ +%TypeHeaderCode +#include +%End + +public: + TQDataView(TQWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + virtual void setForm(TQSqlForm *); + TQSqlForm *form(); + virtual void setRecord(TQSqlRecord *); + TQSqlRecord *record(); + +public slots: + virtual void refresh(TQSqlRecord *); + virtual void readFields(); + virtual void writeFields(); + virtual void clearValues(); + +private: + TQDataView(const TQDataView &); +}; diff --git a/sip/tqtsql/tqeditorfactory.sip b/sip/tqtsql/tqeditorfactory.sip new file mode 100644 index 0000000..4208d90 --- /dev/null +++ b/sip/tqtsql/tqeditorfactory.sip @@ -0,0 +1,49 @@ +// This is the SIP interface definition for TQEditorFactory. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQEditorFactory (TQt v3+) + +TQEditorFactory is fully implemented. + + +%End + + +class TQEditorFactory : TQObject +{ +%TypeHeaderCode +#include +%End + +public: + TQEditorFactory(TQObject * /TransferThis/ = 0,const char * = 0); + + virtual TQWidget *createEditor(TQWidget * /TransferThis/, + const TQVariant &) /Factory/; + + static TQEditorFactory *defaultFactory(); + static void installDefaultFactory(TQEditorFactory * /Transfer/); + +private: + TQEditorFactory(const TQEditorFactory &); +}; diff --git a/sip/tqtsql/tqsql.sip b/sip/tqtsql/tqsql.sip new file mode 100644 index 0000000..727134e --- /dev/null +++ b/sip/tqtsql/tqsql.sip @@ -0,0 +1,74 @@ +// This is the SIP interface definition for TQSql. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQSql (TQt v3+) + +TQSql is fully implemented. + + +%End + + +class TQSql +{ +%TypeHeaderCode +#include +%End + +public: + TQSql(); + + enum Op { + None, + Insert, + Update, + Delete + }; + + enum Location { + BeforeFirst, + AfterLast + }; + + enum Confirm { + Cancel, + No, + Yes + }; + + enum ParameterType { + In, + Out, + InOut + }; + + enum TableType { + Tables, + SystemTables, + Views, + AllTables + }; + +private: + TQSql(const TQSql &); +}; diff --git a/sip/tqtsql/tqsqlcursor.sip b/sip/tqtsql/tqsqlcursor.sip new file mode 100644 index 0000000..76f258e --- /dev/null +++ b/sip/tqtsql/tqsqlcursor.sip @@ -0,0 +1,140 @@ +// This is the SIP interface definition for TQSqlCursor. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQSqlCursor (TQt v3+) + + virtual int del + bool invalidate = TRUE + + +This has been renamed delRecords in Python. + + + + virtual int del + const TQString &filter + bool invalidate = TRUE + + +This has been renamed delRecords in Python. + + + + bool exec + const TQString &query + + +This has been renamed execQuery in Python. + + +%End + + +class TQSqlCursor : TQSqlRecord, TQSqlQuery +{ +%TypeHeaderCode +#include +%End + +public: + TQSqlCursor(const TQString & = TQString::null,bool = 1,TQSqlDatabase * = 0); + TQSqlCursor(const TQSqlCursor &); + + enum Mode { + ReadOnly, + Insert, + Update, + Delete, + Writable + }; + + TQVariant value(int) const; + TQVariant value(const TQString &) const; + void setValue(int,const TQVariant &); + void setValue(const TQString &,const TQVariant &); + virtual TQSqlIndex primaryIndex(bool = 1) const; + virtual TQSqlIndex index(const TQStringList &) const; + TQSqlIndex index(const TQString &) const; +// TQSqlIndex index(const char *) const; + virtual void setPrimaryIndex(const TQSqlIndex &); + + virtual void append(const TQSqlFieldInfo &); + virtual void insert(int,const TQSqlFieldInfo &); + void remove(int); + void clear(); + void setGenerated(const TQString &,bool); + void setGenerated(int,bool); + + virtual TQSqlRecord *editBuffer(bool = 0); + virtual TQSqlRecord *primeInsert(); + virtual TQSqlRecord *primeUpdate(); + virtual TQSqlRecord *primeDelete(); + virtual int insert(bool = 1) /ReleaseGIL/; + virtual int update(bool = 1) /ReleaseGIL/; + virtual int del(bool = 1) /PyName=delRecords, ReleaseGIL/; + + virtual void setMode(int); + int mode() const; + virtual void setCalculated(const TQString &,bool); + bool isCalculated(const TQString &) const; + virtual void setTrimmed(const TQString &,bool); + bool isTrimmed(const TQString &) const; + + bool isReadOnly() const; + bool canInsert() const; + bool canUpdate() const; + bool canDelete() const; + + bool select() /ReleaseGIL/; + bool select(const TQSqlIndex &) /ReleaseGIL/; + bool select(const TQSqlIndex &,const TQSqlIndex &) /ReleaseGIL/; + virtual bool select(const TQString &,const TQSqlIndex & = TQSqlIndex()) /ReleaseGIL/; + + virtual void setSort(const TQSqlIndex &); + TQSqlIndex sort() const; + virtual void setFilter(const TQString &); + TQString filter() const; + virtual void setName(const TQString &,bool = 1); + TQString name() const; + TQString toString(const TQString & = TQString::null, + const TQString & = ",") const; + + bool isNull(int) const; + bool isNull(const TQString &) const; + +protected: + void afterSeek(); + bool exec(const TQString &) /PyName=execQuery, ReleaseGIL/; + + virtual TQVariant calculateField(const TQString &); + virtual int update(const TQString &,bool = 1); + virtual int del(const TQString &,bool = 1) /PyName=delRecords, ReleaseGIL/; + + virtual TQString toString(const TQString &,TQSqlField *, + const TQString &) const; + virtual TQString toString(TQSqlRecord *,const TQString &,const TQString &, + const TQString &) const; + virtual TQString toString(const TQSqlIndex &,TQSqlRecord *, + const TQString &,const TQString &, + const TQString &) const; +}; diff --git a/sip/tqtsql/tqsqldatabase.sip b/sip/tqtsql/tqsqldatabase.sip new file mode 100644 index 0000000..cab38d2 --- /dev/null +++ b/sip/tqtsql/tqsqldatabase.sip @@ -0,0 +1,135 @@ +// This is the SIP interface definition for TQSqlDatabase. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQSqlDatabase (TQt v3+) + + TQSqlQuery exec + const TQString &query = TQString::null + + +This has been renamed execStatement in Python. + + +%End + + +class TQSqlDatabase : TQObject +{ +%TypeHeaderCode +#include +%End + +public: +%ConvertToSubClassCode + static struct class_graph { + const char *name; + sipWrapperType **type; + int yes, no; + } graph[] = { + {sipName_TQSqlDriver, &sipClass_TQSqlDriver, -1, 1}, + {sipName_TQEditorFactory, &sipClass_TQEditorFactory, 7, 2}, + {sipName_TQSqlDatabase, &sipClass_TQSqlDatabase, -1, 3}, + {sipName_TQSqlForm, &sipClass_TQSqlForm, -1, 4}, + {sipName_TQDataView, &sipClass_TQDataView, -1, 5}, + {sipName_TQDataTable, &sipClass_TQDataTable, -1, 6}, + {sipName_TQDataBrowser, &sipClass_TQDataBrowser, -1, -1}, + {sipName_TQSqlEditorFactory, &sipClass_TQSqlEditorFactory, -1, -1}, + }; + + 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 + + bool open() /ReleaseGIL/; + bool open(const TQString &,const TQString &) /ReleaseGIL/; + void close(); + bool ping(); + bool isOpen() const; + bool isOpenError() const; + TQStringList tables() const; + TQStringList tables(TQSql::TableType) const; + TQSqlIndex primaryIndex(const TQString &) const; + TQSqlRecord record(const TQString &) const; + TQSqlRecord record(const TQSqlQuery &) const; + TQSqlRecordInfo recordInfo(const TQString &) const; + TQSqlRecordInfo recordInfo(const TQSqlQuery &) const; + TQSqlQuery exec(const TQString & = TQString::null) const /PyName=execStatement, ReleaseGIL/; + TQSqlError lastError() const; + + bool transaction(); + bool commit(); + bool rollback(); + + virtual void setDatabaseName(const TQString &); + virtual void setUserName(const TQString &); + virtual void setPassword(const TQString &); + virtual void setHostName(const TQString &); + virtual void setPort(int); + void setConnectOptions(const TQString & = TQString::null); + TQString databaseName() const; + TQString userName() const; + TQString password() const; + TQString hostName() const; + TQString driverName() const; + int port() const; + TQString connectOptions() const; + + TQSqlDriver *driver() const; + + static TQSqlDatabase *addDatabase(const TQString &, + const TQString & = TQString(TQSqlDatabase::defaultConnection)); + static TQSqlDatabase *addDatabase(TQSqlDriver *, + const TQString & = TQString(TQSqlDatabase::defaultConnection)); + static TQSqlDatabase *database(const TQString & = TQString(TQSqlDatabase::defaultConnection),bool = 1); + static void removeDatabase(const TQString &); + static void removeDatabase(TQSqlDatabase *); + static bool contains(const TQString & = TQString(TQSqlDatabase::defaultConnection)); + static TQStringList drivers(); +// static void registerSqlDriver(const TQString &, +// const TQSqlDriverCreatorBase *); + static bool isDriverAvailable(const TQString &); + +protected: + TQSqlDatabase(const TQString &,const TQString &, + TQObject * /TransferThis/ = 0,const char * = 0); + TQSqlDatabase(TQSqlDriver *,TQObject * /TransferThis/ = 0, + const char * = 0); + +private: + TQSqlDatabase(const TQSqlDatabase &); +}; diff --git a/sip/tqtsql/tqsqldriver.sip b/sip/tqtsql/tqsqldriver.sip new file mode 100644 index 0000000..74aede8 --- /dev/null +++ b/sip/tqtsql/tqsqldriver.sip @@ -0,0 +1,86 @@ +// This is the SIP interface definition for TQSqlDriver. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQSqlDriver (TQt v3+) + +TQSqlDriver is fully implemented. + + +%End + + +class TQSqlDriver : TQObject +{ +%TypeHeaderCode +#include +%End + +public: + enum DriverFeature { + Transactions, + QuerySize, + BLOB, + Unicode, + PreparedQueries, + NamedPlaceholders, + PositionalPlaceholders + }; + + TQSqlDriver(TQObject * /TransferThis/ = 0,const char * = 0); + + bool isOpen() const; + bool isOpenError() const; + + virtual bool beginTransaction(); + virtual bool commitTransaction(); + virtual bool rollbackTransaction(); + virtual TQStringList tables(const TQString &) const; + virtual TQSqlIndex primaryIndex(const TQString &) const; + virtual TQSqlRecord record(const TQString &) const; + virtual TQSqlRecord record(const TQSqlQuery &) const; + virtual TQSqlRecordInfo recordInfo(const TQString &) const; + virtual TQSqlRecordInfo recordInfo(const TQSqlQuery &) const; + virtual TQString nullText() const; + virtual TQString formatValue(const TQSqlField *,bool = 0) const; + TQSqlError lastError() const; + + virtual bool hasFeature(DriverFeature) const = 0; + virtual bool open(const TQString &,const TQString & = TQString::null, + const TQString & = TQString::null, + const TQString & = TQString::null, + int = -1) = 0 /ReleaseGIL/; + virtual void close() = 0; + virtual bool ping() = 0; + virtual TQSqlQuery createQuery() const = 0; + + bool open(const TQString &,const TQString &,const TQString &, + const TQString &,int,const TQString &) /ReleaseGIL/; + +protected: + virtual void setOpen(bool); + virtual void setOpenError(bool); + virtual void setLastError(const TQSqlError &); + +private: + TQSqlDriver(const TQSqlDriver &); +}; diff --git a/sip/tqtsql/tqsqleditorfactory.sip b/sip/tqtsql/tqsqleditorfactory.sip new file mode 100644 index 0000000..cf0d361 --- /dev/null +++ b/sip/tqtsql/tqsqleditorfactory.sip @@ -0,0 +1,51 @@ +// This is the SIP interface definition for TQSqlEditorFactory. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQSqlEditorFactory (TQt v3+) + +TQSqlEditorFactory is fully implemented. + + +%End + + +class TQSqlEditorFactory : TQEditorFactory +{ +%TypeHeaderCode +#include +%End + +public: + TQSqlEditorFactory(TQObject * /TransferThis/ = 0,const char * = 0); + + virtual TQWidget *createEditor(TQWidget * /TransferThis/, + const TQVariant &) /Factory/; + virtual TQWidget *createEditor(TQWidget * /TransferThis/, + const TQSqlField *) /Factory/; + + static TQSqlEditorFactory *defaultFactory(); + static void installDefaultFactory(TQSqlEditorFactory * /Transfer/); + +private: + TQSqlEditorFactory(const TQSqlEditorFactory &); +}; diff --git a/sip/tqtsql/tqsqlerror.sip b/sip/tqtsql/tqsqlerror.sip new file mode 100644 index 0000000..ae9dd70 --- /dev/null +++ b/sip/tqtsql/tqsqlerror.sip @@ -0,0 +1,62 @@ +// This is the SIP interface definition for TQSqlError. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQSqlError (TQt v3+) + +TQSqlError is fully implemented. + + +%End + + +class TQSqlError +{ +%TypeHeaderCode +#include +%End + +public: + enum Type { + None, + Connection, + Statement, + Transaction, + Unknown + }; + + TQSqlError(const TQString & = TQString::null, + const TQString & = TQString::null,int = TQSqlError::None, + int = -1); + TQSqlError(const TQSqlError &); + + TQString driverText() const; + virtual void setDriverText(const TQString &); + TQString databaseText() const; + virtual void setDatabaseText(const TQString &); + int type() const; + virtual void setType(int); + int number() const; + virtual void setNumber(int); + TQString text() const; + void showMessage(const TQString & = TQString::null) const; +}; diff --git a/sip/tqtsql/tqsqlfield.sip b/sip/tqtsql/tqsqlfield.sip new file mode 100644 index 0000000..c54e0f5 --- /dev/null +++ b/sip/tqtsql/tqsqlfield.sip @@ -0,0 +1,91 @@ +// This is the SIP interface definition for TQSqlField and TQSqlFieldInfo. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQSqlField (TQt v3+) + +TQSqlField is fully implemented. + + + +TQSqlFieldInfo (TQt v3+) + +TQSqlFieldInfo is fully implemented. + + +%End + + +class TQSqlField +{ +%TypeHeaderCode +#include +%End + +public: + TQSqlField(const TQString & = TQString::null, + TQVariant::Type = TQVariant::Invalid ); + TQSqlField(const TQSqlField &); + + virtual void setValue(const TQVariant &); + virtual TQVariant value() const; + virtual void setName(const TQString &); + TQString name() const; + virtual void setNull(); + bool isNull() const; + virtual void setReadOnly(bool); + bool isReadOnly() const; + void clear(bool = 1); + TQVariant::Type type() const; +}; + + +class TQSqlFieldInfo +{ +%TypeHeaderCode +#include +%End + +public: + TQSqlFieldInfo(const TQString & = TQString::null, + TQVariant::Type = TQVariant::Invalid,int = -1,int = -1, + int = -1,const TQVariant & = TQVariant(),int = 0,bool = 1, + bool = 0,bool = 0); + TQSqlFieldInfo(const TQSqlFieldInfo &); + TQSqlFieldInfo(const TQSqlField &,bool = 1); + + TQSqlField toField() const; + int isRequired() const; + TQVariant::Type type() const; + int length() const; + int precision() const; + TQVariant defaultValue() const; + TQString name() const; + int typeID() const; + bool isGenerated() const; + bool isTrim() const; + bool isCalculated() const; + + virtual void setTrim(bool); + virtual void setGenerated(bool); + virtual void setCalculated(bool); +}; diff --git a/sip/tqtsql/tqsqlform.sip b/sip/tqtsql/tqsqlform.sip new file mode 100644 index 0000000..9a03610 --- /dev/null +++ b/sip/tqtsql/tqsqlform.sip @@ -0,0 +1,68 @@ +// This is the SIP interface definition for TQSqlForm. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQSqlForm (TQt v3+) + +TQSqlForm is fully implemented. + + +%End + + +class TQSqlForm : TQObject +{ +%TypeHeaderCode +#include +%End + +public: + TQSqlForm(TQObject * /TransferThis/ = 0,const char * = 0); + + virtual void insert(TQWidget *,const TQString &); + virtual void remove(const TQString &); + uint count() const; + + TQWidget *widget(uint) const; + TQSqlField *widgetToField(TQWidget *) const; + TQWidget *fieldToWidget(TQSqlField *) const; + + void installPropertyMap(TQSqlPropertyMap * /Transfer/); + + virtual void setRecord(TQSqlRecord *); + +public slots: + virtual void readField(TQWidget *); + virtual void writeField(TQWidget *); + virtual void readFields(); + virtual void writeFields(); + + virtual void clear(); + virtual void clearValues(bool = 0); + +protected: + virtual void insert(TQWidget *,TQSqlField *); + virtual void remove(TQWidget *); + +private: + TQSqlForm(const TQSqlForm &); +}; diff --git a/sip/tqtsql/tqsqlindex.sip b/sip/tqtsql/tqsqlindex.sip new file mode 100644 index 0000000..5e6db25 --- /dev/null +++ b/sip/tqtsql/tqsqlindex.sip @@ -0,0 +1,60 @@ +// This is the SIP interface definition for TQSqlIndex. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQSqlIndex (TQt v3+) + +TQSqlIndex is fully implemented. + + +%End + + +class TQSqlIndex : TQSqlRecord +{ +%TypeHeaderCode +#include +%End + +public: + TQSqlIndex(const TQString & = TQString::null, + const TQString & = TQString::null); + TQSqlIndex(const TQSqlIndex &); + + virtual void setCursorName(const TQString &); + TQString cursorName() const; + virtual void setName(const TQString &); + TQString name() const; + + void append(const TQSqlField &); + virtual void append(const TQSqlField &,bool); + + bool isDescending(int) const; + virtual void setDescending(int,bool); + + TQString toString(const TQString & = TQString::null,const TQString & = ",", + bool = 1) const; + TQStringList toStringList(const TQString & = TQString::null, + bool = 1) const; + + static TQSqlIndex fromStringList(const TQStringList &,const TQSqlCursor *); +}; diff --git a/sip/tqtsql/tqsqlpropertymap.sip b/sip/tqtsql/tqsqlpropertymap.sip new file mode 100644 index 0000000..9e7b9ea --- /dev/null +++ b/sip/tqtsql/tqsqlpropertymap.sip @@ -0,0 +1,59 @@ +// This is the SIP interface definition for TQSqlPropertyMap. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQSqlPropertyMap (TQt v3+) + +TQSqlPropertyMap is fully implemented. However, because PyTQt +does not allow new properties to be defined, it is not possible to implement +custom editor widgets in Python and add them to a property map. These will +simply be ignored. + + + +This problem may be addressed in a future release of PyTQt. + + +%End + + +class TQSqlPropertyMap +{ +%TypeHeaderCode +#include +%End + +public: + TQSqlPropertyMap(); + + TQVariant property(TQWidget *); + virtual void setProperty(TQWidget *,const TQVariant &); + + void insert(const TQString &,const TQString &); + void remove(const TQString &); + + static TQSqlPropertyMap *defaultMap(); + static void installDefaultMap(TQSqlPropertyMap * /Transfer/); + +private: + TQSqlPropertyMap(const TQSqlPropertyMap &); +}; diff --git a/sip/tqtsql/tqsqlquery.sip b/sip/tqtsql/tqsqlquery.sip new file mode 100644 index 0000000..8212391 --- /dev/null +++ b/sip/tqtsql/tqsqlquery.sip @@ -0,0 +1,103 @@ +// This is the SIP interface definition for TQSqlQuery. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQSqlQuery (TQt v3+) + + TQMap<TQString,TQVariant> boundValues const + + + +Not yet implemented. (TQt v3.2.0+) + + + + virtual bool exec + const TQString &query + + +This has been renamed execQuery in Python. + + + + bool exec + + + +This has been renamed execQuery in Python. (TQt v3.1+) + + +%End + + +class TQSqlQuery +{ +%TypeHeaderCode +#include +%End + +public: + TQSqlQuery(TQSqlResult *); + TQSqlQuery(const TQString & = TQString::null,TQSqlDatabase * = 0); + TQSqlQuery(TQSqlDatabase *); + TQSqlQuery(const TQSqlQuery &); + + bool isValid() const; + bool isActive() const; + bool isNull(int) const; + int at() const; + TQString lastQuery() const; + int numRowsAffected() const; + TQSqlError lastError() const; + bool isSelect() const; + int size() const; + const TQSqlDriver *driver() const; + const TQSqlResult *result() const; + bool isForwardOnly() const; + void setForwardOnly(bool); + + virtual bool exec(const TQString &) /PyName=execQuery, ReleaseGIL/; + virtual TQVariant value(int) const; + + virtual bool seek(int,bool = 0) /ReleaseGIL/; + virtual bool next() /ReleaseGIL/; + virtual bool prev() /ReleaseGIL/; + virtual bool first() /ReleaseGIL/; + virtual bool last() /ReleaseGIL/; + + bool exec() /PyName=execQuery, ReleaseGIL/; + bool prepare(const TQString &); + void bindValue(const TQString &,const TQVariant &); + void bindValue(int,const TQVariant &); + void addBindValue(const TQVariant &); + void bindValue(const TQString &,const TQVariant &,TQSql::ParameterType); + void bindValue(int,const TQVariant &,TQSql::ParameterType); + void addBindValue(const TQVariant &,TQSql::ParameterType); + TQVariant boundValue(const TQString &) const; + TQVariant boundValue(int) const; +// TQMap boundValues() const; + TQString executedQuery() const; + +protected: + virtual void beforeSeek(); + virtual void afterSeek(); +}; diff --git a/sip/tqtsql/tqsqlrecord.sip b/sip/tqtsql/tqsqlrecord.sip new file mode 100644 index 0000000..4e79fac --- /dev/null +++ b/sip/tqtsql/tqsqlrecord.sip @@ -0,0 +1,171 @@ +// This is the SIP interface definition for TQSqlRecord and TQSqlRecordInfo. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQSqlRecord (TQt v3+) + +TQSqlRecord is fully implemented. + + + +TQSqlRecordInfo (TQt v3+) + +TQSqlRecordInfo is implemented as a Python list of +TQSqlFieldInfo instances. + + +%End + + +class TQSqlRecord +{ +%TypeHeaderCode +#include +%End + +public: + TQSqlRecord(); + TQSqlRecord(const TQSqlRecord &); + + virtual TQVariant value(int) const; + virtual TQVariant value(const TQString &) const; + virtual void setValue(int,const TQVariant &); + virtual void setValue(const TQString &,const TQVariant &); + bool isGenerated(int) const; + bool isGenerated(const TQString &) const; + virtual void setGenerated(const TQString &,bool); + virtual void setGenerated(int,bool); + virtual void setNull(int); + virtual void setNull(const TQString &); + bool isNull(int); + bool isNull(const TQString &); +// bool isNull(int) const; +// bool isNull(const TQString &) const; + + int position(const TQString &) const; + TQString fieldName(int) const; + TQSqlField *field(int); + TQSqlField *field(const TQString &); +// const TQSqlField *field(int) const; +// const TQSqlField *field(const TQString &) const; + + virtual void append(const TQSqlField &); + virtual void insert(int,const TQSqlField &); + virtual void remove(int); + + bool isEmpty() const; + bool contains(const TQString &) const; + virtual void clear(); + virtual void clearValues(bool = 0); + uint count() const; + virtual TQString toString(const TQString & = TQString::null, + const TQString & = ",") const; + virtual TQStringList toStringList(const TQString & = TQString::null) const; +}; + + +%MappedType TQSqlRecordInfo +{ +%TypeHeaderCode +#include +%End + +%ConvertFromTypeCode + // Convert to a Python list of TQSqlFieldInfo instances. + + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + TQValueListConstIterator it; + + for (it = sipCpp -> begin(); it != sipCpp -> end(); ++it) + { + PyObject *tmobj; + + if ((tmobj = sipConvertFromNewInstance(new TQSqlFieldInfo(*it),sipClass_TQSqlFieldInfo,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0) + { + Py_XDECREF(tmobj); + Py_DECREF(l); + + return NULL; + } + + ++i; + } + + return l; +%End + + +%ConvertToTypeCode + // Convert a Python list of TQSqlFieldInfo instances to a TQSqlRecordInfo + // 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_TQSqlFieldInfo,SIP_NOT_NONE)) + return 0; + + return 1; + } + + TQSqlRecordInfo *qri = new TQSqlRecordInfo; + + 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. + TQSqlFieldInfo *itm = reinterpret_cast(sipConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_TQSqlFieldInfo,0,SIP_NOT_NONE,&state,&iserr)); + + if (iserr) + { + sipReleaseInstance(itm,sipClass_TQSqlFieldInfo,state); + + *sipIsErr = 1; + delete qri; + + return 0; + } + + qri -> append(*itm); + + sipReleaseInstance(itm,sipClass_TQSqlFieldInfo,state); + } + + *sipCppPtr = qri; + + return sipGetState(sipTransferObj); +%End +}; diff --git a/sip/tqtsql/tqsqlresult.sip b/sip/tqtsql/tqsqlresult.sip new file mode 100644 index 0000000..144f355 --- /dev/null +++ b/sip/tqtsql/tqsqlresult.sip @@ -0,0 +1,69 @@ +// This is the SIP interface definition for TQSqlResult. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQSqlResult (TQt v3+) + +TQSqlResult is fully implemented. + + +%End + + +class TQSqlResult +{ +%TypeHeaderCode +#include +%End + +protected: + TQSqlResult(const TQSqlDriver *); + + int at() const; + TQString lastQuery() const; + TQSqlError lastError() const; + bool isValid() const; + bool isActive() const; + bool isSelect() const; + bool isForwardOnly() const; + const TQSqlDriver *driver() const; + virtual void setAt(int); + virtual void setActive(bool); + virtual void setLastError(const TQSqlError &); + virtual void setQuery(const TQString &); + virtual void setSelect(bool); + virtual void setForwardOnly(bool); + + virtual TQVariant data(int) = 0; + virtual bool isNull(int) = 0; + virtual bool reset(const TQString &) = 0; + virtual bool fetch(int) = 0; + virtual bool fetchNext(); + virtual bool fetchPrev(); + virtual bool fetchFirst() = 0; + virtual bool fetchLast() = 0; + virtual int size() = 0; + virtual int numRowsAffected() = 0; + +private: + TQSqlResult(const TQSqlResult &); +}; diff --git a/sip/tqtsql/tqsqlselectcursor.sip b/sip/tqtsql/tqsqlselectcursor.sip new file mode 100644 index 0000000..a33fee3 --- /dev/null +++ b/sip/tqtsql/tqsqlselectcursor.sip @@ -0,0 +1,88 @@ +// This is the SIP interface definition for TQSqlSelectCursor. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQSqlSelectCursor (TQt v3.2.0+) + + int del + bool invalidate = TRUE + + +This has been renamed delRecords in Python. + + + + bool exec + const TQString &query + + +This has been renamed execQuery in Python. + + +%End + + +class TQSqlSelectCursor : TQSqlCursor +{ +%TypeHeaderCode +#include +%End + +public: + TQSqlSelectCursor(const TQString & = TQString::null,TQSqlDatabase * = 0); + TQSqlSelectCursor(const TQSqlSelectCursor &); + ~TQSqlSelectCursor(); + + bool exec(const TQString &) /PyName=execQuery, ReleaseGIL/; + bool select() /ReleaseGIL/; + +protected: + TQSqlIndex primaryIndex(bool = 1) const; + TQSqlIndex index(const TQStringList &) const; + TQSqlIndex index(const TQString &) const; +// TQSqlIndex index(const char *) const; + void setPrimaryIndex(const TQSqlIndex &); + void append(const TQSqlFieldInfo &); + void insert(int,const TQSqlFieldInfo &); + void remove(int); + void clear(); + void setGenerated(const TQString &,bool); + void setGenerated(int,bool); + TQSqlRecord *editBuffer(bool = 0); + TQSqlRecord *primeInsert(); + TQSqlRecord *primeUpdate(); + TQSqlRecord *primeDelete(); + int insert(bool = 1) /ReleaseGIL/; + int update(bool = 1) /ReleaseGIL/; + int del(bool = 1) /PyName=delRecords, ReleaseGIL/; + void setMode(int); + + void setSort(const TQSqlIndex &); + TQSqlIndex sort() const; + void setFilter(const TQString &); + TQString filter() const; + void setName(const TQString &,bool = 1); + TQString name() const; + TQString toString(const TQString & = TQString::null, + const TQString & = ",") const; + bool select(const TQString &,const TQSqlIndex & = TQSqlIndex()) /ReleaseGIL/; +}; diff --git a/sip/tqtsql/tqtsqlmod.sip b/sip/tqtsql/tqtsqlmod.sip new file mode 100644 index 0000000..10be45e --- /dev/null +++ b/sip/tqtsql/tqtsqlmod.sip @@ -0,0 +1,88 @@ +// This is the SIP interface definition for the tqtsql module of PyTQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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.tqtsql 1 + +%Import tqt/tqtmod.sip +%Import tqttable/tqttablemod.sip + +%Include copying.sip + + +%Include tqdatabrowser.sip +%Include tqdatatable.sip +%Include tqdataview.sip +%Include tqeditorfactory.sip +%Include tqsql.sip +%Include tqsqlcursor.sip +%Include tqsqldatabase.sip +%Include tqsqldriver.sip +%Include tqsqleditorfactory.sip +%Include tqsqlerror.sip +%Include tqsqlfield.sip +%Include tqsqlform.sip +%Include tqsqlindex.sip +%Include tqsqlpropertymap.sip +%Include tqsqlquery.sip +%Include tqsqlrecord.sip +%Include tqsqlresult.sip +%Include tqsqlselectcursor.sip + + +// The build file template. + +%Makefile tqtsql.pro.in +# The project file for the tqtsql module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited +# +# 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_TQTTABLE_MODULE@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End diff --git a/sip/tqttable/copying.sip b/sip/tqttable/copying.sip new file mode 100644 index 0000000..49b4531 --- /dev/null +++ b/sip/tqttable/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyTQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 + +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/tqttable/tqtable.sip b/sip/tqttable/tqtable.sip new file mode 100644 index 0000000..8b19fea --- /dev/null +++ b/sip/tqttable/tqtable.sip @@ -0,0 +1,441 @@ +// This is the SIP interface definition for TQTable, TQTableItem, +// TQCheckTableItem, TQComboTableItem and TQTableSelection. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQTable (TQt v2.2+) + +TQTable is fully implemented. + + + +TQTableItem (TQt v2.2+) + +TQTableItem is fully implemented. + + + +TQCheckTableItem (TQt v3+) + +TQCheckTableItem is fully implemented. + + + +TQComboTableItem (TQt v3+) + +TQComboTableItem is fully implemented. + + + +TQTableSelection (TQt v2.2+) + +TQTableSelection is fully implemented. + + +%End + + +%If (TQt_TABLE) + +class TQTableSelection +{ +%TypeHeaderCode +#include +%End + +public: + TQTableSelection(); + TQTableSelection(int,int,int,int); + + void init(int,int); + void expandTo(int,int); + + int topRow() const; + int bottomRow() const; + int leftCol() const; + int rightCol() const; + int anchorRow() const; + int anchorCol() const; + int numRows() const; + int numCols() const; + + bool isActive() const; + bool isEmpty() const; +}; + + +class TQTableItem : TQt +{ +%TypeHeaderCode +#include +%End + +public: + enum EditType { + Never, + OnTyping, + WhenCurrent, + Always + }; + + // Note that the TQt documentation is wrong. Ownership is only taken by + // TQTable::setItem(). + TQTableItem(TQTable *,EditType); + TQTableItem(TQTable *,EditType,const TQString &); + TQTableItem(TQTable *,EditType,const TQString &,const TQPixmap &); + +%ConvertToSubClassCode + Py_BEGIN_ALLOW_THREADS + + int rtti = sipCpp -> rtti(); + + if (rtti == TQCheckTableItem::RTTI) + sipClass = sipClass_TQCheckTableItem; + else if (rtti == TQComboTableItem::RTTI) + sipClass = sipClass_TQComboTableItem; + else + sipClass = 0; + + Py_END_ALLOW_THREADS +%End + + virtual TQPixmap pixmap() const; + virtual TQString text() const; + virtual void setPixmap(const TQPixmap &); + virtual void setText(const TQString &); + TQTable *table() const; + + virtual int alignment() const; + virtual void setWordWrap(bool); + bool wordWrap() const; + + EditType editType() const; + virtual TQWidget *createEditor() const /Factory/; + virtual void setContentFromEditor(TQWidget *); + virtual void setReplaceable(bool); + bool isReplaceable() const; + + virtual TQString key() const; + virtual TQSize sizeHint() const; + + virtual void setSpan(int,int); + int rowSpan() const; + int colSpan() const; + + virtual void setRow(int); + virtual void setCol(int); + int row() const; + int col() const; + + virtual void paint(TQPainter *,const TQColorGroup &,const TQRect &,bool); + + void updateEditor(int,int); + + virtual void setEnabled(bool); + bool isEnabled() const; + + virtual int rtti() const; +}; + + +class TQComboTableItem : TQTableItem +{ +%TypeHeaderCode +#include +%End + +public: + // Note that the TQt documentation is wrong. Ownership is only taken by + // TQTable::setItem(). + TQComboTableItem(TQTable *,const TQStringList &,bool = 0); + + virtual TQWidget *createEditor() const /Factory/; + virtual void setContentFromEditor(TQWidget *); + virtual void paint(TQPainter *,const TQColorGroup &,const TQRect &,bool); + virtual void setCurrentItem(int); + virtual void setCurrentItem(const TQString &); + int currentItem() const; + TQString currentText() const; + int count() const; + TQString text(int) const; + virtual void setEditable(bool); + bool isEditable() const; + virtual void setStringList(const TQStringList &); + + int rtti() const; + + TQSize sizeHint() const; +}; + + +class TQCheckTableItem : TQTableItem +{ +%TypeHeaderCode +#include +%End + +public: + // Note that the TQt documentation is wrong. Ownership is only taken by + // TQTable::setItem(). + TQCheckTableItem(TQTable *,const TQString &); + + void setText(const TQString &); + virtual TQWidget *createEditor() const /Factory/; + virtual void setContentFromEditor(TQWidget *); + virtual void paint(TQPainter *,const TQColorGroup &,const TQRect &,bool); + virtual void setChecked(bool); + bool isChecked() const; + + int rtti() const; + + TQSize sizeHint() const; +}; + + +class TQTable : TQScrollView +{ +%TypeHeaderCode +#include +%End + +public: + TQTable(TQWidget * /TransferThis/ = 0,const char * = 0); + TQTable(int,int,TQWidget * /TransferThis/ = 0,const char * = 0); + +%ConvertToSubClassCode + sipClass = (sipCpp->inherits(sipName_TQTable) ? sipClass_TQTable : NULL); +%End + + TQHeader *horizontalHeader() const; + TQHeader *verticalHeader() const; + + enum SelectionMode { + Single, + Multi, + SingleRow, + MultiRow, + NoSelection + }; + + virtual void setSelectionMode(SelectionMode); + SelectionMode selectionMode() const; + + virtual void setItem(int,int,TQTableItem * /Transfer/); + virtual void setText(int,int,const TQString &); + virtual void setPixmap(int,int,const TQPixmap &); + virtual TQTableItem *item(int,int) const; + virtual TQString text(int,int) const; + virtual TQPixmap pixmap(int,int) const; + virtual void clearCell(int,int); + + virtual TQRect cellGeometry(int,int) const; + virtual int columnWidth(int) const; + virtual int rowHeight(int) const; + virtual int columnPos(int) const; + virtual int rowPos(int) const; + virtual int columnAt(int) const; + virtual int rowAt(int) const; + + virtual int numRows() const; + virtual int numCols() const; + + void updateCell(int,int); + + bool eventFilter(TQObject *,TQEvent *); + + int currentRow() const; + int currentColumn() const; + void ensureCellVisible(int,int); + + bool isSelected(int,int) const; + bool isRowSelected(int,bool = 0) const; + bool isColumnSelected(int,bool = 0) const; + int numSelections() const; + TQTableSelection selection(int) const; + virtual int addSelection(const TQTableSelection &); + virtual void removeSelection(const TQTableSelection &); + virtual void removeSelection(int); + virtual int currentSelection() const; + + void selectCells(int,int,int,int); + void selectRow(int); + void selectColumn(int); + + bool showGrid() const; + + bool columnMovingEnabled() const; + bool rowMovingEnabled() const; + + virtual void sortColumn(int,bool = 1,bool = 0); + + bool sorting() const; + + virtual void takeItem(TQTableItem * /TransferBack/); + + virtual void setCellWidget(int,int,TQWidget * /Transfer/); + virtual TQWidget *cellWidget(int,int) const; + virtual void clearCellWidget(int,int); + + virtual TQRect cellRect(int,int) const; + + virtual void paintCell(TQPainter *,int,int,const TQRect &,bool); + virtual void paintCell(TQPainter *,int,int,const TQRect &,bool, + const TQColorGroup &); + virtual void paintFocus(TQPainter *,const TQRect &); + TQSize sizeHint() const; + + bool isReadOnly() const; + bool isRowReadOnly(int) const; + bool isColumnReadOnly(int) const; + + void setEnabled(bool); + + void repaintSelections(); + + enum FocusStyle { + FollowStyle, + SpreadSheet + }; + + virtual void setFocusStyle(FocusStyle); + FocusStyle focusStyle() const; + + void updateHeaderStates(); + +public slots: + virtual void setNumRows(int); + virtual void setNumCols(int); + virtual void setShowGrid(bool); + virtual void hideRow(int); + virtual void hideColumn(int); + virtual void showRow(int); + virtual void showColumn(int); + bool isRowHidden(int) const; + bool isColumnHidden(int) const; + + virtual void setColumnWidth(int,int); + virtual void setRowHeight(int,int); + + virtual void adjustColumn(int); + virtual void adjustRow(int); + + virtual void setColumnStretchable(int,bool); + virtual void setRowStretchable(int,bool); + bool isColumnStretchable(int) const; + bool isRowStretchable(int) const; + virtual void setSorting(bool); + virtual void swapRows(int,int,bool = 0); + virtual void swapColumns(int,int,bool = 0); + virtual void swapCells(int,int,int,int); + + virtual void setLeftMargin(int); + virtual void setTopMargin(int); + virtual void setCurrentCell(int,int); + void clearSelection(bool = 1); + virtual void setColumnMovingEnabled(bool); + virtual void setRowMovingEnabled(bool); + + virtual void setReadOnly(bool); + virtual void setRowReadOnly(int,bool); + virtual void setColumnReadOnly(int,bool); + + virtual void setDragEnabled(bool); + bool dragEnabled() const; + + virtual void insertRows(int,int = 1); + virtual void insertColumns(int,int = 1); + virtual void removeRow(int); + virtual void removeRows(const TQMemArray &); + virtual void removeColumn(int); + virtual void removeColumns(const TQMemArray &); + + virtual void editCell(int,int,bool = 0); + + void setRowLabels(const TQStringList &); + void setColumnLabels(const TQStringList &); + +protected: + enum EditMode { + NotEditing, + Editing, + Replacing + }; + + void drawContents(TQPainter *,int,int,int,int); + void contentsMousePressEvent(TQMouseEvent *); + void contentsMouseMoveEvent(TQMouseEvent *); + void contentsMouseDoubleClickEvent(TQMouseEvent *); + void contentsMouseReleaseEvent(TQMouseEvent *); + void contentsContextMenuEvent(TQContextMenuEvent *); + void keyPressEvent(TQKeyEvent *); + void focusInEvent(TQFocusEvent *); + void focusOutEvent(TQFocusEvent *); + void viewportResizeEvent(TQResizeEvent *); + void showEvent(TQShowEvent *); + void paintEvent(TQPaintEvent *); + void setEditMode(EditMode,int,int); + virtual void contentsDragEnterEvent(TQDragEnterEvent *); + virtual void contentsDragMoveEvent(TQDragMoveEvent *); + virtual void contentsDragLeaveEvent(TQDragLeaveEvent *); + virtual void contentsDropEvent(TQDropEvent *); + virtual TQDragObject *dragObject(); + virtual void startDrag(); + + virtual void paintEmptyArea(TQPainter *,int,int,int,int); + virtual void activateNextCell(); + virtual TQWidget *createEditor(int,int,bool) const /Factory/; + virtual void setCellContentFromEditor(int,int); + virtual TQWidget *beginEdit(int,int,bool); + virtual void endEdit(int,int,bool,bool); + + virtual void resizeData(int); + virtual void insertWidget(int,int,TQWidget *); + int indexOf(int,int) const; + + void windowActivationChange(bool); + bool isEditing() const; + EditMode editMode() const; + int currEditRow() const; + int currEditCol() const; + +protected slots: + virtual void columnWidthChanged(int); + virtual void rowHeightChanged(int); + virtual void columnIndexChanged(int,int,int); + virtual void rowIndexChanged(int,int,int); + virtual void columnClicked(int); + +signals: + void currentChanged(int,int); + void clicked(int,int,int,const TQPoint &); + void doubleClicked(int,int,int,const TQPoint &); + void pressed(int,int,int,const TQPoint &); + void selectionChanged(); + void valueChanged(int,int); + void contextMenuRequested(int,int,const TQPoint &); + void dropped(TQDropEvent *); + +private: + TQTable(const TQTable &); +}; + +%End diff --git a/sip/tqttable/tqttablemod.sip b/sip/tqttable/tqttablemod.sip new file mode 100644 index 0000000..6dc80ce --- /dev/null +++ b/sip/tqttable/tqttablemod.sip @@ -0,0 +1,70 @@ +// This is the SIP interface definition for the tqttable module of PyTQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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.tqttable 1 + +%Import tqt/tqtmod.sip + +%Include copying.sip + + +%Include tqtable.sip + + +// The build file template. + +%Makefile tqttable.pro.in +# The project file for the tqttable module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited +# +# 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_TQT_MODULE@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End diff --git a/sip/tqtui/copying.sip b/sip/tqtui/copying.sip new file mode 100644 index 0000000..49b4531 --- /dev/null +++ b/sip/tqtui/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyTQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 + +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/tqtui/tqtuimod.sip b/sip/tqtui/tqtuimod.sip new file mode 100644 index 0000000..f993194 --- /dev/null +++ b/sip/tqtui/tqtuimod.sip @@ -0,0 +1,71 @@ +// This is the SIP interface definition for the tqtui module of PyTQt. Thanks to +// Hans-Peter Jansen for the original work. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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.tqtui 1 + +%Import tqt/tqtmod.sip + +%Include copying.sip + + +%Include tqwidgetfactory.sip + + +// The build file template. + +%Makefile tqtui.pro.in +# The project file for the tqtui module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited +# +# 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_TQT_MODULE@ @PYTQT_TQUI_LIB@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End diff --git a/sip/tqtui/tqwidgetfactory.sip b/sip/tqtui/tqwidgetfactory.sip new file mode 100644 index 0000000..c58c477 --- /dev/null +++ b/sip/tqtui/tqwidgetfactory.sip @@ -0,0 +1,57 @@ +// This is the SIP interface definition for TQWidgetFactory. Thanks to +// Hans-Peter Jansen for the original work. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQWidgetFactory (TQt v3+) + +TQWidgetFactory is fully implemented. + + +%End + + +class TQWidgetFactory +{ +%TypeHeaderCode +#include +%End + +public: + TQWidgetFactory(); + virtual ~TQWidgetFactory(); + + static TQWidget *create(const TQString &,TQObject * = 0, + TQWidget * /TransferThis/ = 0, + const char * = 0) /Factory/; + static TQWidget *create(TQIODevice *,TQObject * = 0, + TQWidget * /TransferThis/ = 0, + const char * = 0) /Factory/; + static void addWidgetFactory(TQWidgetFactory * /Transfer/); + static void loadImages(const TQString &); + + virtual TQWidget *createWidget(const TQString &,TQWidget * /TransferThis/, + const char *) const /Factory/; + + static TQStringList widgets(); + static bool supportsWidget(const TQString &); +}; diff --git a/sip/tqtxml/copying.sip b/sip/tqtxml/copying.sip new file mode 100644 index 0000000..49b4531 --- /dev/null +++ b/sip/tqtxml/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyTQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 + +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/tqtxml/tqdom.sip b/sip/tqtxml/tqdom.sip new file mode 100644 index 0000000..2dc3a9d --- /dev/null +++ b/sip/tqtxml/tqdom.sip @@ -0,0 +1,826 @@ +// This is the SIP interface definition for the TQDom classes. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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 +TQDomImplementation (TQt v2.2+) + +TQDomImplementation is fully implemented. + + + +TQDomNode (TQt v2.2+) + +TQDomNode is fully implemented, including the Python +== and != operators. + + + +TQDomNodeList (TQt v2.2+) + +TQDomNodeList is fully implemented. + + + +TQDomDocument (TQt v2.2+) + + bool setContent + const TQCString &buffer + bool namespaceProcessing + TQString *errorMsg = 0 + int *errorLine = 0 + int *errorColumn = 0 + + +This takes the buffer and +namespaceProcessing parameters and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+) + + + + bool setContent + const TQByteArray &buffer + bool namespaceProcessing + TQString *errorMsg = 0 + int *errorLine = 0 + int *errorColumn = 0 + + +This takes the buffer and +namespaceProcessing parameters and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+) + + + + bool setContent + const TQString &text + bool namespaceProcessing + TQString *errorMsg = 0 + int *errorLine = 0 + int *errorColumn = 0 + + +This takes the text and +namespaceProcessing parameters and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+) + + + + bool setContent + const TQIODevice *dev + bool namespaceProcessing + TQString *errorMsg = 0 + int *errorLine = 0 + int *errorColumn = 0 + + +This takes the dev and +namespaceProcessing parameters and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+) + + + + bool setContent + const TQCString &buffer + TQString *errorMsg = 0 + int *errorLine = 0 + int *errorColumn = 0 + + +This takes the buffer parameter only and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+) + + + + bool setContent + const TQByteArray &buffer + TQString *errorMsg = 0 + int *errorLine = 0 + int *errorColumn = 0 + + +This takes the buffer parameter only and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+) + + + + bool setContent + const TQString &text + TQString *errorMsg = 0 + int *errorLine = 0 + int *errorColumn = 0 + + +This takes the text parameter only and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+) + + + + bool setContent + const TQIODevice *dev + TQString *errorMsg = 0 + int *errorLine = 0 + int *errorColumn = 0 + + +This takes the dev parameter only and returns a tuple +containing the bool result and the +errorMsg, errorLine and +errorColumn values. (TQt v3+) + + + + bool setContent + TQXmlInputSource *source + TQXmlReader *reader + TQString *errorMsg = 0 + int *errorLine = 0 + int *errorColumn = 0 + + +Not yet implemented. (TQt v3.2.0+) + + + +TQDomDocumentFragment (TQt v2.2+) + +TQDomDocumentFragment is fully implemented. + + + +TQDomDocumentType (TQt v2.2+) + +TQDomDocumentType is fully implemented. + + + +TQDomNamedNodeMap (TQt v2.2+) + +TQDomNamedNodeMap is fully implemented. + + + +TQDomCharacterData (TQt v2.2+) + +TQDomCharacterData is fully implemented. + + + +TQDomAttr (TQt v2.2+) + +TQDomAttr is fully implemented. + + + +TQDomElement (TQt v2.2+) + +TQDomElement is fully implemented. + + + +TQDomText (TQt v2.2+) + +TQDomText is fully implemented. + + + +TQDomComment (TQt v2.2+) + +TQDomComment is fully implemented. + + + +TQDomCDATASection (TQt v2.2+) + +TQDomCDATASection is fully implemented. + + + +TQDomNotation (TQt v2.2+) + +TQDomNotation is fully implemented. + + + +TQDomEntity (TQt v2.2+) + +TQDomEntity is fully implemented. + + + +TQDomEntityReference (TQt v2.2+) + +TQDomEntityReference is fully implemented. + + + +TQDomProcessingInstruction (TQt v2.2+) + +TQDomProcessingInstruction is fully implemented. + + +%End + + +%If (TQt_DOM) + +class TQDomImplementation +{ +%TypeHeaderCode +#include +%End + +public: + TQDomImplementation(); + TQDomImplementation(const TQDomImplementation &); + + virtual bool hasFeature(const TQString &,const TQString &); + virtual TQDomDocumentType createDocumentType(const TQString &, + const TQString &, + const TQString &); + virtual TQDomDocument createDocument(const TQString &,const TQString &, + const TQDomDocumentType &); + bool isNull(); +}; + + +class TQDomNode +{ +%TypeHeaderCode +#include +%End + +public: + enum NodeType { + ElementNode, + AttributeNode, + TextNode, + CDATASectionNode, + EntityReferenceNode, + EntityNode, + ProcessingInstructionNode, + CommentNode, + DocumentNode, + DocumentTypeNode, + DocumentFragmentNode, + NotationNode, + BaseNode, + CharacterDataNode + }; + + TQDomNode(); + TQDomNode(const TQDomNode &); + + bool operator==(const TQDomNode &) const; + bool operator!=(const TQDomNode &) const; + + virtual TQDomNode insertBefore(const TQDomNode &,const TQDomNode &); + virtual TQDomNode insertAfter(const TQDomNode &,const TQDomNode &); + virtual TQDomNode replaceChild(const TQDomNode &,const TQDomNode &); + virtual TQDomNode removeChild(const TQDomNode &); + virtual TQDomNode appendChild(const TQDomNode &); + virtual bool hasChildNodes() const; + virtual TQDomNode cloneNode(bool = 1) const; + virtual void normalize(); + virtual bool isSupported(const TQString &,const TQString &) const; + + virtual TQString nodeName() const; + virtual NodeType nodeType() const; + virtual TQDomNode parentNode() const; + virtual TQDomNodeList childNodes() const; + virtual TQDomNode firstChild() const; + virtual TQDomNode lastChild() const; + virtual TQDomNode previousSibling() const; + virtual TQDomNode nextSibling() const; + virtual TQDomNamedNodeMap attributes() const; + virtual TQDomDocument ownerDocument() const; + virtual TQString namespaceURI() const; + virtual TQString localName() const; + virtual bool hasAttributes() const; + + virtual TQString nodeValue() const; + virtual void setNodeValue(const TQString &); + virtual TQString prefix() const; + virtual void setPrefix(const TQString &); + + virtual bool isAttr() const; + virtual bool isCDATASection() const; + virtual bool isDocumentFragment() const; + virtual bool isDocument() const; + virtual bool isDocumentType() const; + virtual bool isElement() const; + virtual bool isEntityReference() const; + virtual bool isText() const; + virtual bool isEntity() const; + virtual bool isNotation() const; + virtual bool isProcessingInstruction() const; + virtual bool isCharacterData() const; + virtual bool isComment() const; + + TQDomNode namedItem(const TQString &) const; + + bool isNull() const; + void clear(); + + TQDomAttr toAttr(); + TQDomCDATASection toCDATASection(); + TQDomDocumentFragment toDocumentFragment(); + TQDomDocument toDocument(); + TQDomDocumentType toDocumentType(); + TQDomElement toElement(); + TQDomEntityReference toEntityReference(); + TQDomText toText(); + TQDomEntity toEntity(); + TQDomNotation toNotation(); + TQDomProcessingInstruction toProcessingInstruction(); + TQDomCharacterData toCharacterData(); + TQDomComment toComment(); + + void save(TQTextStream &,int) const; +}; + + +class TQDomNodeList +{ +%TypeHeaderCode +#include +%End + +public: + TQDomNodeList(); + TQDomNodeList(const TQDomNodeList &); + + virtual TQDomNode item(int) const; + + virtual uint length() const; + uint count() const; +}; + + +class TQDomDocumentType : TQDomNode +{ +%TypeHeaderCode +#include +%End + +public: + TQDomDocumentType(); + TQDomDocumentType(const TQDomDocumentType &); + + virtual TQString name() const; + virtual TQDomNamedNodeMap entities() const; + virtual TQDomNamedNodeMap notations() const; + virtual TQString publicId() const; + virtual TQString systemId() const; + virtual TQString internalSubset() const; + + TQDomNode::NodeType nodeType() const; + bool isDocumentType() const; +}; + + +class TQDomDocument : TQDomNode +{ +%TypeHeaderCode +#include +%End + +public: + TQDomDocument(); + TQDomDocument(const TQString &); + TQDomDocument(const TQDomDocumentType &); + TQDomDocument(const TQDomDocument &); + + TQDomElement createElement(const TQString &); + TQDomDocumentFragment createDocumentFragment(); + TQDomText createTextNode(const TQString &); + TQDomComment createComment(const TQString &); + TQDomCDATASection createCDATASection(const TQString &); + TQDomProcessingInstruction createProcessingInstruction(const TQString &, + const TQString &); + TQDomAttr createAttribute(const TQString &); + TQDomEntityReference createEntityReference(const TQString &); + TQDomNodeList elementsByTagName(const TQString &) const; + TQDomElement elementById(const TQString &); + + TQDomDocumentType doctype() const; + TQDomImplementation implementation() const; + TQDomElement documentElement() const; + + // Note that we need handwritten code for these because of the need to + // allocate storage for the error string. + SIP_PYTUPLE setContent(const TQCString &,bool); +%MethodCode + bool res; + TQString *emsg = new TQString(); + int eline, ecol; + + Py_BEGIN_ALLOW_THREADS + res = sipCpp -> TQDomDocument::setContent(*a0,a1,emsg,&eline,&ecol); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr, "(bNii)", res, emsg, + sipType_TQString, (PyObject *)0, eline, ecol); +%End + + SIP_PYTUPLE setContent(const TQByteArray &,bool); +%MethodCode + bool res; + TQString *emsg = new TQString(); + int eline, ecol; + + Py_BEGIN_ALLOW_THREADS + res = sipCpp -> TQDomDocument::setContent(*a0,a1,emsg,&eline,&ecol); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr, "(bNii)", res, emsg, + sipType_TQString, (PyObject *)0, eline, ecol); +%End + + SIP_PYTUPLE setContent(const TQString &,bool); +%MethodCode + bool res; + TQString *emsg = new TQString(); + int eline, ecol; + + Py_BEGIN_ALLOW_THREADS + res = sipCpp -> TQDomDocument::setContent(*a0,a1,emsg,&eline,&ecol); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr, "(bNii)", res, emsg, + sipType_TQString, (PyObject *)0, eline, ecol); +%End + + SIP_PYTUPLE setContent(TQIODevice *,bool); +%MethodCode + bool res; + TQString *emsg = new TQString(); + int eline, ecol; + + Py_BEGIN_ALLOW_THREADS + res = sipCpp -> TQDomDocument::setContent(a0,a1,emsg,&eline,&ecol); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr, "(bNii)", res, emsg, + sipType_TQString, (PyObject *)0, eline, ecol); +%End + + SIP_PYTUPLE setContent(const TQCString &); +%MethodCode + bool res; + TQString *emsg = new TQString(); + int eline, ecol; + + Py_BEGIN_ALLOW_THREADS + res = sipCpp -> TQDomDocument::setContent(*a0,emsg,&eline,&ecol); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr, "(bNii)", res, emsg, + sipType_TQString, (PyObject *)0, eline, ecol); +%End + + SIP_PYTUPLE setContent(const TQByteArray &); +%MethodCode + bool res; + TQString *emsg = new TQString(); + int eline, ecol; + + Py_BEGIN_ALLOW_THREADS + res = sipCpp -> TQDomDocument::setContent(*a0,emsg,&eline,&ecol); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr, "(bNii)", res, emsg, + sipType_TQString, (PyObject *)0, eline, ecol); +%End + + SIP_PYTUPLE setContent(const TQString &); +%MethodCode + bool res; + TQString *emsg = new TQString(); + int eline, ecol; + + Py_BEGIN_ALLOW_THREADS + res = sipCpp -> TQDomDocument::setContent(*a0,emsg,&eline,&ecol); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr, "(bNii)", res, emsg, + sipType_TQString, (PyObject *)0, eline, ecol); +%End + + SIP_PYTUPLE setContent(TQIODevice *); +%MethodCode + bool res; + TQString *emsg = new TQString(); + int eline, ecol; + + Py_BEGIN_ALLOW_THREADS + res = sipCpp -> TQDomDocument::setContent(a0,emsg,&eline,&ecol); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr, "(bNii)", res, emsg, + sipType_TQString, (PyObject *)0, eline, ecol); +%End + +// bool setContent(TQXmlInputSource *,TQXmlReader *,TQString * = 0,int * = 0, +// int * = 0); + + TQDomNode::NodeType nodeType() const; + bool isDocument() const; + + TQString toString() const; + TQString toString(int) const; + TQCString toCString() const; + TQCString toCString(int) const; +}; + + +class TQDomNamedNodeMap +{ +%TypeHeaderCode +#include +%End + +public: + TQDomNamedNodeMap(); + TQDomNamedNodeMap(const TQDomNamedNodeMap &); + + TQDomNode namedItem(const TQString &) const; + TQDomNode setNamedItem(const TQDomNode &); + TQDomNode removeNamedItem(const TQString &); + TQDomNode item(int) const; + TQDomNode namedItemNS(const TQString &,const TQString &) const; + TQDomNode setNamedItemNS(const TQDomNode &); + TQDomNode removeNamedItemNS(const TQString &,const TQString &); + + uint length() const; + uint count() const; + + bool contains(const TQString &) const; +}; + + +class TQDomDocumentFragment : TQDomNode +{ +%TypeHeaderCode +#include +%End + +public: + TQDomDocumentFragment(); + TQDomDocumentFragment(const TQDomDocumentFragment &); + + TQDomNode::NodeType nodeType() const; + bool isDocumentFragment() const; +}; + + +class TQDomCharacterData : TQDomNode +{ +%TypeHeaderCode +#include +%End + +public: + TQDomCharacterData(); + TQDomCharacterData(const TQDomCharacterData &); + + virtual TQString substringData(unsigned long,unsigned long); + virtual void appendData(const TQString &); + virtual void insertData(unsigned long,const TQString &); + virtual void deleteData(unsigned long,unsigned long); + virtual void replaceData(unsigned long,unsigned long,const TQString &); + + virtual uint length() const; + + virtual TQString data() const; + virtual void setData(const TQString &); + + TQDomNode::NodeType nodeType() const; + bool isCharacterData() const; +}; + + +class TQDomAttr : TQDomNode +{ +%TypeHeaderCode +#include +%End + +public: + TQDomAttr(); + TQDomAttr(const TQDomAttr&); + + virtual TQString name() const; + virtual bool specified() const; + virtual TQDomElement ownerElement() const; + + virtual TQString value() const; + virtual void setValue(const TQString &); + + TQDomNode::NodeType nodeType() const; + bool isAttr() const; +}; + + +class TQDomElement : TQDomNode +{ +%TypeHeaderCode +#include +%End + +public: + TQDomElement(); + TQDomElement(const TQDomElement &); + + TQString attribute(const TQString &, + const TQString & = TQString::null) const; + void setAttribute(const TQString &,const TQString &); + void setAttribute(const TQString &,int /Constrained/); +// void setAttribute(const TQString &,uint); +// void setAttribute(const TQString &,long); +// void setAttribute(const TQString &,ulong); + void setAttribute(const TQString &,double); + void removeAttribute(const TQString &); + TQDomAttr attributeNode(const TQString &); + TQDomAttr setAttributeNode(const TQDomAttr &); + TQDomAttr removeAttributeNode(const TQDomAttr &); + virtual TQDomNodeList elementsByTagName(const TQString &) const; + bool hasAttribute(const TQString &) const; + + TQString attributeNS(const TQString,const TQString &, + const TQString &) const; + void setAttributeNS(const TQString,const TQString &,const TQString &); + void setAttributeNS(const TQString,const TQString &,int /Constrained/); +// void setAttributeNS(const TQString,const TQString &,uint); +// void setAttributeNS(const TQString &,const TQString &,long); +// void setAttributeNS(const TQString &,const TQString &,ulong); + void setAttributeNS(const TQString,const TQString &,double); + void removeAttributeNS(const TQString &,const TQString &); + TQDomAttr attributeNodeNS(const TQString &,const TQString &); + TQDomAttr setAttributeNodeNS(const TQDomAttr &); + virtual TQDomNodeList elementsByTagNameNS(const TQString &, + const TQString &) const; + bool hasAttributeNS(const TQString &,const TQString &) const; + + TQString tagName() const; + void setTagName(const TQString &); + + TQDomNamedNodeMap attributes() const; + TQDomNode::NodeType nodeType() const; + bool isElement() const; + + TQString text() const; +}; + + +class TQDomText : TQDomCharacterData +{ +%TypeHeaderCode +#include +%End + +public: + TQDomText(); + TQDomText(const TQDomText &); + + TQDomText splitText(int); + + TQDomNode::NodeType nodeType() const; + bool isText() const; +}; + + +class TQDomComment : TQDomCharacterData +{ +%TypeHeaderCode +#include +%End + +public: + TQDomComment(); + TQDomComment(const TQDomComment &); + + TQDomNode::NodeType nodeType() const; + bool isComment() const; +}; + + +class TQDomCDATASection : TQDomText +{ +%TypeHeaderCode +#include +%End + +public: + TQDomCDATASection(); + TQDomCDATASection(const TQDomCDATASection&); + + TQDomNode::NodeType nodeType() const; + bool isCDATASection() const; +}; + + +class TQDomNotation : TQDomNode +{ +%TypeHeaderCode +#include +%End + +public: + TQDomNotation(); + TQDomNotation(const TQDomNotation &); + + TQString publicId() const; + TQString systemId() const; + + TQDomNode::NodeType nodeType() const; + bool isNotation() const; +}; + + +class TQDomEntity : TQDomNode +{ +%TypeHeaderCode +#include +%End + +public: + TQDomEntity(); + TQDomEntity(const TQDomEntity &); + + virtual TQString publicId() const; + virtual TQString systemId() const; + virtual TQString notationName() const; + + TQDomNode::NodeType nodeType() const; + bool isEntity() const; +}; + + +class TQDomEntityReference : TQDomNode +{ +%TypeHeaderCode +#include +%End + +public: + TQDomEntityReference(); + TQDomEntityReference(const TQDomEntityReference &); + + TQDomNode::NodeType nodeType() const; + bool isEntityReference() const; +}; + + +class TQDomProcessingInstruction : TQDomNode +{ +%TypeHeaderCode +#include +%End + +public: + TQDomProcessingInstruction(); + TQDomProcessingInstruction(const TQDomProcessingInstruction &); + + virtual TQString target() const; + + virtual TQString data() const; + virtual void setData(const TQString &); + + TQDomNode::NodeType nodeType() const; + bool isProcessingInstruction() const; +}; + +%End diff --git a/sip/tqtxml/tqtxmlmod.sip b/sip/tqtxml/tqtxmlmod.sip new file mode 100644 index 0000000..7e607fd --- /dev/null +++ b/sip/tqtxml/tqtxmlmod.sip @@ -0,0 +1,80 @@ +// This is the SIP interface definition for the tqtxml module of PyTQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited +// +// 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.tqtxml 0 + +%Import tqt/tqtmod.sip + +%Include copying.sip + + +%Include tqdom.sip + + +// This is only needed on Windows to make sure that the DLL containing the C++ +// code of the main tqt module is loaded before we import our own C++ code which +// has been linked against it. All other modules inherit from a class in the +// tqt module which sorts it out, but this module doesn't so we add a dummy. It +// is ignored by SIP v4.x and later. +%PrePythonCode +from PyTQt.tqt import TQObject +%End + + +// The build file template. + +%Makefile tqtxml.pro.in +# The project file for the tqtxml module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited +# +# 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_TQT_MODULE@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End -- cgit v1.2.1